查询优化

This commit is contained in:
2026-04-23 15:18:39 +08:00
parent 746cb57619
commit c2eeffa0de
16 changed files with 223 additions and 143 deletions
+12 -9
View File
@@ -22,11 +22,11 @@ namespace BLL
set;
}
/// <summary>
/// 定义变量
/// </summary>
private static IQueryable<Model.View_SitePerson_Person> getDataLists = from x in Funs.DB.View_SitePerson_Person
select x;
///// <summary>
///// 定义变量
///// </summary>
//private static IQueryable<Model.View_SitePerson_Person> getDataLists = from x in Funs.DB.View_SitePerson_Person
// select x;
/// <summary>
/// 数据列表
@@ -42,6 +42,7 @@ namespace BLL
public static IEnumerable getListData(string projetcId, string unitId, string workPostId, string name, string idCard, string states, Grid Grid1)
{
Model.SGGLDB db = Funs.DB;
var getDataLists = from x in db.View_SitePerson_Person select x;
IQueryable<Model.View_SitePerson_Person> getDataList = getDataLists.OrderBy(x => x.ProjectId).ThenBy(x => x.UnitId);
if (!string.IsNullOrEmpty(projetcId) && projetcId != Const._Null)
{
@@ -110,10 +111,10 @@ namespace BLL
set;
}
/// <summary>
/// 定义变量
/// </summary>
private static IQueryable<Model.View_SitePerson_Person> getPersonLists = from x in Funs.DB.View_SitePerson_Person select x;
///// <summary>
///// 定义变量
///// </summary>
//private static IQueryable<Model.View_SitePerson_Person> getPersonLists = from x in Funs.DB.View_SitePerson_Person select x;
/// <summary>
/// 获取分页列表
@@ -124,6 +125,8 @@ namespace BLL
public static IEnumerable getListData(string projectId, string unitId, string personName, string identityCard, string treamGroupId, string workPostIds,
bool ckTrain, string postType, bool ckJT, bool ckIdCardInfoNotOK, bool chManager, bool isHsse, bool isCQMS, Grid Grid1,bool isBlack=false)
{
Model.SGGLDB db = Funs.DB;
var getPersonLists = from x in db.View_SitePerson_Person select x;
IQueryable<Model.View_SitePerson_Person> getPersonList = getPersonLists.Where(x => x.ProjectId == projectId);
if (!string.IsNullOrEmpty(unitId))
{