Commit 1614427e by 纪旭 韦

手工录入详情增加搜索

parent c09235ad
......@@ -1243,7 +1243,12 @@ public void SaveGatherHands(int allotId, SaveGatherData request)
public GatherInfo GetGather(int allotId,string department,string source, PersonParamsRequest request)
{
var datas = exresultgatherRepository.GetEntities(t => t.AllotId == allotId && t.Department.Contains(department) && t.Source .Contains(source) && (t.PersonnelNumber != "" || t.DoctorName != ""));
Expression<Func<ex_result_gather, bool>> exp = t => t.AllotId == allotId && t.Department.Contains(department) && t.Source.Contains(source) && (t.PersonnelNumber != "" || t.DoctorName != "");
if (request != null && !string.IsNullOrEmpty(request.SearchQuery))
exp = exp.And(t => t.AllotId == allotId && t.Department.Contains(department) && t.Source.Contains(source) && (t.PersonnelNumber != "" || t.DoctorName != "") && t.DoctorName.Contains(request.SearchQuery) || t.PersonnelNumber.Contains(request.SearchQuery));
var datas = exresultgatherRepository.GetEntities(exp);
var result = datas.GroupBy(a => new { a.Department, a.DoctorName, a.PersonnelNumber }).Select(t => new
{
......@@ -1325,10 +1330,10 @@ public GatherResponse GetGatherTotal(int allotId, PersonParamsRequest request)
};*/
#endregion
Expression<Func<ex_result_gather, bool>> exp = t => t.AllotId == allotId && t.DoctorName != "" || t.PersonnelNumber != "";
Expression<Func<ex_result_gather, bool>> exp = t => t.AllotId == allotId && (t.DoctorName != "" || t.PersonnelNumber != "");
if (request != null && !string.IsNullOrEmpty(request.SearchQuery))
exp = exp.And(t => t.Department.Contains(request.SearchQuery) || t.Source.Contains(request.SearchQuery));
exp = exp.And(t => t.AllotId == allotId && (t.DoctorName != "" || t.PersonnelNumber != "") && t.Department.Contains(request.SearchQuery) || t.Source.Contains(request.SearchQuery));
var datas = exresultgatherRepository.GetEntities(exp);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment