Quellcode durchsuchen

解决历史数据问题

hurugang vor 4 Jahren
Ursprung
Commit
89bd6aa7ce

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

@@ -21,7 +21,7 @@ public interface MzChargeDetailMapper {
      */
     @Select({"<script>",
             "select count(*) from (",
-            "select patient_id from mz_charge_detail  where bill_item_code <![CDATA[<>]]> 'TC'  ",
+            "select patient_id from ${tableName}  where bill_item_code <![CDATA[<>]]> 'TC'  ",
             "<when test='mzChargeDetail.payMark!=null'>",
             " and pay_mark =#{mzChargeDetail.payMark,jdbcType=CHAR}",
             "</when>",
@@ -152,7 +152,7 @@ public interface MzChargeDetailMapper {
             "</when>",
             "real_no,sum(( case when convert(decimal(18,2),unit_price)=0.00 then 0.01 else convert(decimal(18,2),unit_price) end )*quantity*drug_win) amount" ,
             ",sum(( case when convert(decimal(18,2),orig_price)=0.00 then 0.01 else convert(decimal(18,2),orig_price) end )*quantity*drug_win) not_discount_amount ",
-                    " from mz_charge_detail  where bill_item_code <![CDATA[<>]]> 'TC' ",
+                    " from ${tableName}  where bill_item_code <![CDATA[<>]]> 'TC' ",
             "<when test='mzChargeDetail.payMark!=null'>",
             " and pay_mark =#{mzChargeDetail.payMark,jdbcType=CHAR}",
             "</when>",
@@ -830,8 +830,8 @@ public interface MzChargeDetailMapper {
      * @param times
      * @return
      */
-    @Select("select top 1 rtrim(warn_dept) warn_dept,rtrim(doctor_code) doctor_code,rtrim(print_flag) print_flag from mz_charge_detail where  patient_id = #{patientId} and times = #{times} and warn_dept is not null and doctor_code is not null and warn_dept<> '' and doctor_code<> '' ")
-    MzChargeDetail selectWarnDeptAndDoctor(@Param("patientId") String patientId, @Param("times") Integer times);
+    @Select("select top 1 rtrim(warn_dept) warn_dept,rtrim(doctor_code) doctor_code,rtrim(print_flag) print_flag from ${tableName} where  patient_id = #{patientId} and times = #{times} and warn_dept is not null and doctor_code is not null and warn_dept<> '' and doctor_code<> '' ")
+    MzChargeDetail selectWarnDeptAndDoctor(@Param("patientId") String patientId, @Param("times") Integer times, @Param("tableName") String tableName);
 
     /**
      * 清洗老系统打印发票数据

+ 1 - 1
src/main/java/cn/hnthyy/thmz/service/impl/his/MzChargeDetailServiceImpl.java

@@ -143,7 +143,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
             }
         }
         for (MzChargeDetail mzChargeDetail : mzChargeDetailList) {
-            MzChargeDetail temp = mzChargeDetailMapper.selectWarnDeptAndDoctor(mzChargeDetail.getPatientId(), mzChargeDetail.getTimes());
+            MzChargeDetail temp = mzChargeDetailMapper.selectWarnDeptAndDoctor(mzChargeDetail.getPatientId(), mzChargeDetail.getTimes(),mzChargeDetailPageDto.getTableName());
             mzChargeDetail.setWarnDept(temp.getWarnDept());
             mzChargeDetail.setDoctorCode(temp.getDoctorCode());
             mzChargeDetail.setPrintFlag(temp.getPrintFlag());