using System.Linq.Expressions; using Entity.DbModel.Station; using HybirdFrameworkCore.Autofac.Attribute; using SqlSugar; namespace Repository.Station; [Scope] public class EquipAlarmDefineRepository : BaseRepository { public EquipAlarmDefineRepository(ISqlSugarClient sqlSugar) : base(sqlSugar) { } /// /// /// /// 0-充电机;1-电表;2-水冷;3-plc; /// /// /// public EquipAlarmDefine? SelectByEquipCodeAndErrorCode(int equipTypeCode, string equipCode, string errorCode) { return this.QueryByClause(it => it.EquipTypeCode == equipTypeCode && it.EquipCode == equipCode && it.ErrorCode == errorCode); } /// /// 查询需要导出换电订单 /// /// /// public async Task> QueryEquipAlarmDefineList(Expression> predicate) { if (predicate == null) { return await QueryAsync(); } List resultList = await DbBaseClient .Queryable() .Where(predicate) .WithNoLockOrNot(false) .ToListAsync(); return resultList; } }