查询优化

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 -12
View File
@@ -38,10 +38,10 @@ namespace BLL
set;
}
/// <summary>
/// 定义变量
/// </summary>
private static IQueryable<Model.WBS_BreakdownProject> qq = from x in Funs.DB.WBS_BreakdownProject orderby x.SortIndex select x;
///// <summary>
///// 定义变量
///// </summary>
//private static IQueryable<Model.WBS_BreakdownProject> qq = from x in Funs.DB.WBS_BreakdownProject orderby x.SortIndex select x;
/// <summary>
/// 获取项目列表
@@ -53,7 +53,7 @@ namespace BLL
/// <returns></returns>
public static IEnumerable getListData(string projectId, string divisionProjectId, string name, int startRowIndex, int maximumRows)
{
IQueryable<Model.WBS_BreakdownProject> q = qq;
IQueryable<Model.WBS_BreakdownProject> q = from x in Funs.DB.WBS_BreakdownProject orderby x.SortIndex select x;
if (!string.IsNullOrEmpty(projectId))
{
q = q.Where(e => e.ProjectId == projectId);
@@ -105,10 +105,10 @@ namespace BLL
return count;
}
/// <summary>
/// 定义变量
/// </summary>
private static IQueryable<Model.View_WBS> qq2 = from x in Funs.DB.View_WBS select x;
///// <summary>
///// 定义变量
///// </summary>
//private static IQueryable<Model.View_WBS> qq2 = from x in Funs.DB.View_WBS select x;
/// <summary>
/// 获取项目已选择的WBS列表
@@ -120,7 +120,7 @@ namespace BLL
/// <returns></returns>
public static IEnumerable getListData2(string projectId, int startRowIndex, int maximumRows)
{
IQueryable<Model.View_WBS> q = qq2;
IQueryable<Model.View_WBS> q = from x in Funs.DB.View_WBS select x;
if (!string.IsNullOrEmpty(projectId))
{
q = q.Where(e => e.ProjectId == projectId);
@@ -164,7 +164,7 @@ namespace BLL
/// <summary>
/// 定义变量
/// </summary>
private static IQueryable<Model.View_WBS_BreakdownProject> qq3 = from x in Funs.DB.View_WBS_BreakdownProject orderby x.SortIndex select x;
//private static IQueryable<Model.View_WBS_BreakdownProject> qq3 = from x in Funs.DB.View_WBS_BreakdownProject orderby x.SortIndex select x;
/// <summary>
/// 获取项目列表
@@ -176,7 +176,7 @@ namespace BLL
/// <returns></returns>
public static IEnumerable getListData3(string projectId, string divisionProjectId, string name, int startRowIndex, int maximumRows)
{
IQueryable<Model.View_WBS_BreakdownProject> q = qq3;
IQueryable<Model.View_WBS_BreakdownProject> q = from x in Funs.DB.View_WBS_BreakdownProject orderby x.SortIndex select x;
if (!string.IsNullOrEmpty(projectId))
{
q = q.Where(e => e.ProjectId == projectId);