Commit 8d0ae4b1 by lcx

二次绩效工作量、门诊收入数据去重

parent 86776b8d
......@@ -165,7 +165,7 @@ public IEnumerable<report_original_workload> QueryWorkloadData(int allotid, stri
if (connection.State != ConnectionState.Open) connection.Open();
try
{
string clear = @"SELECT t3.AccountingUnit as Department,t1.DoctorName,if(ifnull(t2.PersonnelNumber,'')='', t2.JobNumber, t2.PersonnelNumber) PersonnelNumber,t1.Category,t1.Fee FROM ex_result t1
string clear = @"SELECT DISTINCT t3.AccountingUnit as Department,t1.DoctorName,if(ifnull(t2.PersonnelNumber,'')='', t2.JobNumber, t2.PersonnelNumber) PersonnelNumber,t1.Category,t1.Fee FROM ex_result t1
JOIN per_employee t2 on t1.doctorname = t2.doctorname and t1.personnelnumber = t2.jobnumber
JOIN (select distinct AccountingUnit,HISDeptName,unittype from per_dept_dic where HospitalId = @hospitalid) t3 ON t1.Department = t3.HISDeptName
WHERE t1.allotid = @allotid
......@@ -195,7 +195,7 @@ public IEnumerable<ex_result> QueryIncomeData(int allotid, string accountingunit
if (connection.State != ConnectionState.Open) connection.Open();
try
{
string clear = @"SELECT t3.AccountingUnit as Department,t1.DoctorName,if(ifnull(t2.PersonnelNumber,'')='', t2.JobNumber, t2.PersonnelNumber) PersonnelNumber,t1.Category,t1.Fee FROM ex_result t1
string clear = @"SELECT DISTINCT t3.AccountingUnit as Department,t1.DoctorName,if(ifnull(t2.PersonnelNumber,'')='', t2.JobNumber, t2.PersonnelNumber) PersonnelNumber,t1.Category,t1.Fee FROM ex_result t1
JOIN per_employee t2 on t1.doctorname = t2.doctorname and t1.personnelnumber = t2.jobnumber
JOIN (select distinct AccountingUnit,HISDeptName,unittype from per_dept_dic where HospitalId = @hospitalid) t3 ON t1.Department = t3.HISDeptName
WHERE t1.allotid = @allotid
......
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