stringclear=@"SELECT DISTINCT t3.AccountingUnit as Department,ifnull(t1.DoctorName, '未知') DoctorName,if(ifnull(t2.PersonnelNumber,'')='', ifnull(t2.JobNumber,ifnull(t1.DoctorName, '未知')), t2.PersonnelNumber) PersonnelNumber,t1.Category,t1.Fee FROM ex_result t1
stringclear=@"SELECT DISTINCT t3.AccountingUnit as Department,ifnull(t1.DoctorName, '未知') DoctorName,t1.PersonnelNumber,t1.Category,t1.Fee FROM ex_result t1
LEFT JOIN per_employee t2 on t1.personnelnumber = t2.jobnumber AND t2.allotid = @allotid
JOIN (select distinct AccountingUnit,HISDeptName,unittype from per_dept_dic where HospitalId = @hospitalid) t3 ON t1.Department = t3.HISDeptName
JOIN (select distinct AccountingUnit,HISDeptName,unittype from per_dept_dic where HospitalId = @hospitalid) t3 ON t1.Department = t3.HISDeptName
WHERE t1.allotid = @allotid
WHERE t1.allotid = @allotid
AND t3.unittype = @unittype
AND t3.unittype = @unittype
...
@@ -187,20 +186,19 @@ public IEnumerable<report_original_workload> QueryWorkloadData(int allotid, stri
...
@@ -187,20 +186,19 @@ public IEnumerable<report_original_workload> QueryWorkloadData(int allotid, stri
stringclear=@"SELECT DISTINCT t3.AccountingUnit as Department,ifnull(t1.DoctorName, '未知') DoctorName,if(ifnull(t2.PersonnelNumber,'')='',ifnull(t2.JobNumber,ifnull(t1.DoctorName, '未知')), t2.PersonnelNumber) PersonnelNumber,t1.Category,t1.Fee FROM ex_result t1
stringclear=$@"SELECT DISTINCT t3.AccountingUnit as Department,ifnull(t1.DoctorName, '未知') DoctorName,t1.PersonnelNumber,t1.Category,t1.Fee FROM ex_result t1
LEFT JOIN per_employee t2 on t1.personnelnumber = t2.jobnumber AND t2.allotid = @allotid
JOIN (select distinct AccountingUnit,HISDeptName,unittype from per_dept_dic where HospitalId = @hospitalid) t3 ON t1.Department = t3.HISDeptName
JOIN (select distinct AccountingUnit,HISDeptName,unittype from per_dept_dic where HospitalId = @hospitalid) t3 ON t1.Department = t3.HISDeptName