|
|
|
using System.Linq.Expressions;
|
|
|
|
using Entity.DbModel.Station;
|
|
|
|
using HybirdFrameworkCore.Autofac.Attribute;
|
|
|
|
using HybirdFrameworkCore.Entity;
|
|
|
|
using OfficeOpenXml.FormulaParsing.Excel.Functions.Text;
|
|
|
|
using SqlSugar;
|
|
|
|
|
|
|
|
namespace Repository.Station;
|
|
|
|
|
|
|
|
[Scope("SingleInstance")]
|
|
|
|
public class SwapOrderStepRepository:BaseRepository<SwapOrderStep>
|
|
|
|
{
|
|
|
|
|
|
|
|
public SwapOrderStepRepository(ISqlSugarClient sqlSugar) : base(sqlSugar)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public IPage<SwapOrderStep> QueryIPage(QueryPageModel page, Expression<Func<SwapOrderStep, bool>> predicate)
|
|
|
|
{
|
|
|
|
if (null == predicate)
|
|
|
|
{
|
|
|
|
return QueryPage(page);
|
|
|
|
}
|
|
|
|
|
|
|
|
int totalCount = 0;
|
|
|
|
|
|
|
|
|
|
|
|
List<SwapOrderStep> pageList = DbBaseClient
|
|
|
|
.Queryable<SwapOrderStep>()
|
|
|
|
.Where(predicate)
|
|
|
|
.OrderByDescending(x => x.CreatedTime)
|
|
|
|
.WithNoLockOrNot(false)
|
|
|
|
.ToPageList(page.PageNum, page.PageSize, ref totalCount);
|
|
|
|
|
|
|
|
return new IPage<SwapOrderStep>(totalCount, page, pageList);
|
|
|
|
}
|
|
|
|
|
|
|
|
public IPage<SwapOrderStep> QueryPage(QueryPageModel page)
|
|
|
|
{
|
|
|
|
int totalCount = 0;
|
|
|
|
|
|
|
|
|
|
|
|
List<SwapOrderStep> pageList = DbBaseClient
|
|
|
|
.Queryable<SwapOrderStep>()
|
|
|
|
.OrderByDescending(x => x.CreatedTime)
|
|
|
|
.WithNoLockOrNot(false)
|
|
|
|
.ToPageList(page.PageNum, page.PageSize, ref totalCount);
|
|
|
|
|
|
|
|
return new IPage<SwapOrderStep>(totalCount, page, pageList);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|