YzTemperatureDao.java 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. package thyyxxk.webserver.dao.his.datamodify;
  2. import org.apache.ibatis.annotations.Mapper;
  3. import org.apache.ibatis.annotations.Param;
  4. import org.apache.ibatis.annotations.Select;
  5. import org.apache.ibatis.annotations.Update;
  6. import thyyxxk.webserver.entity.datamodify.GetDropdownBox;
  7. import thyyxxk.webserver.entity.datamodify.YzTemperature;
  8. import java.util.List;
  9. /**
  10. * <p>
  11. * 描述
  12. * </p>
  13. *
  14. * @author xc
  15. * @date 2021-04-12 17:43
  16. */
  17. @Mapper
  18. public interface YzTemperatureDao {
  19. /**
  20. * 查询住院 护理记录单 这个很坑爹一条记录在别的地方会很多
  21. *
  22. * @param toStringRecDate 日期
  23. * @param toStringRecTime 时间
  24. * @param inpatientNo 住院号
  25. * @param admissTimes 住院次数
  26. * @return 返回指定的护理记录单
  27. */
  28. @Select("select patientName=(select rtrim(name) name from a_patient_mi where a_patient_mi.inpatient_no= yz_temperature.inpatient_no), " +
  29. "inpatient_no,rec_date,rec_time,temperature_1,pulse_1,breathe_1,pressure_1_am,pressure_1_pm," +
  30. "spo2,mind,skin,tubes_name,tubes_status,other_info,ward,admiss_times,detail_no, " +
  31. "userid=(select rtrim(name) name from a_employee_mi where code = userid) " +
  32. "from yz_temperature " +
  33. "where inpatient_no=#{inpatientNo} and admiss_times=#{admissTimes} and scd_flag='0' " +
  34. "and rec_date=#{toStringRecDate} and rec_time=#{toStringRecTime} " +
  35. "order by detail_no"
  36. )
  37. List<YzTemperature> queryDetails(@Param("toStringRecDate") String toStringRecDate,
  38. @Param("toStringRecTime") String toStringRecTime,
  39. @Param("inpatientNo") String inpatientNo,
  40. @Param("admissTimes") Integer admissTimes);
  41. /**
  42. * 获取病区
  43. *
  44. * @return 科室 code 和 名字
  45. */
  46. @Select("select code,rtrim(name) name from zy_ward_code")
  47. List<GetDropdownBox> getWard();
  48. /**
  49. * 更新重要的数据
  50. *
  51. * @param param 根据 住院号 住院次数 日期 时间
  52. * 现在能修改的字段有 体温:temperature1 脉搏:pulse1 呼吸:breathe1
  53. * 血压am: pressure1Am, 血压pm:pressure1Pm spo2:spo2 意识:mind 皮肤:skin
  54. * 管道名称:tubesName 管道状态:tubesStatus 病区:ward
  55. */
  56. @Update("<script>" +
  57. "update yz_temperature set " +
  58. "modify_userid=#{modifyUserid},modify_time=#{modifyTime} " +
  59. "<if test=\"temperature1!=null\">" +
  60. ",temperature_1=#{temperature1}" +
  61. "</if>" +
  62. "<if test=\"pulse1!=null\">" +
  63. ",pulse_1=#{pulse1}" +
  64. "</if>" +
  65. "<if test=\"breathe1!=null\">" +
  66. ",breathe_1=#{breathe1}" +
  67. "</if>" +
  68. "<if test=\"pressure1Am!=null\">" +
  69. ",pressure_1_am=#{pressure1Am}" +
  70. "</if>" +
  71. "<if test=\"pressure1Pm!=null\">" +
  72. ",pressure_1_pm=#{pressure1Pm}" +
  73. "</if>" +
  74. "<if test=\"spo2!=null\">" +
  75. ",spo2=#{spo2}" +
  76. "</if>" +
  77. "<if test=\"mind!=null\">" +
  78. ",mind=#{mind}" +
  79. "</if>" +
  80. "<if test=\"skin!=null\">" +
  81. ",skin=#{skin}" +
  82. "</if>" +
  83. "<if test=\"tubesName!=null\">" +
  84. ",tubes_name=#{tubesName}" +
  85. "</if>" +
  86. "<if test=\"tubesStatus!=null\">" +
  87. ",tubes_status=#{tubesStatus}" +
  88. "</if>" +
  89. "<if test=\"ward!=null\">" +
  90. ",ward=#{ward}" +
  91. "</if>" +
  92. "where " +
  93. "inpatient_no=#{inpatientNo} and admiss_times=#{admissTimes} and scd_flag='0' " +
  94. "and rec_date=#{toStringRecDate} and rec_time=#{toStringRecTime} and detail_no=#{detailNo}" +
  95. "</script>")
  96. void teperatureHead(YzTemperature param);
  97. /**
  98. * 更新 剩下的地方 主要是更新 病室和 修改人 修改时间
  99. *
  100. * @param param 更新条件以及更新的字段
  101. * @param detailNoList 下面这个是很坑爹的东西需要很多个这个才能锁定唯一的一条
  102. */
  103. @Update("<script>" +
  104. "update yz_temperature set modify_userid=#{param.modifyUserid},modify_time=#{param.modifyTime}" +
  105. "<if test=\"param.ward!=null\">" +
  106. ",ward=#{param.ward}" +
  107. "</if>" +
  108. "where " +
  109. "inpatient_no=#{param.inpatientNo} and admiss_times=#{param.admissTimes} and scd_flag='0' " +
  110. "and rec_date=#{param.toStringRecDate} and rec_time=#{param.toStringRecTime} and detail_no in " +
  111. "<foreach collection=\"detailNoList\" item=\"detailNo\" index=\"index\" open=\"(\" close=\")\" separator=\",\">" +
  112. "#{detailNo}" +
  113. "</foreach>" +
  114. "</script>")
  115. void teperatureBody(@Param("param") YzTemperature param,
  116. @Param("detailNoList") int[] detailNoList);
  117. }