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
2922823f
Commit
2922823f
authored
Mar 11, 2021
by
lcx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
获取报表sql条件更改
parent
68035f62
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
30 additions
and
140 deletions
+30
-140
performance/Performance.Api/GraphQLSchema/PerformanceQuery.cs
+5
-8
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
+2
-47
performance/Performance.EntityModels/Context/PerformanceDbContext.cs
+0
-2
performance/Performance.EntityModels/Entity/his_import_summary.cs
+0
-59
performance/Performance.Repository/Repository/PerforHisimportsummaryRepository.cs
+0
-20
performance/Performance.Services/GraphQLService.cs
+23
-4
performance/Performance.Services/ReportGlobalService.cs
+0
-0
No files found.
performance/Performance.Api/GraphQLSchema/PerformanceQuery.cs
View file @
2922823f
...
...
@@ -43,9 +43,8 @@ public PerformanceQuery(GraphQLService service)
int
reportId
=
context
.
Arguments
.
ContainsKey
(
QueryParams
.
reportId
)
?
ConvertHelper
.
To
<
int
>(
context
.
Arguments
[
QueryParams
.
reportId
])
:
0
;
StringBuilder
where
=
new
StringBuilder
();
var
parameters
=
GetDynamicParameters
(
context
.
Arguments
,
where
,
QueryParams
.
hospitalId
,
QueryParams
.
year
,
QueryParams
.
month
,
QueryParams
.
accountingUnit
);
return
service
.
GetChartData
(
reportId
,
parameters
,
where
.
ToString
());
var
parameters
=
GetDynamicParameters
(
context
.
Arguments
,
QueryParams
.
hospitalId
,
QueryParams
.
year
,
QueryParams
.
month
,
QueryParams
.
accountingUnit
);
return
service
.
GetChartData
(
reportId
,
parameters
);
}
);
...
...
@@ -60,9 +59,8 @@ public PerformanceQuery(GraphQLService service)
int
reportId
=
context
.
Arguments
.
ContainsKey
(
QueryParams
.
reportId
)
?
ConvertHelper
.
To
<
int
>(
context
.
Arguments
[
QueryParams
.
reportId
])
:
0
;
StringBuilder
where
=
new
StringBuilder
();
var
parameters
=
GetDynamicParameters
(
context
.
Arguments
,
where
,
QueryParams
.
hospitalId
,
QueryParams
.
year
,
QueryParams
.
month
,
QueryParams
.
accountingUnit
,
QueryParams
.
category
,
QueryParams
.
itemName
);
return
service
.
GetReportPerformance
(
reportId
,
parameters
,
where
.
ToString
());
var
parameters
=
GetDynamicParameters
(
context
.
Arguments
,
QueryParams
.
hospitalId
,
QueryParams
.
year
,
QueryParams
.
month
,
QueryParams
.
accountingUnit
,
QueryParams
.
category
,
QueryParams
.
itemName
);
return
service
.
GetReportPerformance
(
reportId
,
parameters
);
}
);
}
...
...
@@ -88,7 +86,7 @@ public static QueryArguments Arguments(params QueryArgument[] args)
return
basic
;
}
public
DynamicParameters
GetDynamicParameters
(
Dictionary
<
string
,
object
>
arguments
,
StringBuilder
builder
,
params
string
[]
fields
)
public
DynamicParameters
GetDynamicParameters
(
Dictionary
<
string
,
object
>
arguments
,
params
string
[]
fields
)
{
DynamicParameters
parameters
=
new
DynamicParameters
();
if
(
arguments
==
null
||
!
arguments
.
Any
())
return
parameters
;
...
...
@@ -99,7 +97,6 @@ public DynamicParameters GetDynamicParameters(Dictionary<string, object> argumen
if
(
arguments
.
ContainsKey
(
item
))
{
parameters
.
Add
(
item
.
ToLower
(),
arguments
[
item
]);
builder
.
Append
(
$" and
{
item
.
ToLower
()}
=@
{
item
.
ToLower
()}
"
);
}
}
}
...
...
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
View file @
2922823f
...
...
@@ -142,10 +142,10 @@
<member
name=
"P:Performance.EntityModels.PerformanceDbContext.his_import_clinic"
>
<summary>
</summary>
</member>
<member
name=
"P:Performance.EntityModels.PerformanceDbContext.his_import
_summary
"
>
<member
name=
"P:Performance.EntityModels.PerformanceDbContext.his_import
data
"
>
<summary>
</summary>
</member>
<member
name=
"P:Performance.EntityModels.PerformanceDbContext.his_
importdata
"
>
<member
name=
"P:Performance.EntityModels.PerformanceDbContext.his_
script
"
>
<summary>
</summary>
</member>
<member
name=
"P:Performance.EntityModels.PerformanceDbContext.hos_personfee"
>
...
...
@@ -2498,51 +2498,6 @@
创建时间
</summary>
</member>
<member
name=
"T:Performance.EntityModels.his_import_summary"
>
<summary>
</summary>
</member>
<member
name=
"P:Performance.EntityModels.his_import_summary.Id"
>
<summary>
</summary>
</member>
<member
name=
"P:Performance.EntityModels.his_import_summary.HospitalId"
>
<summary>
医院ID
</summary>
</member>
<member
name=
"P:Performance.EntityModels.his_import_summary.AllotId"
>
<summary>
ID
</summary>
</member>
<member
name=
"P:Performance.EntityModels.his_import_summary.Year"
>
<summary>
绩效发放年
</summary>
</member>
<member
name=
"P:Performance.EntityModels.his_import_summary.Month"
>
<summary>
绩效发放月
</summary>
</member>
<member
name=
"P:Performance.EntityModels.his_import_summary.AccountingUnit"
>
<summary>
</summary>
</member>
<member
name=
"P:Performance.EntityModels.his_import_summary.RealGiveFee"
>
<summary>
</summary>
</member>
<member
name=
"P:Performance.EntityModels.his_import_summary.CreateTime"
>
<summary>
创建时间
</summary>
</member>
<member
name=
"T:Performance.EntityModels.his_script"
>
<summary>
...
...
performance/Performance.EntityModels/Context/PerformanceDbContext.cs
View file @
2922823f
...
...
@@ -105,8 +105,6 @@ public PerformanceDbContext(DbContextOptions<PerformanceDbContext> options)
/// <summary> </summary>
public
virtual
DbSet
<
his_import_clinic
>
his_import_clinic
{
get
;
set
;
}
/// <summary> </summary>
public
virtual
DbSet
<
his_import_summary
>
his_import_summary
{
get
;
set
;
}
/// <summary> </summary>
public
virtual
DbSet
<
his_importdata
>
his_importdata
{
get
;
set
;
}
/// <summary> </summary>
public
virtual
DbSet
<
his_script
>
his_script
{
get
;
set
;
}
...
...
performance/Performance.EntityModels/Entity/his_import_summary.cs
deleted
100644 → 0
View file @
68035f62
//-----------------------------------------------------------------------
// <copyright file=" his_import_summary.cs">
// * FileName: .cs
// </copyright>
//-----------------------------------------------------------------------
using
System
;
using
System.ComponentModel.DataAnnotations
;
using
System.ComponentModel.DataAnnotations.Schema
;
namespace
Performance.EntityModels
{
/// <summary>
///
/// </summary>
[
Table
(
"his_import_summary"
)]
public
class
his_import_summary
{
/// <summary>
///
/// </summary>
[
Key
]
public
int
Id
{
get
;
set
;
}
/// <summary>
/// 医院ID
/// </summary>
public
int
HospitalId
{
get
;
set
;
}
/// <summary>
/// ID
/// </summary>
public
int
AllotId
{
get
;
set
;
}
/// <summary>
/// 绩效发放年
/// </summary>
public
int
Year
{
get
;
set
;
}
/// <summary>
/// 绩效发放月
/// </summary>
public
int
Month
{
get
;
set
;
}
/// <summary>
///
/// </summary>
public
string
AccountingUnit
{
get
;
set
;
}
/// <summary>
///
/// </summary>
public
Nullable
<
decimal
>
RealGiveFee
{
get
;
set
;
}
/// <summary>
/// 创建时间
/// </summary>
public
Nullable
<
DateTime
>
CreateTime
{
get
;
set
;
}
}
}
performance/Performance.Repository/Repository/PerforHisimportsummaryRepository.cs
deleted
100644 → 0
View file @
68035f62
//-----------------------------------------------------------------------
// <copyright file=" his_import_summary.cs">
// * FileName: his_import_summary.cs
// </copyright>
//-----------------------------------------------------------------------
using
System
;
using
Performance.EntityModels
;
namespace
Performance.Repository
{
/// <summary>
/// his_import_summary Repository
/// </summary>
public
partial
class
PerforHisimportsummaryRepository
:
PerforRepository
<
his_import_summary
>
{
public
PerforHisimportsummaryRepository
(
PerformanceDbContext
context
)
:
base
(
context
)
{
}
}
}
performance/Performance.Services/GraphQLService.cs
View file @
2922823f
...
...
@@ -52,7 +52,7 @@ public ReportData GetReport(int reportId)
return
new
ReportData
(
report
);
}
public
List
<
ChartData
>
GetChartData
(
int
reportId
,
DynamicParameters
parameters
,
string
where
=
null
)
public
List
<
ChartData
>
GetChartData
(
int
reportId
,
DynamicParameters
parameters
)
{
if
(
reportId
==
0
)
return
new
List
<
ChartData
>();
...
...
@@ -62,7 +62,8 @@ public List<ChartData> GetChartData(int reportId, DynamicParameters parameters,
if
(
report
==
null
||
string
.
IsNullOrEmpty
(
report
.
Content
))
return
new
List
<
ChartData
>();
var
sql
=
report
.
Content
.
ToLower
();
if
(!
string
.
IsNullOrEmpty
(
where
))
sql
=
sql
.
Replace
(
"{wh}"
,
where
);
string
where
=
GetQueryCondition
(
sql
,
parameters
);
sql
=
sql
.
Replace
(
"{wh}"
,
where
);
var
chartData
=
repreportRepository
.
DapperQuery
<
ChartData
>(
sql
,
parameters
,
60
*
5
);
...
...
@@ -75,7 +76,7 @@ public List<ChartData> GetChartData(int reportId, DynamicParameters parameters,
}
}
public
List
<
ReportTable
>
GetReportPerformance
(
int
reportId
,
DynamicParameters
parameters
,
string
where
=
null
)
public
List
<
ReportTable
>
GetReportPerformance
(
int
reportId
,
DynamicParameters
parameters
)
{
if
(
reportId
==
0
)
return
new
List
<
ReportTable
>();
...
...
@@ -85,7 +86,8 @@ public List<ReportTable> GetReportPerformance(int reportId, DynamicParameters pa
if
(
report
==
null
||
string
.
IsNullOrEmpty
(
report
.
Content
))
return
new
List
<
ReportTable
>();
var
sql
=
report
.
Content
.
ToLower
();
if
(!
string
.
IsNullOrEmpty
(
where
))
sql
=
sql
.
Replace
(
"{wh}"
,
where
);
string
where
=
GetQueryCondition
(
sql
,
parameters
);
sql
=
sql
.
Replace
(
"{wh}"
,
where
);
var
chartData
=
repreportRepository
.
DapperQuery
<
ReportTable
>(
sql
,
parameters
,
60
*
5
);
...
...
@@ -97,5 +99,22 @@ public List<ReportTable> GetReportPerformance(int reportId, DynamicParameters pa
return
new
List
<
ReportTable
>();
}
}
private
string
GetQueryCondition
(
string
sql
,
DynamicParameters
parameters
)
{
StringBuilder
builder
=
new
StringBuilder
();
if
(
parameters
!=
null
&&
parameters
.
ParameterNames
.
Any
())
{
foreach
(
var
parameter
in
parameters
.
ParameterNames
.
Select
(
t
=>
t
))
{
string
key
=
"@"
+
parameter
;
if
(
sql
.
IndexOf
(
key
)
==
-
1
)
{
builder
.
Append
(
$" and
{
parameter
}
=
{
key
}
"
);
}
}
}
return
builder
.
ToString
();
}
}
}
performance/Performance.Services/ReportGlobalService.cs
View file @
2922823f
This diff is collapsed.
Click to expand it.
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