Patient360Dao.java 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. package thyyxxk.webserver.dao.his.view;
  2. import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
  3. import com.baomidou.mybatisplus.core.toolkit.Constants;
  4. import org.apache.ibatis.annotations.Mapper;
  5. import org.apache.ibatis.annotations.Param;
  6. import org.apache.ibatis.annotations.Select;
  7. import thyyxxk.webserver.entity.view.patient360.MedicalTrack;
  8. import thyyxxk.webserver.entity.view.patient360.PatientInfo360;
  9. import thyyxxk.webserver.entity.view.patient360.ZyFeeDetail;
  10. import thyyxxk.webserver.entity.zhuyuanyisheng.emr.EmrPatientData;
  11. import thyyxxk.webserver.entity.zhuyuanyisheng.yizhuluru.YiZhuFeiYongChaXunTiaoJian;
  12. import java.math.BigDecimal;
  13. import java.util.List;
  14. @Mapper
  15. public interface Patient360Dao {
  16. @Select("select rtrim(inpatient_no) as inpatient_no," +
  17. " rtrim(mz_no) as mz_no, " +
  18. " sex, " +
  19. " social_no, " +
  20. " rtrim(name) as name," +
  21. " CONVERT(varchar(100), birth_date, 23) as birth_date " +
  22. "from a_patient_mi " +
  23. "where ${field} = #{patNo};")
  24. PatientInfo360 getPatientInfo(String patNo, String field);
  25. @Select("select CONVERT(varchar(100), admiss_date, 23) as date, " +
  26. " deptName = (select name from zd_unit_code where code = small_dept), " +
  27. " outOrHosp = 2 ," +
  28. " uid = (rtrim(inpatient_no) + '_' + cast(admiss_times as varchar(5)))," +
  29. " rtrim(inpatient_no) as patNo," +
  30. " admiss_times as times," +
  31. " inTheHospital," +
  32. " admiss_date , dis_date " +
  33. "from view_zy_patient_all " +
  34. "where inpatient_no = #{patNo} " +
  35. "order by admiss_times;")
  36. List<MedicalTrack> getHospMedicalTrack(String patNo);
  37. @Select("select emr_document_id, emr_name " +
  38. "from emr_patient_data " +
  39. "where pat_no = #{patNo} " +
  40. " and times = #{times} " +
  41. " and del_flag = 0")
  42. List<EmrPatientData> getEmrData(String patNo, Integer times);
  43. @Select("select ledger_sn, " +
  44. " detail_sn, " +
  45. " charge_date, " +
  46. " op_id_code, " +
  47. " op_id_code_name = (select rtrim(name) from a_employee_mi where code = op_id_code), " +
  48. " charge_code_mx," +
  49. "case\n" +
  50. " when serial != '00' then\n" +
  51. " (select rtrim(name)\n" +
  52. " from yp_zd_dict\n" +
  53. " where code = charge_code_mx\n" +
  54. " and zy_detail_charge.serial = yp_zd_dict.serial)\n" +
  55. " else (select rtrim(name) from zd_charge_item where code = charge_code_mx)\n" +
  56. " end as charge_code_name, " +
  57. " charge_amount, " +
  58. " charge_fee, " +
  59. " ward_code, " +
  60. " ward_code_name = (select rtrim(name) from zd_unit_code where code = ward_code), " +
  61. " exec_unit, " +
  62. " exec_unit_name = (select rtrim(name) from zd_unit_code where code = exec_unit), " +
  63. " order_no," +
  64. " actOrderNoStr = cast(cast(order_no as decimal(10)) as varchar(50)), " +
  65. " serial, " +
  66. " ori_detail_sn " +
  67. "from zy_detail_charge " +
  68. " ${ew.customSqlSegment} ")
  69. List<ZyFeeDetail> getZyFeeDetail(@Param(Constants.WRAPPER) QueryWrapper<?> queryWrapper);
  70. @Select("select rtrim(inpatient_no) as patNo , admiss_times as times," +
  71. " cast(cast(act_order_no as decimal) as varchar) actOrderNoStr," +
  72. " cast(cast(parent_no as decimal) as varchar(max)) as parent_no_str " +
  73. " from view_xc_all_yz where act_order_no = #{orderNo}")
  74. YiZhuFeiYongChaXunTiaoJian getOrderNoInfo(BigDecimal orderNo);
  75. @Select("select cast(act_order_no as decimal) " +
  76. " from view_xc_all_yz " +
  77. "where inpatient_no= #{patNo}" +
  78. " and admiss_times = #{times} " +
  79. " and parent_no = #{orderNo}")
  80. List<BigDecimal> getParentNoByOrderNo(String patNo, Integer times, BigDecimal orderNo);
  81. @Select("select rtrim(patient_id) as patNo," +
  82. " rtrim(patient_id) + '_' + CONVERT(varchar(100), charge_date, 23) as uid, " +
  83. " CONVERT(varchar(100), charge_date, 23) as date," +
  84. " outOrHosp = 1" +
  85. "from mz_charge_detail a\n" +
  86. "where a.patient_id = #{mzNo}\n" +
  87. " and pay_mark = 0\n" +
  88. " and confirm_flag != 4\n" +
  89. " and isnull(cash_id, '') != '99998'\n" +
  90. "group by patient_id,\n" +
  91. " CONVERT(varchar(100), charge_date, 23)\n" +
  92. "order by date;")
  93. List<MedicalTrack> getMzMedicalTrack(String mzNo);
  94. }