生产管理
This commit is contained in:
@@ -17,6 +17,13 @@ namespace DOAN.Repository
|
||||
/// <typeparam name="T"></typeparam>
|
||||
public class BaseRepository<T> : SimpleClient<T> where T : class, new()
|
||||
{
|
||||
public string XueHua
|
||||
{
|
||||
get
|
||||
{
|
||||
return SnowFlakeSingle.Instance.NextId().ToString();
|
||||
}
|
||||
}
|
||||
public ITenant itenant = null;//多租户事务
|
||||
public BaseRepository(ISqlSugarClient context = null) : base(context)
|
||||
{
|
||||
@@ -347,5 +354,31 @@ namespace DOAN.Repository
|
||||
page.Result = result.Adapt<List<T2>>();
|
||||
return page;
|
||||
}
|
||||
/// <summary>
|
||||
/// 分页查询 不转
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="source"></param>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
public static PagedInfo<T> ToPage_NO_Convert<T>(this ISugarQueryable<T> source, PagerInfo parm)
|
||||
{
|
||||
var page = new PagedInfo<T>();
|
||||
var total = 0;
|
||||
page.PageSize = parm.PageSize;
|
||||
page.PageIndex = parm.PageNum;
|
||||
if (parm.Sort.IsNotEmpty())
|
||||
{
|
||||
source.OrderByPropertyName(parm.Sort, parm.SortType.Contains("desc") ? OrderByType.Desc : OrderByType.Asc);
|
||||
}
|
||||
var result = source
|
||||
//.OrderByIF(parm.Sort.IsNotEmpty(), $"{parm.Sort.ToSqlFilter()} {(!string.IsNullOrWhiteSpace(parm.SortType) && parm.SortType.Contains("desc") ? "desc" : "asc")}")
|
||||
.ToPageList(parm.PageNum, parm.PageSize, ref total);
|
||||
|
||||
page.TotalNum = total;
|
||||
page.Result = result;
|
||||
return page;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user