Browse Source

日结时间是当天的最后一秒的数据无法进入报表

hurugang 5 năm trước cách đây
mục cha
commit
bcb37cb80b

+ 9 - 9
src/main/java/cn/hnthyy/thmz/mapper/his/ChargeFeeVoMapper.java

@@ -54,8 +54,8 @@ public interface ChargeFeeVoMapper {
             "   receipt_sn=r.receipt_sn , " +
             "   m.cheque_type, " +
             "   m.op_id from mz_deposit_file  m left join mz_receipt_serial r on m.serial_no =r.serial_no where " +
-            "   case '1' when #{caseType} then r.charge_date else  m.dcount_date end >=#{beginDate,jdbcType=TIMESTAMP}  " +
-            "  and  case '1' when #{caseType} then r.charge_date else  m.dcount_date end <=#{endDate,jdbcType=TIMESTAMP} " +
+            "   case '1' when #{caseType} then r.charge_date else  CONVERT(varchar(100), m.dcount_date, 20) end >=#{beginDate,jdbcType=TIMESTAMP}  " +
+            "  and  case '1' when #{caseType} then r.charge_date else  CONVERT(varchar(100), m.dcount_date, 20) end <=#{endDate,jdbcType=TIMESTAMP} " +
             "  and m.pay_mark <> 2 and m.cheque_type <>'Z' " +
             "  group by r.receipt_sn,r.receipt_bill,m.cheque_type,r.pay_mark,m.op_id " +
             "   order by abs(r.receipt_sn),r.receipt_bill")
@@ -80,8 +80,8 @@ public interface ChargeFeeVoMapper {
             "   receipt_sn=r.receipt_sn , " +
             "   m.cheque_type, " +
             "   m.op_id from mz_deposit_file_b  m left join mz_receipt_serial_b r on m.serial_no =r.serial_no where " +
-            "   case '1' when #{caseType} then r.charge_date else  m.dcount_date end >=#{beginDate,jdbcType=TIMESTAMP}  " +
-            "  and  case '1' when #{caseType} then r.charge_date else  m.dcount_date end <=#{endDate,jdbcType=TIMESTAMP} " +
+            "   case '1' when #{caseType} then r.charge_date else  CONVERT(varchar(100), m.dcount_date, 20) end >=#{beginDate,jdbcType=TIMESTAMP}  " +
+            "  and  case '1' when #{caseType} then r.charge_date else  CONVERT(varchar(100), m.dcount_date, 20) end <=#{endDate,jdbcType=TIMESTAMP} " +
             "  and m.pay_mark <> 2 and m.cheque_type <>'Z' " +
             "  group by r.receipt_sn,r.receipt_bill,m.cheque_type,r.pay_mark,m.op_id " +
             "   order by abs(r.receipt_sn),r.receipt_bill")
@@ -901,9 +901,9 @@ public interface ChargeFeeVoMapper {
             "    FROM ${tableName} a, " +
             "         (select distinct patient_id,times,receipt_no, serial_no,receipt_sn from ${tableName1} " +
             "          where (case '1' when '0' then charge_date " +
-            "                 else dcount_date end) >= #{beginDate,jdbcType=TIMESTAMP} and  " +
+            "                 else CONVERT(varchar(100), dcount_date, 20) end) >= #{beginDate,jdbcType=TIMESTAMP} and  " +
             "                (case '1' when '0' then charge_date " +
-            "                 else dcount_date end) <= #{endDate,jdbcType=TIMESTAMP} and " +
+            "                 else CONVERT(varchar(100), dcount_date, 20) end) <= #{endDate,jdbcType=TIMESTAMP} and " +
             "                (case '1' when '0' then isnull(dcount_no,0) " +
             "                 else 1 end) = isnull(dcount_no,0) ) as b, " +
             "         zd_charge_item c, " +
@@ -1021,8 +1021,8 @@ public interface ChargeFeeVoMapper {
             "  and         case a.charge_bill_code " +
             "  when 'BILL10' then 'BILL01' when 'BILL11' then 'BILL28' when 'BILL12' then 'BILL02' else a.charge_bill_code end *=d.code " +
             "  and         isnull(d.audit_code,e.code)=e.code) mzsr  where mzsr.je <![CDATA[<>]]> 0 " +
-            "  and  case '1' when #{caseType} then mzsr.charge_date else  mzsr.dcount_date end <![CDATA[>=]]>#{beginDate,jdbcType=TIMESTAMP} " +
-            "  and  case '1' when #{caseType} then mzsr.charge_date else  mzsr.dcount_date end <![CDATA[<]]>#{endDate,jdbcType=TIMESTAMP} " +
+            "  and  case '1' when #{caseType} then mzsr.charge_date else  CONVERT(varchar(100), mzsr.dcount_date, 20) end <![CDATA[>=]]>#{beginDate,jdbcType=TIMESTAMP} " +
+            "  and  case '1' when #{caseType} then mzsr.charge_date else  CONVERT(varchar(100), mzsr.dcount_date, 20) end <![CDATA[<]]>#{endDate,jdbcType=TIMESTAMP} " +
             "<when test='patientIds!=null'>" +
             " and mzsr.patient_id in" +
             "<foreach item='item' index='index' collection='patientIds' open='(' separator=',' close=')'>" +
@@ -1056,7 +1056,7 @@ public interface ChargeFeeVoMapper {
      * @param thmzmxsrParamsVo
      * @return
      */
-    @Select("select patient_id,SUM(total_charge) total_charge from mz_receipt_serial where charge_dcount_date >=#{beginDate,jdbcType=TIMESTAMP} and  charge_dcount_date <#{endDate,jdbcType=TIMESTAMP}  GROUP BY patient_id order by patient_id desc ")
+    @Select("select patient_id,SUM(total_charge) total_charge from mz_receipt_serial where CONVERT(varchar(100), charge_dcount_date, 20) >=#{beginDate,jdbcType=TIMESTAMP} and  CONVERT(varchar(100), charge_dcount_date, 20) <#{endDate,jdbcType=TIMESTAMP}  GROUP BY patient_id order by patient_id desc ")
     List<Map<String,Object>> selectSumAmount(ThmzmxsrParamsVo thmzmxsrParamsVo);
 
 }