OrderQuashDao.java 4.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. package thyyxxk.webserver.dao.his.zhuyuanyisheng;
  2. import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
  3. import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  4. import org.apache.ibatis.annotations.*;
  5. import thyyxxk.webserver.entity.zhuyuanyisheng.orderquash.ReqOrderQuash;
  6. import thyyxxk.webserver.entity.zhuyuanyisheng.orderquash.ReturnReqOrderQuash;
  7. import java.math.BigDecimal;
  8. import java.util.Date;
  9. import java.util.List;
  10. @Mapper
  11. public interface OrderQuashDao extends BaseMapper<ReqOrderQuash> {
  12. @Select("select start_time from yz_act_order where act_order_no = #{orderNo}")
  13. Date selectOrderStartTime(BigDecimal orderNo);
  14. @Select("select count(1) from yz_yp_zy_order where act_order_no = #{orderNo}")
  15. int selectYpOrder(BigDecimal orderNo);
  16. @Select("select count(1) from yz_zy_patient_fee where act_order_no = #{orderNo}")
  17. int selectZyPatientFee(BigDecimal orderNo);
  18. @Select("select count(1) from yz_zy_patient_fee where act_order_no = #{orderNo} and inpatient_no = #{patNo} and admiss_times = #{times}")
  19. int selectzyDetailCharge(BigDecimal orderNo,
  20. String patNo,
  21. Integer times);
  22. @Select("select rtrim(pat_no) as pat_no, " +
  23. " (select rtrim(name) " +
  24. " from view_zy_patient_all pat " +
  25. " where pat.inpatient_no = pat_no " +
  26. " and pat.admiss_times = times) as name, " +
  27. " times, " +
  28. " count(1) as count,state," +
  29. " ward_name = (select rtrim(name) from zd_unit_code where ward = code) " +
  30. "from req_order_quash,zy_actpatient b " +
  31. " ${ew.customSqlSegment} and pat_no = inpatient_no " +
  32. " and times = admiss_times " +
  33. "group by pat_no, times,state,ward ")
  34. List<ReturnReqOrderQuash> selectReqListGroupBy(@Param("ew") QueryWrapper<ReturnReqOrderQuash> queryWrapper);
  35. @Select("select a.act_order_no, " +
  36. " req_datetime, " +
  37. " req_id, " +
  38. " req_remark, " +
  39. " approver_id," +
  40. " approver_name = (select rtrim(name) from a_employee_mi where code = approver_id), " +
  41. " approver_datatime, " +
  42. " approver_remark, " +
  43. " state, " +
  44. " pat_no, " +
  45. " times, " +
  46. " b.order_name, " +
  47. " b.frequ_code, " +
  48. " enter_oper_name = (select rtrim(name) from a_employee_mi where code = enter_oper)," +
  49. " order_time, " +
  50. " start_time, " +
  51. " end_time," +
  52. " a.act_order_no " +
  53. "from req_order_quash a " +
  54. " left join view_xc_act_and_erase_order b on (a.act_order_no = b.act_order_no) " +
  55. "where pat_no = #{patNo} " +
  56. " and times = #{times} " +
  57. " and state = #{state} ")
  58. List<ReturnReqOrderQuash> selectReqListByPat(String patNo, String times, int state);
  59. @Update("update req_order_quash " +
  60. "set state = #{req.state}, " +
  61. " approver_id = #{req.approverId}, " +
  62. " approver_datatime = #{req.approverDatatime}, " +
  63. " approver_remark = #{req.approverRemark} " +
  64. "where act_order_no = #{req.actOrderNo}")
  65. void updateReqOrderQuash(@Param("req") ReqOrderQuash req);
  66. @Delete("delete yz_zy_patient_fee where act_order_no = #{orderNo} and charge_status ='3' ")
  67. void delPatientFee(@Param("orderNo") BigDecimal orderNo);
  68. @Delete("delete yz_yp_zy_order where act_order_no =#{orderNo} and status_flag ='1' ")
  69. void delYpZyOrder(@Param("orderNo") BigDecimal orderNo);
  70. @Insert("insert into yz_erase_order select * from yz_act_order a where a.act_order_no = #{orderNo} ")
  71. void eraseOrder(@Param("orderNo") BigDecimal orderNo);
  72. @Update("update yz_erase_order set modifier = enter_oper , " +
  73. "status_time = getdate()," +
  74. " print_order_change =case when isnull ( print_order_change , '' ) ='' then 'd' else '' end where act_order_no =#{orderNo} ")
  75. void upErase(@Param("orderNo") BigDecimal orderNo);
  76. @Delete("delete yz_act_order where act_order_no = #{orderNo}")
  77. void delYzOrder(@Param("orderNo") BigDecimal orderNo);
  78. @Update("update yz_act_order set end_time = getdate() where act_order_no = #{orderNo} and end_time is null")
  79. void stopOrder(@Param("orderNo") BigDecimal orderNo);
  80. }