Skip to content

Commit c896304

Browse files
committed
优化查询页面
1 parent 8ee107b commit c896304

7 files changed

Lines changed: 7 additions & 10 deletions

File tree

AntJob.Data/Entity/作业.Biz.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ public static IEnumerable<Job> Search(Int32 id, Int32 appid, DateTime start, Dat
202202
if (id > 0) exp &= _.ID == id;
203203
if (appid > 0) exp &= _.AppID == appid;
204204
if (mode > 0) exp &= _.Mode == mode;
205-
if (!key.IsNullOrEmpty()) exp &= _.Name.Contains(key);
205+
if (!key.IsNullOrEmpty()) exp &= SearchWhereByKeys(key);
206206
exp &= _.CreateTime.Between(start, end);
207207

208208
return FindAll(exp, p);

AntJob.Data/Entity/作业任务.Biz.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ public static IEnumerable<JobTask> Search(Int32 id, Int32 appid, Int32 jobid, Jo
164164
if (jobid >= 0) exp &= _.JobID == jobid;
165165
if (status >= JobStatus.就绪) exp &= _.Status == status;
166166
if (!client.IsNullOrEmpty()) exp &= _.Client == client;
167-
if (!key.IsNullOrEmpty()) exp &= _.Data.Contains(key) | _.Remark.Contains(key) | _.Key == key;
167+
if (!key.IsNullOrEmpty()) exp &= SearchWhereByKeys(key);
168168

169169
exp &= _.DataTime.Between(dataStart, dataEnd);
170170
exp &= _.UpdateTime.Between(start, end);

AntJob.Data/Entity/作业错误.Biz.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public static IEnumerable<JobError> Search(Int32 appid, Int32 jobid, String clie
116116
if (appid > 0) exp &= _.AppID == appid;
117117
if (jobid > 0) exp &= _.JobID == jobid;
118118
if (!client.IsNullOrEmpty()) exp &= _.Client == client;
119-
if (!key.IsNullOrEmpty()) exp &= _.Remark.Contains(key);
119+
if (!key.IsNullOrEmpty()) exp &= SearchWhereByKeys(key);
120120
exp &= _.DataTime.Between(start, end);
121121

122122
return FindAll(exp, p);

AntJob.Data/Entity/应用历史.Biz.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,7 @@ public static IList<AppHistory> Search(Int32 appid, String action, Boolean? succ
9393
exp &= _.Id.Between(start, end, Meta.Factory.Snow);
9494
//exp &= _.CreateTime.Between(start, end);
9595

96-
if (!key.IsNullOrEmpty())
97-
{
98-
exp &= (_.Name.Contains(key) | _.Remark.Contains(key) | _.CreateIP.Contains(key));
99-
}
96+
if (!key.IsNullOrEmpty()) exp &= SearchWhereByKeys(key);
10097

10198
return FindAll(exp, page);
10299
}

AntJob.Data/Entity/应用在线.Biz.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public static IEnumerable<AppOnline> Search(Int32 appid, DateTime start, DateTim
100100
var exp = new WhereExpression();
101101

102102
if (appid > 0) exp &= _.AppID == appid.ToInt();
103-
if (!key.IsNullOrEmpty()) exp &= _.Name.Contains(key) | _.Instance.Contains(key);
103+
if (!key.IsNullOrEmpty()) exp &= SearchWhereByKeys(key);
104104
exp &= _.CreateTime.Between(start, end);
105105

106106
return FindAll(exp, p);

AntJob.Data/Entity/应用消息.Biz.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public static IEnumerable<AppMessage> Search(Int32 appid, Int32 jobid, DateTime
101101

102102
if (appid > 0) exp &= _.AppID == appid;
103103
if (jobid > 0) exp &= _.JobID == jobid;
104-
if (!key.IsNullOrEmpty()) exp &= _.Topic.Contains(key) | _.Data.Contains(key);
104+
if (!key.IsNullOrEmpty()) exp &= SearchWhereByKeys(key);
105105

106106
exp &= _.Id.Between(start, end, Meta.Factory.Snow);
107107
//exp &= _.UpdateTime.Between(start, end);

AntJob.Data/Entity/应用系统.Biz.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public static IEnumerable<App> Search(String category, Boolean? enable, String k
8787
if (enable != null) exp &= _.Enable == enable;
8888
if (!category.IsNullOrEmpty()) exp &= _.Category == category;
8989

90-
if (!key.IsNullOrEmpty()) exp &= _.Name.Contains(key) | _.DisplayName.Contains(key);
90+
if (!key.IsNullOrEmpty()) exp &= SearchWhereByKeys(key);
9191

9292
return FindAll(exp, p);
9393
}

0 commit comments

Comments
 (0)