YpCodgMatchDao.java 4.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. package thyyxxk.webserver.dao.his.medicine;
  2. import org.apache.ibatis.annotations.Mapper;
  3. import org.apache.ibatis.annotations.Param;
  4. import org.apache.ibatis.annotations.Select;
  5. import thyyxxk.webserver.entity.medicine.YpZdDictVo;
  6. import thyyxxk.webserver.entity.medicine.vo.YpCodgVo;
  7. import java.util.List;
  8. import java.util.Map;
  9. @Mapper
  10. public interface YpCodgMatchDao {
  11. @Select("<script> " +
  12. " select distinct rtrim(mz.patient_id) as patientId, rtrim(mz.patient_id) as patNo, mz.times, " +
  13. " mz.receipt_no as receiptNo, mz.order_no as orderNo, mz.real_no as realNo, " +
  14. " mz.name, mz.charge_date as chargeDate, mz.confirm_flag as confirmFlag, " +
  15. " mz.warn_dept as warnDept, rtrim(mz.serial_no) as serialNo, mz.print_flag as printFlag, " +
  16. " mz.group_no as groupNo, rtrim(c.name) as deptName, yp.drug_flag as drugFlag," +
  17. " isnull(si.setl_id, '') as setlId, isnull(si.mdtrt_id, '') as mdtrtId " +
  18. " from mz_charge_detail as mz with(nolock) " +
  19. " left join zd_unit_code as c on mz.warn_dept = c.code " +
  20. " inner join yp_zd_dict as yp with(nolock) on mz.charge_item_code = yp.code and mz.serial = yp.serial " +
  21. " left join t_si_setlinfo as si on mz.patient_id = si.pat_no and mz.times = si.times " +
  22. " where mz.pay_mark = '0' " +
  23. " and mz.serial_no &gt; 0 " +
  24. " and isnull(mz.confirm_zs, '') &lt;&gt; '1' " +
  25. " and mz.group_no = #{vo.groupNo} " +
  26. "<if test=\" vo.startTime != null and vo.startTime != '' \">" +
  27. " and mz.charge_date &gt;= #{vo.startTime} " +
  28. "</if>" +
  29. "<if test=\" vo.endTime != null and vo.endTime != '' \">" +
  30. " and mz.charge_date &lt;= #{vo.endTime} " +
  31. "</if>" +
  32. "<if test=\" vo.patName != null and vo.patName != '' \">" +
  33. " and mz.name like ('%' + #{vo.patName} + '%') " +
  34. "</if>" +
  35. "<if test=\" vo.patNo != null and vo.patNo != '' \">" +
  36. " and mz.patient_id = #{vo.patNo} " +
  37. "</if>" +
  38. "<if test=\" vo.confirmFlag != null and vo.confirmFlag != '' \">" +
  39. " and mz.confirm_flag = #{vo.confirmFlag} " +
  40. "</if>" +
  41. "<if test=\" vo.dept != null and vo.dept != '' \">" +
  42. " and isnull(mz.warn_dept, '') = #{vo.dept} " +
  43. "</if>" +
  44. " order by charge_date desc " +
  45. "</script>")
  46. List<Map<String, Object>> selectMzChargePrescription(@Param("vo") YpCodgVo vo);
  47. @Select("<script> " +
  48. " select rtrim(mz.patient_id) as patientId, mz.times, mz.item_no as itemNo, " +
  49. " mz.receipt_no as receiptNo, mz.order_no as orderNo, mz.real_no as realNo, " +
  50. " mz.name, mz.charge_date as chargeDate, mz.confirm_flag as confirmFlag, mz.group_no as groupNo, " +
  51. " mz.warn_dept as warnDept, rtrim(mz.serial_no) as serialNo, mz.print_flag as printFlag, " +
  52. " mz.quantity, mz.supply_code as supplyCode, mz.manu_no as manuNo, rtrim(mz.charge_item_code) as chargeCode, " +
  53. " rtrim(c.name) as deptName, yp.drug_flag as drugFlag, yp.name as chargeName, yp.location, yp.retprice, " +
  54. " rtrim(yp.specification) as specification, rtrim(cj.name) as factory, mz.serial, '0' as trdnFlag " +
  55. " from mz_charge_detail as mz with(nolock) " +
  56. " left join zd_unit_code as c on mz.warn_dept = c.code " +
  57. " inner join yp_zd_dict as yp with(nolock) on mz.charge_item_code = yp.code and mz.serial = yp.serial " +
  58. " inner join yp_zd_manufactory as cj on yp.manu_code = cj.code " +
  59. " where mz.pay_mark = '0' " +
  60. " and mz.patient_id = #{vo.patNo} " +
  61. " and mz.times = #{vo.times} " +
  62. " and mz.receipt_no = #{vo.receiptNo} " +
  63. " and mz.order_no = #{vo.orderNo} " +
  64. " and mz.real_no = #{vo.realNo} " +
  65. " and mz.group_no = #{vo.groupNo} " +
  66. " order by mz.charge_date desc " +
  67. "</script>")
  68. List<Map<String, Object>> selectMzCfDetail(@Param("vo") YpCodgVo vo);
  69. @Select(" select name from sys_parameters where code = 'classCodeFskYp' ")
  70. String selectFskYpClassCode();
  71. @Select(" select name from sys_parameters where code = 'deptCodeXts' ")
  72. String selectXtsDeptCode();
  73. @Select(" select name from sys_parameters where code = 'isOpenTaoBaoMatch' ")
  74. String selectIsOpenTb();
  75. @Select(" select * from yp_zd_dict where code = #{code} and serial = #{serial} ")
  76. YpZdDictVo selectYpZdDictByCode(@Param("code") String code, @Param("serial") String serial);
  77. }