Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
performance
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zry
performance
Commits
ebbfab54
Commit
ebbfab54
authored
Mar 19, 2020
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
功能完善
parent
b2576190
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
performance/Performance.Services/ReportDataService.cs
+6
-5
No files found.
performance/Performance.Services/ReportDataService.cs
View file @
ebbfab54
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment