BloodSugarQueryDao.java 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. package thyyxxk.webserver.dao.his.examinations;
  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.examinations.BloodSugar.BgNursingTestSync;
  7. import thyyxxk.webserver.entity.inpatient.patient.Patient;
  8. import java.util.List;
  9. @Mapper
  10. public interface BloodSugarQueryDao {
  11. @Select("select bed_no, " +
  12. " rtrim(a.name) name, " +
  13. " birth_date, " +
  14. " a.inpatient_no, " +
  15. " admiss_date " +
  16. "from ${tableName} a, " +
  17. " a_patient_mi b " +
  18. "where a.inpatient_no = b.inpatient_no " +
  19. " and a.inpatient_no = #{patNo} " +
  20. "and a.admiss_times = #{times}")
  21. Patient getPatientInfo(@Param("tableName") String tableName,
  22. @Param("patNo") String patNo,
  23. @Param("times") Integer times);
  24. @Select("select id,\n" +
  25. " inpatient_no,\n" +
  26. " admiss_times,\n" +
  27. " nurse_id,\n" +
  28. " nurse_id_name = (select rtrim(name) from a_employee_mi where code = nurse_id)," +
  29. " test_time,\n" +
  30. " bed_no,\n" +
  31. " timecode_id,\n" +
  32. " timecode_name,\n" +
  33. " test_result,\n" +
  34. " result_unit\n" +
  35. "from bg_nursing_test_sync\n" +
  36. "where inpatient_no = #{patNo}" +
  37. " and admiss_times = #{times}" +
  38. " and timecode_name = N'随机血糖'")
  39. List<BgNursingTestSync> getPatientLoodSugarRandom(@Param("patNo") String patNo,
  40. @Param("times") Integer times);
  41. @Select("select id,\n" +
  42. " inpatient_no,\n" +
  43. " admiss_times,\n" +
  44. " nurse_id,\n" +
  45. " nurse_id_name = (select rtrim(name) from a_employee_mi where code = nurse_id)," +
  46. " test_time,\n" +
  47. " bed_no,\n" +
  48. " timecode_id,\n" +
  49. " timecode_name,\n" +
  50. " test_result,\n" +
  51. " result_unit\n" +
  52. "from bg_nursing_test_sync\n" +
  53. "where inpatient_no = #{patNo}" +
  54. " and admiss_times = #{times}")
  55. List<BgNursingTestSync> getPatientLoodSugar(@Param("patNo") String patNo,
  56. @Param("times") Integer times);
  57. @Select("select admiss_times " +
  58. "from zy_actpatient " +
  59. "where inpatient_no = #{patNo} ")
  60. Integer getPatientTimes(@Param("patNo") String patNo);
  61. @Update("update bg_nursing_test_sync\n" +
  62. "set nurse_id = #{nurseId},\n" +
  63. " test_time = #{testTime},\n" +
  64. " test_result = #{testResult} \n" +
  65. "where id = #{id}")
  66. void modifyPatientBloodGlucoseInfo(BgNursingTestSync param);
  67. }