查询优化
This commit is contained in:
@@ -21,10 +21,10 @@ namespace BLL
|
||||
set;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 定义变量
|
||||
/// </summary>
|
||||
private static IQueryable<Model.Check_CheckEquipment> qq = from x in Funs.DB.Check_CheckEquipment orderby x.CompileDate descending select x;
|
||||
///// <summary>
|
||||
///// 定义变量
|
||||
///// </summary>
|
||||
//private static IQueryable<Model.Check_CheckEquipment> qq = from x in Funs.DB.Check_CheckEquipment orderby x.CompileDate descending select x;
|
||||
|
||||
/// <summary>
|
||||
/// 获取分页列表
|
||||
@@ -35,7 +35,7 @@ namespace BLL
|
||||
public static IEnumerable getListData(string projectId, string userId, string roleId, int startRowIndex, int maximumRows)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
IQueryable<Model.Check_CheckEquipment> q = qq;
|
||||
IQueryable<Model.Check_CheckEquipment> q = from x in db.Check_CheckEquipment orderby x.CompileDate descending select x;
|
||||
if (!string.IsNullOrEmpty(projectId))
|
||||
{
|
||||
q = q.Where(e => e.ProjectId == projectId);
|
||||
|
||||
@@ -22,10 +22,10 @@ namespace BLL
|
||||
set;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 定义变量
|
||||
/// </summary>
|
||||
private static IQueryable<Model.Check_Design> qq = from x in Funs.DB.Check_Design orderby x.DesignDate descending select x;
|
||||
///// <summary>
|
||||
///// 定义变量
|
||||
///// </summary>
|
||||
//private static IQueryable<Model.Check_Design> qq = from x in Funs.DB.Check_Design orderby x.DesignDate descending select x;
|
||||
|
||||
|
||||
public static string CovBool(bool? b)
|
||||
|
||||
@@ -399,11 +399,11 @@ namespace BLL
|
||||
else
|
||||
return null;
|
||||
}
|
||||
/// <summary>
|
||||
/// 定义变量
|
||||
/// </summary>
|
||||
private static IQueryable<Model.Check_TechnicalContactList> qq = from x in Funs.DB.Check_TechnicalContactList orderby x.CompileDate descending select x;
|
||||
|
||||
///// <summary>
|
||||
///// 定义变量
|
||||
///// </summary>
|
||||
//private static IQueryable<Model.Check_TechnicalContactList> qq = from x in Funs.DB.Check_TechnicalContactList orderby x.CompileDate descending select x;
|
||||
/// <summary>
|
||||
/// 获取分页列表
|
||||
/// </summary>
|
||||
|
||||
@@ -20,10 +20,10 @@ namespace BLL
|
||||
set;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 定义变量
|
||||
/// </summary>
|
||||
private static IQueryable<Model.DataBase_DataTypeProject> qq = from x in Funs.DB.DataBase_DataTypeProject orderby x.SortIndex select x;
|
||||
///// <summary>
|
||||
///// 定义变量
|
||||
///// </summary>
|
||||
//private static IQueryable<Model.DataBase_DataTypeProject> qq = from x in Funs.DB.DataBase_DataTypeProject orderby x.SortIndex select x;
|
||||
|
||||
/// <summary>
|
||||
/// 获取项目列表
|
||||
@@ -35,7 +35,7 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static IEnumerable getListData(int startRowIndex, int maximumRows)
|
||||
{
|
||||
IQueryable<Model.DataBase_DataTypeProject> q = qq;
|
||||
IQueryable<Model.DataBase_DataTypeProject> q = from x in Funs.DB.DataBase_DataTypeProject orderby x.SortIndex select x;
|
||||
count = q.Count();
|
||||
if (count == 0)
|
||||
{
|
||||
|
||||
@@ -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