stringclear=@"SELECT t3.AccountingUnit as Department,t1.DoctorName,if(ifnull(t2.PersonnelNumber,'')='', t2.JobNumber, t2.PersonnelNumber) PersonnelNumber,t1.Category,t1.Fee FROM ex_result t1
stringclear=@"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
stringclear=@"SELECT t3.AccountingUnit as Department,t1.DoctorName,if(ifnull(t2.PersonnelNumber,'')='', t2.JobNumber, t2.PersonnelNumber) PersonnelNumber,t1.Category,t1.Fee FROM ex_result t1
stringclear=@"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