浏览代码

Merge branch 'dev-1.0.9' into dev-1.1.0

hurugang 5 年之前
父节点
当前提交
f6a0050d1b
共有 1 个文件被更改,包括 10 次插入2 次删除
  1. 10 2
      src/main/java/cn/hnthyy/thmz/mapper/his/MzChargeDetailMapper.java

+ 10 - 2
src/main/java/cn/hnthyy/thmz/mapper/his/MzChargeDetailMapper.java

@@ -605,7 +605,11 @@ public interface MzChargeDetailMapper {
                     " and (len(ltrim(rtrim(mz_receipt_serial.receipt_bill))) >= 10 or len(ltrim(rtrim(mz_receipt_serial.receipt_bill)))=0) then '本院记账' else '自费' end, " +
                     " serial_no_order=ABS(a.serial_no)  " +
                     "    FROM mz_charge_detail a,mz_receipt_serial " +
-                    "    WHERE a.charge_date <![CDATA[>=]]> #{beginDate,jdbcType=TIMESTAMP} and a.charge_date <![CDATA[<=]]> #{endDate,jdbcType=TIMESTAMP}  and a.pay_mark <![CDATA[<>]]> 9 " +
+                    " WHERE "+
+                    " a.patient_id=mz_receipt_serial.patient_id " +
+                    " and a.times = mz_receipt_serial.times " +
+                    " and a.receipt_no = mz_receipt_serial.receipt_no "+
+                    "    and a.charge_date <![CDATA[>=]]> #{beginDate,jdbcType=TIMESTAMP} and a.charge_date <![CDATA[<=]]> #{endDate,jdbcType=TIMESTAMP}  and a.pay_mark <![CDATA[<>]]> 9 " +
                     "<when test='patientId!=null'>",
             " and a.patient_id like #{patientId}",
             "</when>",
@@ -717,7 +721,11 @@ public interface MzChargeDetailMapper {
                     " and (len(ltrim(rtrim(mz_receipt_serial_b.receipt_bill))) >= 10 or len(ltrim(rtrim(mz_receipt_serial_b.receipt_bill)))=0) then '本院记账' else '自费' end, " +
                     " serial_no_order=ABS(a.serial_no)  " +
                     "    FROM mz_charge_detail_b a,mz_receipt_serial_b " +
-                    "  WHERE a.charge_date <![CDATA[>=]]> #{beginDate,jdbcType=TIMESTAMP} and a.charge_date <![CDATA[<=]]> #{endDate,jdbcType=TIMESTAMP}  and a.pay_mark <![CDATA[<>]]> 9  " +
+                    "WHERE"+
+                    " a.patient_id=mz_receipt_serial_b.patient_id " +
+                    " and a.times = mz_receipt_serial_b.times " +
+                    " and a.receipt_no = mz_receipt_serial_b.receipt_no "+
+                    "  and a.charge_date <![CDATA[>=]]> #{beginDate,jdbcType=TIMESTAMP} and a.charge_date <![CDATA[<=]]> #{endDate,jdbcType=TIMESTAMP}  and a.pay_mark <![CDATA[<>]]> 9  " +
                     "<when test='patientId!=null'>",
             " and a.patient_id like #{patientId}",
             "</when>",