查询优化
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace BLL
|
||||
/// <summary>
|
||||
/// 定义变量
|
||||
/// </summary>
|
||||
private static IQueryable<Model.WBS_Breakdown> qq = from x in Funs.DB.WBS_Breakdown orderby x.SortIndex select x;
|
||||
//private static IQueryable<Model.WBS_Breakdown> qq = from x in Funs.DB.WBS_Breakdown orderby x.SortIndex select x;
|
||||
|
||||
/// <summary>
|
||||
/// 获取项目列表
|
||||
@@ -35,7 +35,7 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static IEnumerable getListData(string divisionId, string name, int startRowIndex, int maximumRows)
|
||||
{
|
||||
IQueryable<Model.WBS_Breakdown> q = qq;
|
||||
IQueryable<Model.WBS_Breakdown> q = from x in Funs.DB.WBS_Breakdown orderby x.SortIndex select x;
|
||||
if (!string.IsNullOrEmpty(divisionId))
|
||||
{
|
||||
q = q.Where(e => e.DivisionId == divisionId);
|
||||
|
||||
@@ -20,10 +20,10 @@ namespace BLL
|
||||
set;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 定义变量
|
||||
/// </summary>
|
||||
private static IQueryable<Model.WBS_Division> qq = from x in Funs.DB.WBS_Division orderby x.SortIndex select x;
|
||||
///// <summary>
|
||||
///// 定义变量
|
||||
///// </summary>
|
||||
//private static IQueryable<Model.WBS_Division> qq = from x in Funs.DB.WBS_Division orderby x.SortIndex select x;
|
||||
|
||||
/// <summary>
|
||||
/// 获取项目列表
|
||||
@@ -35,7 +35,7 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static IEnumerable getListData(int startRowIndex, int maximumRows)
|
||||
{
|
||||
IQueryable<Model.WBS_Division> q = qq;
|
||||
IQueryable<Model.WBS_Division> q = from x in Funs.DB.WBS_Division orderby x.SortIndex select x;
|
||||
count = q.Count();
|
||||
if (count == 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user