using System.Linq.Expressions; using Entity.DbModel.Station; using HybirdFrameworkCore.Autofac.Attribute; using HybirdFrameworkCore.Entity; using log4net; using SqlSugar; namespace Repository.Station; [Scope("SingleInstance")] public class AmtOrderInfoRepository: BaseRepository { private static readonly ILog _log = LogManager.GetLogger(typeof(AmtOrderInfoRepository)); public AmtOrderInfoRepository(ISqlSugarClient sqlSugar) : base(sqlSugar) { } public IPage QueryIPage(QueryPageModel page, Expression> predicate) { if (null == predicate) { return QueryPage(page); } int totalCount = 0; List pageList = DbBaseClient .Queryable() .Where(predicate) .OrderByDescending(x => x.CreatedTime) .WithNoLockOrNot(false) .ToPageList(page.PageNum, page.PageSize, ref totalCount); return new IPage(totalCount, page, pageList); } public IPage QueryPage(QueryPageModel page) { int totalCount = 0; List pageList = DbBaseClient .Queryable() .OrderByDescending(x => x.CreatedTime) .WithNoLockOrNot(false) .ToPageList(page.PageNum, page.PageSize, ref totalCount); return new IPage(totalCount, page, pageList); } }