MobilePayDao.java 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. package thyyxxk.simzfeeoprnsystm.dao;
  2. import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  3. import org.apache.ibatis.annotations.*;
  4. import thyyxxk.simzfeeoprnsystm.pojo.SiPatInfo;
  5. import thyyxxk.simzfeeoprnsystm.pojo.mobilepay.*;
  6. import java.util.List;
  7. @Mapper
  8. public interface MobilePayDao extends BaseMapper<MobilePay> {
  9. @Select("select psn_no from t_si_pat_info where pat_no=#{patNo} and times=#{times}")
  10. String selectPsnNofoForMz(@Param("patNo") String patNo,
  11. @Param("times") int times);
  12. @Select("select mdtrt_id from t_si_pat_info where pat_no=#{patNo} and times=#{times}")
  13. String selectMdtrtIdForMz(@Param("patNo") String patNo,
  14. @Param("times") int times);
  15. @Select("select count(1) from t_si_pat_info where pat_no=#{patNo} and times=#{times} ")
  16. int selectSiMzInfoCount(@Param("patNo") String patNo,
  17. @Param("times") int times);
  18. @Insert("insert into t_si_pat_info (pat_no, times, ledger_sn, psn_no, psn_cert_type, insutype, insuplc_admdvs, " +
  19. "certno, psn_name, gend, naty, brdy, age, med_type, psn_idet_type,psn_type,emp_name, create_datetime, balc) " +
  20. "values (#{patNo},#{times},#{ledgerSn},#{psnNo},#{psnCertType},#{insutype},#{insuplc},#{certno}," +
  21. "#{psnName},#{gend},#{naty},#{brdy},#{age},#{medType},#{psnIdetType},#{psnType},#{empName},getdate(),#{balc})")
  22. void insertSiMzInfoPsnNo(PsnBaseInfo psnBaseinfo);
  23. @Update("update t_si_pat_info set insutype=#{insutype},balc=#{balc},insuplc_admdvs=#{admdvs} " +
  24. "where pat_no=#{patNo} and times=#{times}")
  25. void updateSiZyInfoPsnNo(@Param("patNo") String patNo,
  26. @Param("times") int times,
  27. @Param("insutype") String insutype,
  28. @Param("balc") String balc,
  29. @Param("admdvs") String admdvs);
  30. @Select("select psn_no,insutype, " +
  31. "medOrgOrd=pat_no+'_'+cast(a.times as varchar)+'_1', " +
  32. "begntime=b.visit_date, " +
  33. "idNo=a.certno, " +
  34. "userName=a.psn_name, " +
  35. "idType='01', " +
  36. "ecToken='', " +
  37. "insuCode=a.insuplc_admdvs, " +
  38. "iptOtpNo=a.pat_no, " +
  39. "deptCode=rtrim(b.visit_dept_code)," +
  40. "deptName=(select rtrim(d.name) from zd_unit_code d where d.code=b.visit_dept_code), " +
  41. "caty=(select rtrim(d.si_caty) from zd_unit_code d where d.code=b.visit_dept_code), " +
  42. "a.mdtrt_id,a.med_type, " +
  43. "feeType='01', " +
  44. "medfeeSumamt=(select sum(d.charge_fee) from t_mt_receipt d where d.patient_id=a.pat_no and d.times=a.times), " +
  45. "acctUsedFlag='1', " +
  46. "psnSetlway='01', " +
  47. "diseCodg=a.dise_code," +
  48. "diseName=a.dise_name," +
  49. "chrgBchno=pat_no+'_'+a.mdtrt_id " +
  50. "from t_si_pat_info a,mz_visit_table b " +
  51. "where a.pat_no=#{patNo} and a.times=#{times} " +
  52. "and b.patient_id=a.pat_no and b.times=a.times")
  53. Upload6201 selectUpload6201(@Param("patNo") String patNo, @Param("times") int times);
  54. @Select("select diag_type,diag_srt_no,diag_code,diag_name," +
  55. "diag_dept,dise_dor_no,dise_dor_name," +
  56. "diag_time,vali_flag from t_si_mz_diag " +
  57. "where pat_no=#{patNo} and times=#{times}")
  58. List<Diseinfo> selectMpDiseinfos(@Param("patNo") String patNo, @Param("times") int times);
  59. @Select("select " +
  60. "feedetlSn=(a.patient_id + '_' + cast(a.times as varchar) + '_' + cast(a.receipt_no as varchar) + '_' + " +
  61. "cast(a.order_no as varchar) + '_' + cast(a.item_no as varchar)), " +
  62. "b.mdtrt_id,b.psn_no,chrgBchno=b.pat_no+'_'+b.mdtrt_id, " +
  63. "rxCircFlag='0',input_date as feeOcurTime, " +
  64. "medListCodg=isnull((select max(national_code) from yp_zd_dict where code=his_item_code), " +
  65. "(select max(national_code) from zd_charge_item where code=his_item_code)), " +
  66. "his_item_code as medinsListCodg, " +
  67. "charge_fee as detItemFeeSumamt, " +
  68. "quantity as cnt, price as pric, " +
  69. "b.med_type,hospApprFlag='1', " +
  70. "bilgDrCodg=(select rtrim(yb_code) from a_employee_mi where code=input_staff), " +
  71. "input_man as bilgDrName, " +
  72. "bilgDeptCodg=rtrim(c.visit_dept_code), " +
  73. "bilgDeptName=(select rtrim(d.name) from zd_unit_code d where d.code=c.visit_dept_code) " +
  74. "from t_mt_receipt a, t_si_pat_info b, mz_visit_table c " +
  75. "where a.patient_id=#{patNo} and a.times=#{times} " +
  76. "and b.pat_no=a.patient_id and b.times=a.times " +
  77. "and c.patient_id=a.patient_id and c.times=a.times")
  78. List<Feedetail> selectMpFees(@Param("patNo") String patNo, @Param("times") int times);
  79. @Select("select icd_code_new as icdCode,icd_text_new as icdName," +
  80. "visit_date,drCode=rtrim(doctor_code)," +
  81. "drName=(select rtrim(d.name) from a_employee_mi d where d.code=doctor_code) " +
  82. "from mz_visit_table where patient_id=#{patNo} and times=#{times}")
  83. VisitTableIcd selectMzVisitIcd(@Param("patNo") String patNo, @Param("times") int times);
  84. @Select("select * from t_si_pat_info where pat_no=#{patNo} and times=#{times}")
  85. SiPatInfo selectSiPatInfoForMz(@Param("patNo") String patNo,
  86. @Param("times") int times);
  87. @Select("select pay_ord_id,orgCodg='H43010500370',pay_token,id_no," +
  88. "user_name,id_type from t_mobile_pay where mdtrt_id=#{mdtrtId} ")
  89. MobileOrderQuery selectOrderQueryData(@Param("mdtrtId") String mdtrtId);
  90. }