QueRenYiZhuShouFeiDao.java 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. package thyyxxk.webserver.dao.his.zhuyuanyiji;
  2. import com.baomidou.mybatisplus.core.metadata.IPage;
  3. import org.apache.ibatis.annotations.Mapper;
  4. import org.apache.ibatis.annotations.Param;
  5. import org.apache.ibatis.annotations.Select;
  6. import org.apache.ibatis.annotations.Update;
  7. import thyyxxk.webserver.entity.datamodify.YzActOrder;
  8. import java.util.List;
  9. /**
  10. * <p>
  11. * 描述: 确认医嘱收费
  12. * </p>
  13. *
  14. * @author xc
  15. * @date 2021-09-27 11:51
  16. */
  17. @Mapper
  18. public interface QueRenYiZhuShouFeiDao {
  19. @Select("<script>" +
  20. "SELECT a.inpatient_no, " +
  21. " a.admiss_times, " +
  22. " name =b.name, " +
  23. " bed_no =b.bed_no, " +
  24. " ward_name = (select rtrim(name) name from zd_unit_code where zd_unit_code.code = a.ward_code), " +
  25. " b.sex, " +
  26. " b.admiss_date, " +
  27. " b.total_charge, " +
  28. " responce_type , " +
  29. " responce_type_name=(select rtrim(name) name from zy_zd_responce_type where responce_type = zy_zd_responce_type.code), " +
  30. " a.ward_code,exec_unit " +
  31. "FROM yz_zy_patient_fee a ,zy_actpatient b " +
  32. "where a.charge_status='3' and " +
  33. "<if test=\"inpatientNo !=null and inpatientNo != '' \"> " +
  34. "a.inpatient_no = #{inpatientNo} and " +
  35. "</if>" +
  36. "<if test=\"admissTimes !=null and admissTimes != '' \">" +
  37. " a.admiss_times = #{admissTimes} and " +
  38. "</if>" +
  39. "<if test=\"execUnit != null and execUnit !='' and execUnit != '3100000'\">" +
  40. " a.exec_unit = #{execUnit} and " +
  41. "</if>" +
  42. "<if test=\"wardCode != null and wardCode !='' \">" +
  43. " a.ward_code = #{wardCode} and " +
  44. "</if>" +
  45. " a.inpatient_no=b.inpatient_no and " +
  46. " a.admiss_times=b.admiss_times and " +
  47. " convert(varchar(20),a.occ_time,23)&lt;=convert(varchar(20),getdate(),23) " +
  48. "group by a.inpatient_no, a.admiss_times, b.name, b.bed_no,a.ward_code,exec_unit,b.sex,b.admiss_date,b.total_charge,responce_type" +
  49. "</script>")
  50. IPage<YzActOrder> getXuQueFeiYiZhu(IPage<YzActOrder> page,
  51. @Param("inpatientNo") String inpatientNo,
  52. @Param("admissTimes") Integer admissTimes,
  53. @Param("execUnit") String execUnit,
  54. @Param("wardCode") String wardCode);
  55. @Select("<script>" +
  56. "SELECT a.inpatient_no, " +
  57. " a.admiss_times, " +
  58. " a.charge_date, " +
  59. " a.op_id_code, " +
  60. " a.charge_code, " +
  61. " a.infant_flag, " +
  62. " a.charge_status, " +
  63. " a.charge_fee, " +
  64. " a.self_flag, " +
  65. " a.separate_flag, " +
  66. " a.suppress_flag, " +
  67. " a.occ_time, " +
  68. " a.act_order_no, " +
  69. " a.dept_code, " +
  70. " a.ward_code, " +
  71. " ward_name = (select rtrim(name) name from zd_unit_code where zd_unit_code.code = a.ward_code)," +
  72. " a.order_count, " +
  73. " a.pay_self, " +
  74. " a.exec_unit, " +
  75. " a.zy_serial_no , " +
  76. " charge_name=c.name, " +
  77. " bill_item_code=c.bill_item_zy, " +
  78. " ledger_sn=b.times_billed, " +
  79. " name =b.name, " +
  80. " bed_no =b.bed_no, " +
  81. " op_flag =isnull(a.op_flag,'0'), " +
  82. " d.order_name, " +
  83. " docotr_name=e.name, " +
  84. " op_id = a.op_id, " +
  85. " op_date = a.op_date " +
  86. "FROM yz_zy_patient_fee a ,zy_actpatient b ,zd_charge_item c,yz_act_order d,a_employee_mi e " +
  87. "where a.charge_status='3' and " +
  88. " a.inpatient_no = #{inpatientNo} and " +
  89. " a.admiss_times = #{admissTimes} and " +
  90. "<if test=\"execUnit != '3100000' \">" +
  91. " a.exec_unit = #{execUnit} and " +
  92. "</if>" +
  93. " a.inpatient_no=b.inpatient_no and " +
  94. " a.admiss_times=b.admiss_times and " +
  95. " a.charge_code=c.code and" +
  96. " a.inpatient_no=d.inpatient_no and " +
  97. " a.admiss_times=d.admiss_times and" +
  98. " a.act_order_no=d.act_order_no and" +
  99. " d.physician*=e.code and" +
  100. " convert(varchar(20),a.occ_time,23)&lt;=convert(varchar(20),getdate(),23) " +
  101. "order by charge_name,order_code,charge_code" +
  102. "</script>")
  103. List<YzActOrder> getXuQueFeiXiangXiXinXi(@Param("inpatientNo") String inpatientNo,
  104. @Param("admissTimes") Integer admissTimes,
  105. @Param("execUnit") String execUnit);
  106. @Update("<script>" +
  107. "<foreach collection='list' item='item' separator=';'>" +
  108. "UPDATE yz_zy_patient_fee " +
  109. "<set>" +
  110. " charge_status = #{item.chargeStatus}, op_id = #{code}, op_date = GETDATE() " +
  111. "</set>" +
  112. "WHERE occ_time = #{item.occTime} AND act_order_no = #{item.actOrderNo} " +
  113. "AND inpatient_no = #{inpatientNo} AND admiss_times = #{admissTimes}" +
  114. "</foreach>" +
  115. "</script>")
  116. void baoCunYiZhuQueFei(@Param("inpatientNo") String inpatientNo,
  117. @Param("admissTimes") Integer admissTimes,
  118. @Param("list") List<YzActOrder> list,
  119. @Param("code") String code);
  120. }