查询优化
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);
|
||||
|
||||
Reference in New Issue
Block a user