|
@@ -1106,36 +1106,27 @@ public interface ChargeFeeVoMapper {
|
|
|
@Select({"<script>" +
|
|
|
"select xm=count(distinct a.patient_id)," +
|
|
|
" sl = sum(a.quantity * a.unit_price*isnull(a.drug_win,1)), " +
|
|
|
- " audit_code=d.name," +
|
|
|
+ " audit_code = isnull(b.audit_code,a.charge_bill_code)," +
|
|
|
" warn_dept=e.name," +
|
|
|
" doctor_id=rtrim(a.doctor_code) " +
|
|
|
- " from mz_charge_detail a WITH(NOLOCK),zd_charge_item b WITH(NOLOCK),zy_zd_audit_item c WITH(NOLOCK),zy_zd_audit_report d WITH(NOLOCK),zd_unit_code e WITH(NOLOCK)," +
|
|
|
- " (select distinct patient_id,times,receipt_no, serial_no,receipt_sn from mz_receipt_serial WITH(NOLOCK) " +
|
|
|
- " where 1=1 " +
|
|
|
+ " from mz_charge_detail a WITH(NOLOCK),zd_charge_item b WITH(NOLOCK),zd_unit_code e WITH(NOLOCK) " +
|
|
|
+ " where " +
|
|
|
"<when test='beginDate!=null'>",
|
|
|
- " and charge_date >=#{beginDate} ",
|
|
|
+ " a.charge_date >=#{beginDate} ",
|
|
|
"</when>",
|
|
|
"<when test='endDate!=null'>",
|
|
|
- " and charge_date <=#{endDate} ",
|
|
|
+ " and a.charge_date <=#{endDate} ",
|
|
|
"</when>",
|
|
|
- " ) as f " +
|
|
|
- " where a.unit_price <![CDATA[<>]]> 0 " +
|
|
|
+ " and a.unit_price <![CDATA[<>]]> 0 " +
|
|
|
"<when test='doctorCode!=null'>",
|
|
|
" and a.doctor_code =#{doctorCode} ",
|
|
|
"</when>",
|
|
|
"<when test='warnDept!=null'>",
|
|
|
" and a.warn_dept =#{warnDept} ",
|
|
|
"</when>" +
|
|
|
- " and case a.charge_bill_code when 'BILL10' then 'BILL01' when 'BILL11' then 'BILL28' when 'BILL12' then 'BILL02' else a.charge_bill_code end*=b.code " +
|
|
|
- " and isnull(b.audit_code,c.code)=c.code " +
|
|
|
- " and c.parent_code=d.code " +
|
|
|
- " and (case when isnull(a.warn_dept,'')='' then a.exec_dept else a.warn_dept end)*=e.code and " +
|
|
|
- " a.patient_id = f.patient_id and " +
|
|
|
- " a.times=f.times and " +
|
|
|
- " a.receipt_no=f.receipt_no and " +
|
|
|
- " a.serial_no=f.serial_no and " +
|
|
|
- " a.real_no=f.receipt_sn " +
|
|
|
- "group by a.doctor_code,d.name,e.name " +
|
|
|
+ " and a.charge_bill_code *=b.code " +
|
|
|
+ " and (case when isnull(a.warn_dept,'')='' then a.exec_dept else a.warn_dept end)*=e.code " +
|
|
|
+ "group by a.doctor_code,isnull(b.audit_code,a.charge_bill_code),e.name " +
|
|
|
"</script>"})
|
|
|
List<Map<String, Object>> selectDoctorPerformanceStatistics(@Param("beginDate") String beginDate, @Param("endDate") String endDate, @Param("doctorCode") String doctorCode, @Param("warnDept") String warnDept);
|
|
|
|