| | |
| | | using System.Linq.Expressions; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.Enums; |
| | | |
| | | namespace WIDESEA_Core.BaseRepository |
| | | { |
| | |
| | | /// <returns>æ¥è¯¢ç»æ</returns> |
| | | TEntity QureyDataById(object id); |
| | | |
| | | Task<TEntity> QureyDataByIdAsync(object id); |
| | | |
| | | /// <summary> |
| | | /// éè¿ä¸»é®æ°ç»æ¥è¯¢æ°æ® |
| | | /// </summary> |
| | | /// <param name="lstIds">䏻鮿°ç»</param> |
| | | /// <returns>æ¥è¯¢ç»æéå</returns> |
| | | List<TEntity> QureyDataByIds(object[] lstIds); |
| | | |
| | | Task<List<TEntity>> QureyDataByIdsAsync(object[] lstIds); |
| | | |
| | | /// <summary> |
| | | /// éè¿ä¸»é®éåæ¥è¯¢æ°æ® |
| | |
| | | /// <returns>æ¥è¯¢ç»æéå</returns> |
| | | List<TEntity> QureyDataByIds(List<object> lstIds); |
| | | |
| | | Task<List<TEntity>> QureyDataByIdsAsync(List<object> lstIds); |
| | | |
| | | /// <summary> |
| | | /// æ·»å åæ¡æ°æ® |
| | | /// </summary> |
| | | /// <param name="entity"></param> |
| | | /// <returns>å½±åè¡æ°</returns> |
| | | int AddData(TEntity entity); |
| | | |
| | | Task<int> AddDataAsync(TEntity entity); |
| | | |
| | | /// <summary> |
| | | /// æ·»å 夿¡æ°æ® |
| | |
| | | /// <returns>å½±åè¡æ°</returns> |
| | | int AddData(List<TEntity> listEntity); |
| | | |
| | | Task<int> AddDataAsync(List<TEntity> listEntity); |
| | | |
| | | /// <summary> |
| | | /// éè¿ä¸»é®å 餿°æ® |
| | | /// </summary> |
| | | /// <param name="id">主é®</param> |
| | | /// <returns>å é¤ç»æ</returns> |
| | | bool DeleteDataById(object id); |
| | | |
| | | Task<bool> DeleteDataByIdAsync(object id); |
| | | |
| | | bool DeleteAndMoveIntoHty(TEntity entity, OperateType operateType); |
| | | |
| | | bool DeleteAndMoveIntoHty(List<TEntity> entities, OperateType operateType); |
| | | |
| | | /// <summary> |
| | | /// éè¿ä¸»é®æ°æ®å é¤å¤æ¡æ°æ® |
| | |
| | | /// <returns>å é¤ç»æ</returns> |
| | | bool DeleteDataByIds(object[] ids); |
| | | |
| | | Task<bool> DeleteDataByIdsAsync(object[] ids); |
| | | |
| | | /// <summary> |
| | | /// éè¿å®ä½æ°æ®å 餿°æ® |
| | | /// </summary> |
| | | /// <param name="ids">䏻鮿°ç»</param> |
| | | /// <returns>å é¤ç»æ</returns> |
| | | bool DeleteData(TEntity entity); |
| | | |
| | | Task<bool> DeleteDataAsync(TEntity entity); |
| | | |
| | | /// <summary> |
| | | /// éè¿å®ä½éåæ°æ®å 餿°æ® |
| | |
| | | /// <returns>å é¤ç»æ</returns> |
| | | bool DeleteData(List<TEntity> listEntity); |
| | | |
| | | Task<bool> DeleteDataAsync(List<TEntity> listEntity); |
| | | |
| | | /// <summary> |
| | | /// æ´æ°åæ¡æ°æ® |
| | | /// </summary> |
| | | /// <param name="entity"></param> |
| | | /// <returns></returns> |
| | | bool UpdateData(TEntity entity); |
| | | |
| | | Task<bool> UpdateDataAsync(TEntity entity); |
| | | |
| | | /// <summary> |
| | | /// æ´æ°å¤æ¡æ°æ® |
| | |
| | | /// <returns></returns> |
| | | bool UpdateData(List<TEntity> listEntity); |
| | | |
| | | Task<bool> UpdateDataAsync(List<TEntity> listEntity); |
| | | |
| | | /// <summary> |
| | | /// æå®åæ´æ°æ°æ® |
| | | /// </summary> |
| | |
| | | /// <param name="lstColumns"></param> |
| | | /// <param name="lstIgnoreColumns"></param> |
| | | /// <returns></returns> |
| | | bool UpdateData(TEntity entity, List<string> lstColumns, List<string> lstIgnoreColumns = null); |
| | | bool UpdateData(TEntity entity, List<string> lstColumns, List<string>? lstIgnoreColumns = null); |
| | | |
| | | Task<bool> UpdateDataAsync(TEntity entity, List<string> lstColumns, List<string>? lstIgnoreColumns = null); |
| | | |
| | | /// <summary> |
| | | /// æ¥è¯¢æææ°æ® |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | List<TEntity> QueryData(); |
| | | |
| | | Task<List<TEntity>> QueryDataAsync(); |
| | | |
| | | /// <summary> |
| | | /// æ¡ä»¶æ¥è¯¢æ°æ® |
| | |
| | | /// <returns></returns> |
| | | List<TEntity> QueryData(string where); |
| | | |
| | | Task<List<TEntity>> QueryDataAsync(string where); |
| | | |
| | | /// <summary> |
| | | /// æ¡ä»¶æ¥è¯¢æ°æ® |
| | | /// </summary> |
| | |
| | | /// <returns></returns> |
| | | List<TEntity> QueryData(Expression<Func<TEntity, bool>> whereExpression); |
| | | |
| | | Task<List<TEntity>> QueryDataAsync(Expression<Func<TEntity, bool>> whereExpression); |
| | | |
| | | TEntity QueryFirst(Expression<Func<TEntity, bool>> whereExpression); |
| | | |
| | | Task<TEntity> QueryFirstAsync(Expression<Func<TEntity, bool>> whereExpression); |
| | | |
| | | TResult QueryFirst<TResult>(Expression<Func<TEntity, bool>> whereExpression, Expression<Func<TEntity, TResult>> expression); |
| | | |
| | | Task<TResult> QueryFirstAsync<TResult>(Expression<Func<TEntity, bool>> whereExpression, Expression<Func<TEntity, TResult>> expression); |
| | | |
| | | TResult QueryFirst<TResult>(Expression<Func<TEntity, bool>> whereExpression, Expression<Func<TEntity, TResult>> expression, Dictionary<string, OrderByType> orderBy); |
| | | |
| | | Task<TResult> QueryFirstAsync<TResult>(Expression<Func<TEntity, bool>> whereExpression, Expression<Func<TEntity, TResult>> expression, Dictionary<string, OrderByType> orderBy); |
| | | |
| | | TEntity QueryFirst(Expression<Func<TEntity, bool>> whereExpression, Dictionary<string, OrderByType> orderBy); |
| | | |
| | | Task<TEntity> QueryFirstAsync(Expression<Func<TEntity, bool>> whereExpression, Dictionary<string, OrderByType> orderBy); |
| | | |
| | | /// <summary> |
| | | /// æ¡ä»¶æ¥è¯¢æ°æ®å¹¶æåº |
| | |
| | | /// <param name="whereExpression"></param> |
| | | /// <param name="orderByFields"></param> |
| | | /// <returns></returns> |
| | | List<TEntity> QueryData(Expression<Func<TEntity, bool>> whereExpression, string orderByFields); |
| | | List<TEntity> QueryData(Expression<Func<TEntity, bool>> whereExpression, Dictionary<string, OrderByType> orderBy); |
| | | |
| | | Task<List<TEntity>> QueryDataAsync(Expression<Func<TEntity, bool>> whereExpression, string orderByFields); |
| | | |
| | | /// <summary> |
| | | /// æ¡ä»¶æ¥è¯¢æ°æ®å¹¶æåº |
| | |
| | | /// <returns></returns> |
| | | List<TEntity> QueryData(string where, Dictionary<string, OrderByType> orderBy); |
| | | |
| | | Task<List<TEntity>> QueryDataAsync(string where, Dictionary<string, OrderByType> orderBy); |
| | | |
| | | /// <summary> |
| | | /// æ¥è¯¢æå®æ°æ®å¯¹è±¡ |
| | | /// </summary> |
| | |
| | | /// <param name="expression"></param> |
| | | /// <returns></returns> |
| | | List<TResult> QueryData<TResult>(Expression<Func<TEntity, TResult>> expression); |
| | | |
| | | Task<List<TResult>> QueryDataAsync<TResult>(Expression<Func<TEntity, TResult>> expression); |
| | | |
| | | /// <summary> |
| | | /// æ¡ä»¶æ¥è¯¢æå®æ°æ®å¯¹è±¡ |
| | |
| | | /// <param name="whereExpression"></param> |
| | | /// <param name="orderByFields"></param> |
| | | /// <returns></returns> |
| | | List<TResult> QueryData<TResult>(Expression<Func<TEntity, TResult>> expression, Expression<Func<TEntity, bool>> whereExpression, string orderByFields); |
| | | List<TResult> QueryData<TResult>(Expression<Func<TEntity, TResult>> expression, Expression<Func<TEntity, bool>> whereExpression, string orderByFields = ""); |
| | | |
| | | Task<List<TResult>> QueryDataAsync<TResult>(Expression<Func<TEntity, TResult>> expression, Expression<Func<TEntity, bool>> whereExpression, string orderByFields); |
| | | |
| | | /// <summary> |
| | | /// æ¡ä»¶æ¥è¯¢æ°æ®å¹¶æåº |
| | |
| | | /// <returns></returns> |
| | | List<TEntity> QueryData(Expression<Func<TEntity, bool>> whereExpression, Expression<Func<TEntity, object>> orderByExpression, bool isAsc = true); |
| | | |
| | | Task<List<TEntity>> QueryDataAsync(Expression<Func<TEntity, bool>> whereExpression, Expression<Func<TEntity, object>> orderByExpression, bool isAsc = true); |
| | | |
| | | /// <summary> |
| | | /// æ¡ä»¶æ¥è¯¢æ°æ®å¹¶æåº |
| | | /// </summary> |
| | |
| | | /// <returns></returns> |
| | | List<TEntity> QueryData(string where, string orderByFields); |
| | | |
| | | /// <summary> |
| | | /// åçSqlè¯å¥æ¥è¯¢æ°æ® |
| | | /// </summary> |
| | | /// <param name="sql"></param> |
| | | /// <param name="parameters"></param> |
| | | /// <returns></returns> |
| | | List<TEntity> QueryDataBySql(string sql, SugarParameter[] parameters = null); |
| | | Task<List<TEntity>> QueryDataAsync(string where, string orderByFields); |
| | | |
| | | /// <summary> |
| | | /// åçSqlè¯å¥æ¥è¯¢æ°æ® |
| | |
| | | /// <param name="sql"></param> |
| | | /// <param name="parameters"></param> |
| | | /// <returns></returns> |
| | | List<dynamic> QueryDynamicDataBySql(string sql, SugarParameter[] parameters = null); |
| | | List<TEntity> QueryDataBySql(string sql, SugarParameter[]? parameters = null); |
| | | |
| | | List<object> QueryObjectDataBySql(string sql, SugarParameter[] parameters = null); |
| | | Task<List<TEntity>> QueryDataBySqlAsync(string sql, SugarParameter[]? parameters = null); |
| | | |
| | | /// <summary> |
| | | /// åçSqlè¯å¥æ¥è¯¢æ°æ® |
| | | /// </summary> |
| | | /// <param name="sql"></param> |
| | | /// <param name="parameters"></param> |
| | | /// <returns></returns> |
| | | List<dynamic> QueryDynamicDataBySql(string sql, SugarParameter[]? parameters = null); |
| | | |
| | | Task<List<dynamic>> QueryDynamicDataBySqlAsync(string sql, SugarParameter[]? parameters = null); |
| | | |
| | | List<object> QueryObjectDataBySql(string sql, SugarParameter[]? parameters = null); |
| | | |
| | | Task<List<object>> QueryObjectDataBySqlAsync(string sql, SugarParameter[]? parameters = null); |
| | | |
| | | /// <summary> |
| | | /// åçSqlè¯å¥æ§è¡æä½ |
| | |
| | | /// <param name="sql"></param> |
| | | /// <param name="sqlParameters"></param> |
| | | /// <returns></returns> |
| | | public int ExecuteSqlCommand(string sql, params SqlParameter[] sqlParameters); |
| | | int ExecuteSqlCommand(string sql, params SqlParameter[] sqlParameters); |
| | | |
| | | Task<int> ExecuteSqlCommandAsync(string sql, params SqlParameter[] sqlParameters); |
| | | |
| | | /// <summary> |
| | | /// åçSqlè¯å¥æ¥è¯¢æ°æ® |
| | |
| | | /// <param name="sql"></param> |
| | | /// <param name="parameters"></param> |
| | | /// <returns></returns> |
| | | DataTable QueryTable(string sql, SugarParameter[] parameters = null); |
| | | DataTable QueryTable(string sql, SugarParameter[]? parameters = null); |
| | | |
| | | Task<DataTable> QueryTableAsync(string sql, SugarParameter[]? parameters = null); |
| | | |
| | | /// <summary> |
| | | /// æ¡ä»¶æ¥è¯¢æ°æ®æå®æ°éçè¡ |
| | |
| | | /// <returns></returns> |
| | | List<TEntity> QueryData(Expression<Func<TEntity, bool>> whereExpression, int top, string orderByFields); |
| | | |
| | | Task<List<TEntity>> QueryDataAsync(Expression<Func<TEntity, bool>> whereExpression, int top, string orderByFields); |
| | | |
| | | /// <summary> |
| | | /// æ¡ä»¶æ¥è¯¢æå®æ°éçè¡ |
| | | /// </summary> |
| | |
| | | /// <param name="orderByFields"></param> |
| | | /// <returns></returns> |
| | | List<TEntity> QueryData(string where, int top, string orderByFields); |
| | | |
| | | Task<List<TEntity>> QueryDataAsync(string where, int top, string orderByFields); |
| | | |
| | | /// <summary> |
| | | /// å页æ¥è¯¢ |
| | |
| | | /// <returns></returns> |
| | | List<TEntity> QueryData(Expression<Func<TEntity, bool>> whereExpression, int pageIndex, int pageSize, string orderByFields); |
| | | |
| | | Task<List<TEntity>> QueryDataAsync(Expression<Func<TEntity, bool>> whereExpression, int pageIndex, int pageSize, string orderByFields); |
| | | |
| | | /// <summary> |
| | | /// å页æ¥è¯¢ |
| | | /// </summary> |
| | |
| | | /// <returns></returns> |
| | | List<TEntity> QueryData(string where, int pageIndex, int pageSize, string orderByFields); |
| | | |
| | | Task<List<TEntity>> QueryDataAsync(string where, int pageIndex, int pageSize, string orderByFields); |
| | | |
| | | /// <summary> |
| | | /// å页æ¥è¯¢ |
| | | /// </summary> |
| | |
| | | /// <param name="pageSize"></param> |
| | | /// <param name="orderByFields"></param> |
| | | /// <returns></returns> |
| | | PageGridData<TEntity> QueryPage(Expression<Func<TEntity, bool>> whereExpression, int pageIndex, int pageSize, string orderByFields = null); |
| | | PageGridData<TEntity> QueryPage(Expression<Func<TEntity, bool>> whereExpression, int pageIndex, int pageSize, string? orderByFields = null); |
| | | |
| | | /// <summary> |
| | | /// å页æ¥è¯¢ |
| | |
| | | List<TResult> QueryTabs<T, T2, TResult>( |
| | | Expression<Func<T, T2, object[]>> joinExpression, |
| | | Expression<Func<T, T2, TResult>> selectExpression, |
| | | Expression<Func<T, T2, bool>> whereExpressionT1, |
| | | Expression<Func<TResult, bool>> whereExpression); |
| | | |
| | | List<TResult> QueryTabs<T, T2, TResult>( |
| | | Expression<Func<T, T2, bool>> joinExpression, |
| | | Expression<Func<T, T2, TResult>> selectExpression, |
| | | Expression<Func<T, bool>> whereExpressionT1, |
| | | Expression<Func<T2, bool>> whereExpressionT2, |
| | | Expression<Func<TResult, bool>> whereExpression); |
| | | |
| | | |
| | | Task<List<TResult>> QueryTabsAsync<T, T2, TResult>( |
| | | Expression<Func<T, T2, object[]>> joinExpression, |
| | | Expression<Func<T, T2, TResult>> selectExpression, |
| | | Expression<Func<TResult, bool>> whereExpression); |
| | | |
| | | /// <summary> |
| | |
| | | Expression<Func<TResult, bool>> whereExpression, |
| | | int pageIndex = 1, |
| | | int pageSize = 20, |
| | | string orderByFields = null); |
| | | string? orderByFields = null); |
| | | |
| | | /// <summary> |
| | | /// 两表èåæ¥è¯¢-å页-åç» |
| | |
| | | Expression<Func<T, object>> groupExpression, |
| | | int pageIndex = 1, |
| | | int pageSize = 20, |
| | | string orderByFields = null); |
| | | string? orderByFields = null); |
| | | |
| | | //List<TResult> QueryMuch<T, T2, T3, TResult>( |
| | | // Expression<Func<T, T2, T3, object[]>> joinExpression, |
| | |
| | | // Expression<Func<T, T2, T3, bool>> whereLambda = null) where T : class, new(); |
| | | //Task<PageModel<TEntity>> QueryPage(PaginationModel pagination); |
| | | } |
| | | } |
| | | } |