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.
|
|
|
|
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<AmtOrderInfo>
|
|
|
|
|
{
|
|
|
|
|
private static readonly ILog _log = LogManager.GetLogger(typeof(AmtOrderInfoRepository));
|
|
|
|
|
|
|
|
|
|
public AmtOrderInfoRepository(ISqlSugarClient sqlSugar) : base(sqlSugar)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public IPage<AmtOrderInfo> QueryIPage(QueryPageModel page, Expression<Func<AmtOrderInfo, bool>> predicate)
|
|
|
|
|
{
|
|
|
|
|
if (null == predicate)
|
|
|
|
|
{
|
|
|
|
|
return QueryPage(page);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int totalCount = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<AmtOrderInfo> pageList = DbBaseClient
|
|
|
|
|
.Queryable<AmtOrderInfo>()
|
|
|
|
|
.Where(predicate)
|
|
|
|
|
.OrderByDescending(x => x.CreatedTime)
|
|
|
|
|
.WithNoLockOrNot(false)
|
|
|
|
|
.ToPageList(page.PageNum, page.PageSize, ref totalCount);
|
|
|
|
|
|
|
|
|
|
return new IPage<AmtOrderInfo>(totalCount, page, pageList);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public IPage<AmtOrderInfo> QueryPage(QueryPageModel page)
|
|
|
|
|
{
|
|
|
|
|
int totalCount = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<AmtOrderInfo> pageList = DbBaseClient
|
|
|
|
|
.Queryable<AmtOrderInfo>()
|
|
|
|
|
.OrderByDescending(x => x.CreatedTime)
|
|
|
|
|
.WithNoLockOrNot(false)
|
|
|
|
|
.ToPageList(page.PageNum, page.PageSize, ref totalCount);
|
|
|
|
|
|
|
|
|
|
return new IPage<AmtOrderInfo>(totalCount, page, pageList);
|
|
|
|
|
}
|
|
|
|
|
}
|