using Admin.Core.Model; using SqlSugar; using System; using System.Collections.Generic; using System.Data; using System.Linq.Expressions; using System.Threading.Tasks; namespace Admin.Core.IService { public interface IBaseServices where TEntity : class { Task QueryByIdAsync(object objId); Task QueryByIdAsync(object objId, bool blnUseCache = false); Task> QueryByIDsAsync(object[] lstIds); Task AddAsync(TEntity model); Task AddAsync(List listEntity); Task DeleteByIdAsync(object id); Task DeleteAsync(TEntity model); Task DeletesAsync(List entitys); Task UpdateAsync(TEntity model); Task UpdateAsync(TEntity entity, string strWhere); Task UpdateAsync(object operateAnonymousObjects); Task UpdateAsync(TEntity entity, List lstColumns = null, List lstIgnoreColumns = null, string strWhere = ""); /// /// 正序查询第一条数据 /// /// Task FirstAsync(); /// /// 根据条件查询查询第一条数据 /// /// /// Task FirstAsync(Expression> whereExpression); Task> QueryAsync(); Task> QueryAsync(string strWhere); Task> QueryAsync(Expression> whereExpression); Task> QueryAsync(Expression> whereExpression, string strOrderByFileds); Task> QueryAsync(Expression> expression); Task> QueryAsync(Expression> expression, Expression> whereExpression,string strOrderByFileds); Task> QueryAsync(Expression> whereExpression, Expression> orderByExpression, bool isAsc = true); Task> QueryAsync(string strWhere, string strOrderByFileds); Task> QuerySqlAsync(string strSql, SugarParameter[] parameters = null); Task QueryTableAsync(string strSql, SugarParameter[] parameters = null); Task> QueryAsync(Expression> whereExpression, int intTop, string strOrderByFileds); Task> QueryAsync(string strWhere, int intTop, string strOrderByFileds); Task> QueryAsync( Expression> whereExpression, int intPageIndex, int intPageSize, string strOrderByFileds); Task> QueryAsync(string strWhere, int intPageIndex, int intPageSize, string strOrderByFileds); Task> QueryPageAsync(Expression> whereExpression, int intPageIndex = 1, int intPageSize = 20, string strOrderByFileds = null); Task> QueryMuchAsync( Expression> joinExpression, Expression> selectExpression, Expression> whereLambda = null) where T : class, new(); List Query(Expression> whereExpression); } }