查询优化

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
+9 -7
View File
@@ -19,12 +19,12 @@ namespace BLL
set;
}
/// <summary>
/// 定义变量
/// </summary>
private static IQueryable<Model.SitePerson_Person> getDataLists = from x in Funs.DB.SitePerson_Person
where x.IsUsed == true
select x;
///// <summary>
///// 定义变量
///// </summary>
//private static IQueryable<Model.SitePerson_Person> getDataLists = from x in Funs.DB.SitePerson_Person
// where x.IsUsed == true
// select x;
/// <summary>
///
@@ -38,7 +38,9 @@ namespace BLL
Grid Grid1)
{
Model.SGGLDB db = Funs.DB;
IQueryable<Model.SitePerson_Person> getDataList = getDataLists;
IQueryable<Model.SitePerson_Person> getDataList = from x in db.SitePerson_Person
where x.IsUsed == true
select x;
if (projectId != Const._Null && !string.IsNullOrEmpty(projectId))
{
getDataList = getDataList.Where(x => x.ProjectId == projectId);