Commit 6837f55e by 1391696987

每月汇报表返回结果排序,不输入条件查询所有

parent d2764d99
......@@ -48,11 +48,14 @@ PerforReportStatisticsTreeRepository ReportStatisticsTreeRepository
List<string> plist = new List<string>();
foreach (var item in pairs)
{
if (!Regex.IsMatch(sql, $"@{item.Key}", RegexOptions.IgnoreCase | RegexOptions.Multiline))
var json = JsonHelper.Serialize(item.Value);
if (!Regex.IsMatch(sql, $"@{item.Key}", RegexOptions.IgnoreCase | RegexOptions.Multiline) && !string.IsNullOrEmpty(json) && json != "[]")
{
var key = item.Key.StartsWith("@") ? item.Key.Substring(1, item.Key.Length - 1) : item.Key;
if (item.Value.GetType().GetInterfaces().Any(iface => iface.IsGenericType && iface.GetGenericTypeDefinition() == typeof(ICollection<>)))
{
plist.Add($"{key} IN @{key}");
}
else
plist.Add($"{key} = @{key}");
}
......@@ -117,12 +120,13 @@ public StatisticsInfoDto GetInfo(int hospitalID, int statisticsId)
};
result.Selections.Add(statisticsSelectionDto);
}
result.Selections = result.Selections.OrderBy(t => t.Sort).ToList();
return result;
}
public List<report_statistics_selection_record> GetSelectionRecord(int hospitalID, int statisticsId)
{
var result = _reportStatisticsSelectionRecordRepository.GetEntities(t => t.HospitalId == hospitalID && t.StatisticsID == statisticsId).OrderByDescending(t => t.UpdateDate).ToList();
var result = _reportStatisticsSelectionRecordRepository.GetEntities(t => t.HospitalId == hospitalID && t.StatisticsID == statisticsId).OrderByDescending(t => t.UpdateDate).OrderByDescending(t=>t.CreateDate).ToList();
return result;
}
......
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