JieShouHuiZhenDao.java 4.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. package thyyxxk.webserver.dao.his.casefrontsheet;
  2. import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
  3. import com.baomidou.mybatisplus.core.toolkit.Constants;
  4. import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
  5. import org.apache.ibatis.annotations.Mapper;
  6. import org.apache.ibatis.annotations.Param;
  7. import org.apache.ibatis.annotations.Select;
  8. import org.apache.ibatis.annotations.Update;
  9. import thyyxxk.webserver.entity.casefrontsheet.JieShouHuiZhenPojo;
  10. import java.math.BigDecimal;
  11. /**
  12. * <p>
  13. * 描述: 接收会诊申请
  14. * </p>
  15. *
  16. * @author xc
  17. * @date 2021-07-27 10:29
  18. */
  19. @Mapper
  20. public interface JieShouHuiZhenDao {
  21. @Select("select bed_no,name,a.admiss_times,a.inpatient_no,req_times,hz_type," +
  22. "dept_code_name = (select rtrim(name) from zd_unit_code with (nolock) where code = dept_code), " +
  23. "req_dept1_name = (select rtrim(name) from zd_unit_code with (nolock) where code = req_dept1) " +
  24. "from ysh_hz_record a with(nolock) " +
  25. " inner join zy_actpatient b with(nolock) on " +
  26. " (b.inpatient_no = a.inpatient_no)" +
  27. " ${ew.customSqlSegment} ")
  28. Page<JieShouHuiZhenPojo> getHuiZhenData(Page<JieShouHuiZhenPojo> page,
  29. @Param(Constants.WRAPPER) QueryWrapper<?> queryWrapper);
  30. /**
  31. * 根据职称获取医嘱的编码
  32. *
  33. * @param code 职称
  34. * @return 医嘱码
  35. */
  36. @Select("SELECT order_code FROM zd_emp_title where code = #{code} ")
  37. String getOrderCodeByEmpTit(String code);
  38. @Select("select a.inpatient_no, " +
  39. " b.admiss_date, " +
  40. " rtrim(name) name, " +
  41. " bed_no, " +
  42. " a.admiss_times, " +
  43. " sex, " +
  44. " req_date, " +
  45. " (select rtrim(name) name from zd_unit_code with (nolock) where code = req_dept1) req_dept1, " +
  46. " (select birth_date from a_patient_mi with (nolock) where a.inpatient_no = a_patient_mi.inpatient_no) birth_date, " +
  47. " (select rtrim(name) name from zd_unit_code with (nolock) where code = req_dept2) req_dept2, " +
  48. " req_times, " +
  49. " (select rtrim(name) name from a_employee_mi with (nolock) where input_id = code) req_doctor, " +
  50. " hz_type, " +
  51. " (select rtrim(name) name " +
  52. " from zd_unit_code with (nolock) " +
  53. " where code = dept_code) dept_code_name, " +
  54. " req_comment, " +
  55. " hz_zd, " +
  56. " hz_md, " +
  57. " hz_comment, " +
  58. " (select rtrim(name) name " +
  59. " from a_employee_mi with (nolock) " +
  60. " where code = hz_doctor2) hz_doctor2_name, " +
  61. " hz_doctor2, " +
  62. " hz_date," +
  63. " cast(act_order_no AS decimal) as act_order_no " +
  64. "from ysh_hz_record a with(nolock) inner join zy_actpatient b with(nolock) on " +
  65. "(b.inpatient_no = a.inpatient_no) where a.admiss_times = #{admissTimes} and a.inpatient_no = #{inpatientNo} and a.req_times = #{reqTimes}")
  66. JieShouHuiZhenPojo getHuanZheXinXi(@Param("admissTimes") Integer admissTimes,
  67. @Param("reqTimes") Integer reqTimes,
  68. @Param("inpatientNo") String inpatientNo);
  69. @Update("<script>" +
  70. "update ysh_hz_record " +
  71. "<trim prefix = 'set' suffixOverrides=','>" +
  72. "status_flag = #{statusFlag} , hz_comment = #{hzComment},hz_type = #{hzType}," +
  73. "<if test=\"statusFlag == 2 \">" +
  74. "hz_date = getdate() , hz_id = hz_doctor1 , hz_doctor2 = #{hzDoctor2} " +
  75. "</if> " +
  76. "</trim>" +
  77. "where admiss_times = #{admissTimes} and inpatient_no = #{inpatientNo} and req_times = #{reqTimes}" +
  78. "</script>")
  79. void wanChenHuiZhen(JieShouHuiZhenPojo param);
  80. @Update("update yz_act_order set order_code = #{code} where act_order_no = #{orderNo} ")
  81. void updateOrderConsultationCode(String code, BigDecimal orderNo);
  82. @Select("select name from zd_unit_code with(nolock) where code = #{deptCode}")
  83. String getDeptName(String deptCode);
  84. }