功能完善

parent b2576190
......@@ -117,21 +117,22 @@ public List<ReportData> GetReportData(int hospitalId, int groupId, int reportId,
//不重复条件,动态拼接WHERE条件
selections = GetNoRepeatSelections(sql, formats, selections);
string @where = GetFilterSelection(selections, values);
@where += $" and hospitalid={hospitalId}";
// 固定占位符
var pairs = PredefinePlaceholder(values);
pairs.Add("hospitalid", hospitalId);
pairs.Add("wh", @where);
pairs.Add("w", $"where 1=1 {@where}");
pairs.Add("hospitalid", hospitalId);
// 支持两种占位符
pairs = CopyToFormats(pairs, formats);
// 替换占位符
sql = ReplacePlaceholder(selections, values, sql, formats);
// 替换固定占位符数据
foreach (var item in pairs)
{
sql = Regex.Replace(sql, item.Key, item.Value.ToString(), RegexOptions.IgnoreCase);
}
// 执行SQL
var chartData = reportRepository.DapperQuery<ChartData>(sql, null);
ReportData reportData = new ReportData(report);
......
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