소스 검색

优化发票号查询

hurugang 2 년 전
부모
커밋
0a989da97e

+ 2 - 6
src/main/java/cn/hnthyy/thmz/mapper/his/mz/MzReceiptSerialMapper.java

@@ -201,12 +201,8 @@ public interface MzReceiptSerialMapper {
      * @param receiptNo
      * @return
      */
-    @Select("select rtrim(patient_id) patient_id,times,receipt_no,serial_no,rtrim(operator_id) operator_id,charge1,charge2,charge3,charge4,charge5,charge6,charge7,charge8,charge9,"+
-            "charge10,charge11,charge12,charge13,charge14,charge15,charge16,charge17,charge18,charge19,charge20,rtrim(pay_mark) pay_mark,total_charge,charge_date,rtrim(receipt_bill) receipt_bill,"+
-            "receipt_sn,dcount_date,rtrim(windows_no) windows_no,dcount_no,serial_yb,rtrim(fp_flag) fp_flag,rtrim(responce_type) responce_type,rtrim(cheque_type) cheque_type,cheque_no," +
-                    "rtrim(tf_flag) tf_flag,dept_no,rtrim(pay_id) pay_id,charge_dcount_date,charge_dcount_no,obsolete_id,obsolete_date,obsolete_dcount_date,obsolete_dcount_no "+
-            " from mz_receipt_serial WITH(NOLOCK) where  patient_id=#{patientId,jdbcType=CHAR} and times = #{times,jdbcType=INTEGER} and receipt_no = #{receiptNo,jdbcType=INTEGER} and receipt_bill is not null and receipt_bill <> ''")
-    MzReceiptSerial selectReceiptBillForThisTime(@Param(value = "patientId") String patientId, @Param("times") Integer times, @Param("receiptNo") Integer receiptNo);
+    @Select("select rtrim(receipt_bill) receipt_bill from mz_receipt_serial WITH(NOLOCK) where  patient_id=#{patientId,jdbcType=CHAR} and times = #{times,jdbcType=INTEGER} and receipt_no = #{receiptNo,jdbcType=INTEGER} and receipt_bill is not null and receipt_bill <> '' GROUP BY receipt_bill")
+    String selectReceiptBillForThisTime(@Param(value = "patientId") String patientId, @Param("times") Integer times, @Param("receiptNo") Integer receiptNo);
 
 
     /**

+ 3 - 3
src/main/java/cn/hnthyy/thmz/service/impl/his/mz/ChargeFeeVoServiceImpl.java

@@ -66,9 +66,9 @@ public class ChargeFeeVoServiceImpl implements ChargeFeeVoService {
         if(chargeFeeVoList!=null && chargeFeeVoList.size()>0){
             for(ChargeFeeVo chargeFeeVo:chargeFeeVoList){
                 if(!Arrays.asList(Constants.BYJZ,Constants.YBJZ).contains(chargeFeeVo.getChequeType())){
-                    MzReceiptSerial mzReceiptSerial= mzReceiptSerialMapper.selectReceiptBillForThisTime(chargeFeeVo.getPatientId(),chargeFeeVo.getTimes(),chargeFeeVo.getReceiptNo());
-                    if(mzReceiptSerial!=null && StringUtils.isNotBlank(mzReceiptSerial.getReceiptBill())){
-                        chargeFeeVo.setReceiptBill(mzReceiptSerial.getReceiptBill());
+                    String receiptBill= mzReceiptSerialMapper.selectReceiptBillForThisTime(chargeFeeVo.getPatientId(),chargeFeeVo.getTimes(),chargeFeeVo.getReceiptNo());
+                    if(StringUtils.isNotBlank(receiptBill)){
+                        chargeFeeVo.setReceiptBill(receiptBill);
                     }
                 }
                 if(chargeFeeVo.getContractId()==null){