You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
1.3 KiB

using System.Linq.Expressions;
using Entity.DbModel.System;
using Entity.Dto.Req;
6 months ago
using HybirdFrameworkCore.Autofac.Attribute;
using SqlSugar;
namespace Repository.System
{
[Scope("SingleInstance")]
public class SysConfigRepository : BaseRepository<SysConfig>
{
private ISqlSugarClient DbBaseClient;
public SysConfigRepository(ISqlSugarClient sqlSugar) : base(sqlSugar)
{
DbBaseClient = sqlSugar;
}
public async Task<List<SysConfig>> SysConfigQueryPageAsync(
bool isWhere1, Expression<Func<SysConfig, bool>> expression1,
bool isWhere2, Expression<Func<SysConfig, bool>> expression2,
bool isWhere3, Expression<Func<SysConfig, bool>> expression3,
int pageNumber, int pageSize, RefAsync<int> totalNumber,
PageConfigReq input, bool blUseNoLock = false)
{
var page = await DbBaseClient
.Queryable<SysConfig>()
.WhereIF(isWhere1, expression1)
.WhereIF(isWhere2, expression2)
.WhereIF(isWhere3, expression3)
.OrderBuilder(input)
.WithNoLockOrNot(blUseNoLock)
.ToPageListAsync(pageNumber, pageSize, totalNumber);
return page;
}
6 months ago
}
}