|
|
@@ -120,18 +120,20 @@ public interface AllStatisticsDao {
|
|
|
" z.code as ksid, " +
|
|
|
" max(d.parent_code) as flm, " +
|
|
|
" max(e.name) as flmc, " +
|
|
|
- " isnull(sum(round(convert(decimal(18,3),((convert(decimal(18,3),unit_price)) * (quantity * isnull(drug_win,1)))),2)),0) as totalCharge, " +
|
|
|
+ " isnull(sum(round(convert(decimal(18,4),((convert(decimal(18,4),unit_price)) * (quantity * isnull(drug_win,1)))),2)),0) as totalCharge, " +
|
|
|
" max(d.name) as hsmc, " +
|
|
|
" c.audit_code as hsm " +
|
|
|
" from mz_charge_detail a(nolock) " +
|
|
|
- " join (select distinct patient_id,times,receipt_no, serial_no,receipt_sn from mz_receipt_serial " +
|
|
|
+ " join (select distinct patient_id,times,receipt_no from mz_receipt_serial " +
|
|
|
" where charge_date >= #{startTime} " +
|
|
|
- " and charge_date <= #{endTime}) as b " +
|
|
|
+ " and charge_date <= #{endTime} " +
|
|
|
+ " and tf_flag != '1' " +
|
|
|
+ " and receipt_no > 0 " +
|
|
|
+ " and isnull(warn_code,'')!='' " +
|
|
|
+ " and isnull(doctor_code,'')!='') as b " +
|
|
|
" on a.patient_id = b.patient_id " +
|
|
|
" and a.times = b.times " +
|
|
|
" and a.receipt_no = b.receipt_no " +
|
|
|
- " and a.real_no = b.receipt_sn " +
|
|
|
- " and a.serial_no = b.serial_no " +
|
|
|
" left join zd_charge_item c " +
|
|
|
" on case a.charge_bill_code " +
|
|
|
" when 'BILL10' then 'BILL01' " +
|
|
|
@@ -150,6 +152,8 @@ public interface AllStatisticsDao {
|
|
|
" end = z.code " +
|
|
|
" where a.bill_item_code <> 'TC' " +
|
|
|
" and a.exec_dept <> '0000000' " +
|
|
|
+ " and a.pay_mark = '0' " +
|
|
|
+ " and a.tf_flag != '1' " +
|
|
|
" group by z.name, z.code, c.audit_code")
|
|
|
List<Map<String, Object>> selectInpatientDeptAccountingReportMzExecDept(
|
|
|
@Param("startTime") String startTime, @Param("endTime") String endTime);
|
|
|
@@ -158,18 +162,20 @@ public interface AllStatisticsDao {
|
|
|
" z.code as ksid, " +
|
|
|
" max(d.parent_code) as flm, " +
|
|
|
" max(e.name) as flmc, " +
|
|
|
- " isnull(sum(round(convert(decimal(18,3),((convert(decimal(18,3),unit_price)) * (quantity * isnull(drug_win,1)))),2)),0) as totalCharge, " +
|
|
|
+ " isnull(sum(round(convert(decimal(18,4),((convert(decimal(18,4),unit_price)) * (quantity * isnull(drug_win,1)))),2)),0) as totalCharge, " +
|
|
|
" max(d.name) as hsmc, " +
|
|
|
" c.audit_code as hsm " +
|
|
|
" from mz_charge_detail a(nolock) " +
|
|
|
- " join (select distinct patient_id,times,receipt_no, serial_no,receipt_sn from mz_receipt_serial " +
|
|
|
+ " join (select distinct patient_id,times,receipt_no,warn_code from mz_receipt_serial " +
|
|
|
" where charge_date >= #{startTime} " +
|
|
|
- " and charge_date <= #{endTime}) as b " +
|
|
|
+ " and charge_date <= #{endTime}" +
|
|
|
+ " and tf_flag != '1' " +
|
|
|
+ " and receipt_no > 0 " +
|
|
|
+ " and isnull(warn_code,'')!='' " +
|
|
|
+ " and isnull(doctor_code,'')!='') as b " +
|
|
|
" on a.patient_id = b.patient_id " +
|
|
|
" and a.times = b.times " +
|
|
|
" and a.receipt_no = b.receipt_no " +
|
|
|
- " and a.real_no = b.receipt_sn " +
|
|
|
- " and a.serial_no = b.serial_no " +
|
|
|
" left join zd_charge_item c " +
|
|
|
" on case a.charge_bill_code " +
|
|
|
" when 'BILL10' then 'BILL01' " +
|
|
|
@@ -182,12 +188,11 @@ public interface AllStatisticsDao {
|
|
|
" join zy_zd_audit_report e " +
|
|
|
" on d.parent_code = e.code " +
|
|
|
" left join zd_unit_code z " +
|
|
|
- " on case when isnull(a.warn_dept,'') = '' or a.warn_dept = 'null' " +
|
|
|
- " then a.exec_dept " +
|
|
|
- " else a.warn_dept " +
|
|
|
- " end = z.code " +
|
|
|
+ " on b.warn_code = z.code " +
|
|
|
" where a.bill_item_code <> 'TC' " +
|
|
|
" and a.exec_dept <> '0000000' " +
|
|
|
+ " and a.pay_mark = '0' " +
|
|
|
+ " and a.tf_flag != '1' " +
|
|
|
" group by z.name, z.code, c.audit_code")
|
|
|
List<Map<String, Object>> selectInpatientDeptAccountingReportMzWardDept(
|
|
|
@Param("startTime") String startTime, @Param("endTime") String endTime);
|