通用工作量查询

parent 1aeb82bb
...@@ -179,16 +179,13 @@ public IEnumerable<report_original_workload> QueryWorkloadData(int allotid, stri ...@@ -179,16 +179,13 @@ public IEnumerable<report_original_workload> QueryWorkloadData(int allotid, stri
if (connection.State != ConnectionState.Open) connection.Open(); if (connection.State != ConnectionState.Open) connection.Open();
try try
{ {
string unittype = unittypes.Any(t => !string.IsNullOrEmpty(t) && t.Contains("医生"))
? "医生组"
: unittypes.Any(t => !string.IsNullOrEmpty(t) && t.Contains("护理")) ? "护理组" : "其他组";
string clear = @" string clear = @"
SELECT DISTINCT AccountingUnit as Department,if(ifnull(DoctorName,'')='', '未知',DoctorName) DoctorName,PersonnelNumber,Category,ROUND(SUM(Fee),2) Fee SELECT DISTINCT AccountingUnit as Department,if(ifnull(DoctorName,'')='', '未知',DoctorName) DoctorName,PersonnelNumber,Category,ROUND(SUM(Fee),2) Fee
FROM view_second_report_workload FROM view_second_report_workload
WHERE AllotId = @allotid AND UnitType in @unittypes AND AccountingUnit = @accountingunit WHERE AllotId = @allotid AND UnitType in @unittypes AND AccountingUnit = @accountingunit
GROUP BY AccountingUnit,DoctorName,PersonnelNumber,Category GROUP BY AccountingUnit,DoctorName,PersonnelNumber,Category
ORDER BY doctorname,Category;"; ORDER BY doctorname,Category;";
return connection.Query<report_original_workload>(clear, new { allotid, accountingunit, unittypes, unittype, hospitalid }, commandTimeout: 60 * 60); return connection.Query<report_original_workload>(clear, new { allotid, accountingunit, unittypes = unittypes.Union(new string[] { "通用工作量" }), hospitalid }, commandTimeout: 60 * 60);
} }
catch (Exception ex) catch (Exception ex)
{ {
......
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