using JiepeiWMS.Model; using SqlSugar; using System; using System.Collections.Generic; using System.Data; using System.Linq.Expressions; using System.Threading.Tasks; namespace JiepeiWMS.IRepository.Base { public interface IBaseRepository where TEntity : class { Task QueryById(object objId); Task QueryById(object objId, bool blnUseCache = false); Task> QueryByIDs(object[] lstIds); Task Add(TEntity model); Task Add(List listEntity); Task DeleteById(object id); Task Delete(TEntity model); Task DeleteByIds(object[] ids); Task Update(params TEntity[] models); Task Update(TEntity entity, string strWhere); Task Update(object operateAnonymousObjects); Task Update(TEntity entity, List lstColumns = null, List lstIgnoreColumns = null, string strWhere = ""); Task> Query(); Task GetModel(Expression> where); Task> Query(string strWhere); Task> Query(Expression> whereExpression); Task> Query(Expression> whereExpression, string strOrderByFileds); Task> Query(Expression> whereExpression, Expression> orderByExpression, bool isAsc = true); Task> Query(string strWhere, string strOrderByFileds); Task> Query(Expression> whereExpression, int intTop, string strOrderByFileds); Task> Query(string strWhere, int intTop, string strOrderByFileds); Task> QuerySql(string strSql, SugarParameter[] parameters = null); Task QueryTable(string strSql, SugarParameter[] parameters = null); int ExecuteSqlCommand(string strSql, SugarParameter[] parameters = null); /// /// 根据sql语句查询DataSet集合 /// /// /// /// Task QueryTableSet(string strSql, SugarParameter[] parameters = null); Task> Query( Expression> whereExpression, int intPageIndex, int intPageSize, string strOrderByFileds); Task> Query(string strWhere, int intPageIndex, int intPageSize, string strOrderByFileds); Task> QueryPage(Expression> whereExpression, int intPageIndex = 1, int intPageSize = 20, string strOrderByFileds = null); Task> QueryPage(Expression> joinExpression, Expression> selectExpression, Expression> whereExpression, int intPageIndex = 1, int intPageSize = 20, string strOrderByFileds = null) where T : class, new(); #region 5表关联 Task> QueryPage( Expression> joinExpression, Expression> selectExpression, Expression> whereExpression, int intPageIndex = 1, int intPageSize = 20, string strOrderByFileds = null); #endregion #region 6表关联 /// /// 六表联合查询-分页 /// /// 实体1 /// 实体1 /// 实体1 /// 实体1 /// 实体1 /// 实体1 /// 返回对象 /// 关联表达式 /// 返回表达式 /// 查询表达式 /// 页码 /// 页大小 /// 排序字段 /// Task> QueryPage( Expression> JoinExpression, Expression> SelectExpression, Expression> WhereExpression, int PageIndex = 1, int PageSize = 20, string OrderByFileds = null); #endregion /// /// 两表联合查询-分页 /// /// 实体1 /// 实体1 /// 返回对象 /// 关联表达式 /// 返回表达式 /// 查询表达式 /// 页码 /// 页大小 /// 排序字段 /// Task> QueryTabsPage( Expression> joinExpression, Expression> selectExpression, Expression> whereExpression, int intPageIndex = 1, int intPageSize = 20, string strOrderByFileds = null); Task> QueryTabsPage( Expression> joinExpression, Expression> selectExpression, Expression> whereExpression, int intPageIndex = 1, int intPageSize = 20, string strOrderByFileds = null); Task> QueryTabsPage( Expression> joinExpression, Expression> selectExpression, Expression> whereExpression, int intPageIndex = 1, int intPageSize = 20, string strOrderByFileds = null); Task> QueryTabsPage( Expression> joinExpression, Expression> selectExpression, Expression> whereExpression, int intPageIndex = 1, int intPageSize = 20, string strOrderByFileds = null); Task> QueryMuch( Expression> joinExpression, Expression> selectExpression, Expression> whereLambda = null) where T : class, new(); Task> QueryMuch( Expression> joinExpression, Expression> selectExpression, Expression> whereLambda = null) where T : class, new(); } }