JieShouHuiZhenDao.java 4.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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 org.apache.ibatis.annotations.Mapper;
  5. import org.apache.ibatis.annotations.Param;
  6. import org.apache.ibatis.annotations.Select;
  7. import org.apache.ibatis.annotations.Update;
  8. import thyyxxk.webserver.entity.casefrontsheet.JieShouHuiZhenPojo;
  9. import java.math.BigDecimal;
  10. import java.util.List;
  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. " admiss_date " +
  25. "from ysh_hz_record a with(nolock) " +
  26. " inner join zy_actpatient b with(nolock) on " +
  27. " (b.inpatient_no = a.inpatient_no)" +
  28. " ${ew.customSqlSegment} ")
  29. List<JieShouHuiZhenPojo> getHuiZhenData(@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. " req_dept1, " +
  46. " (select rtrim(name) name from zd_unit_code with (nolock) where code = req_dept1) req_dept1_name, " +
  47. " (select birth_date from a_patient_mi with (nolock) where a.inpatient_no = a_patient_mi.inpatient_no) birth_date, " +
  48. " (select rtrim(name) name from zd_unit_code with (nolock) where code = req_dept2) req_dept2, " +
  49. " req_times, " +
  50. " (select rtrim(name) name from a_employee_mi with (nolock) where input_id = code) req_doctor, " +
  51. " hz_type, " +
  52. " (select rtrim(name) name " +
  53. " from zd_unit_code with (nolock) " +
  54. " where code = dept_code) dept_code_name, " +
  55. " req_comment, " +
  56. " hz_zd, " +
  57. " hz_md, " +
  58. " hz_comment," +
  59. " hz_doctor2, " +
  60. " (select rtrim(name) name " +
  61. " from a_employee_mi with (nolock) " +
  62. " where code = hz_doctor2) hz_doctor2_name, " +
  63. " hz_doctor2, " +
  64. " hz_date," +
  65. " hz_level," +
  66. " hz_level_name = (select rtrim(name) from ysh_zd_hz_level where code = hz_level)," +
  67. " cast(act_order_no AS decimal) as act_order_no " +
  68. "from ysh_hz_record a with(nolock) inner join zy_actpatient b with(nolock) on " +
  69. "(b.inpatient_no = a.inpatient_no) where a.admiss_times = #{admissTimes} and a.inpatient_no = #{inpatientNo} and a.req_times = #{reqTimes}")
  70. JieShouHuiZhenPojo getHuanZheXinXi(@Param("admissTimes") Integer admissTimes,
  71. @Param("reqTimes") Integer reqTimes,
  72. @Param("inpatientNo") String inpatientNo);
  73. @Update("<script>" +
  74. "update ysh_hz_record " +
  75. "<trim prefix = 'set' suffixOverrides=','>" +
  76. "status_flag = #{statusFlag} , hz_comment = #{hzComment},hz_type = #{hzType}," +
  77. "<if test=\"statusFlag == 2 \">" +
  78. "hz_date = getdate() , hz_id = hz_doctor1 , hz_doctor2 = #{hzDoctor2} " +
  79. "</if> " +
  80. "</trim>" +
  81. "where admiss_times = #{admissTimes} and inpatient_no = #{inpatientNo} and req_times = #{reqTimes}" +
  82. "</script>")
  83. void wanChenHuiZhen(JieShouHuiZhenPojo param);
  84. @Update("update yz_act_order set order_code = #{code} where act_order_no = #{orderNo} ")
  85. void updateOrderConsultationCode(String code, BigDecimal orderNo);
  86. @Select("select name from zd_unit_code with(nolock) where code = #{deptCode}")
  87. String getDeptName(String deptCode);
  88. }