using System.Linq.Expressions; using Entity.DbModel.Station; using Entity.Dto.Req; using HybirdFrameworkCore.Autofac.Attribute; using SqlSugar; namespace Repository.Station; [Scope("SingleInstance")] public class EquipInfoRepository: BaseRepository { private ISqlSugarClient DbBaseClient; public EquipInfoRepository(ISqlSugarClient sqlSugar) : base(sqlSugar) { DbBaseClient = sqlSugar; } public async Task> EquipInfoQueryPageAsync( bool isWhere1, Expression> expression1, bool isWhere2, Expression> expression2, bool isWhere3, Expression> expression3, int pageNumber, int pageSize, RefAsync totalNumber, PageEquipInfoReq input, bool blUseNoLock = false) { var page = await DbBaseClient .Queryable() .WhereIF(isWhere1, expression1) .WhereIF(isWhere2, expression2) .WhereIF(isWhere3, expression3) .OrderBuilder(input, "", "Id", false) .WithNoLockOrNot(blUseNoLock) .ToPageListAsync(pageNumber, pageSize, totalNumber); return page; } public float? QueryPowerByCode(string code) { EquipInfo? queryByClause = QueryByClause(i => i.Code == code); if (queryByClause==null || queryByClause.ChargePower == null) { return null; } return queryByClause.ChargePower; } }