From c48f179be89343dc1620bfa147433bfe87d9bed3 Mon Sep 17 00:00:00 2001 From: eight <641137800@qq.com> Date: 星期一, 11 十一月 2024 17:29:50 +0800 Subject: [PATCH] 检查项-亲和性处理 --- jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/queue/QueueMapper.java | 18 ++++++++++++++++-- 1 files changed, 16 insertions(+), 2 deletions(-) diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/queue/QueueMapper.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/queue/QueueMapper.java index f1a3728..95b1f73 100644 --- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/queue/QueueMapper.java +++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/queue/QueueMapper.java @@ -73,7 +73,18 @@ " </foreach> )" + " and TO_DAYS(book_date) = TO_DAYS(NOW()) " + "</script>") - List<QueueDO> getCurPatGivenCheckItems(@Param("patId")String patId, @Param("checkTypeList")Integer[] arrCheckType); + List<QueueDO> getCurPatGivenCheckTypes(@Param("patId")String patId, @Param("checkTypeList")Integer[] arrCheckType); + + @Select("<script>" + + "SELECT * FROM lihu.queue " + + "where pat_id = #{patId} and book_check_type in (" + + " <foreach collection='arrCheckType' separator=',' item='checkType'>" + + " #{checkType} " + + " </foreach> ) " + + " and status = #{status} " + + " and TO_DAYS(book_date) = TO_DAYS(NOW()) " + + "</script>") + List<QueueDO> getCurPatGivenCheckTypesAndStatus(@Param("patId")String patId, @Param("checkTypeList")Integer[] arrCheckType, @Param("status")Integer status); @Select("<script>" + "SELECT * FROM lihu.queue " + @@ -149,7 +160,10 @@ "</script>") List<QueueDO> getBedQueueByStatus(@Param("roomId")Long roomId, @Param("bedNo")String bedNo, @Param("statusList")List<Integer> statusList); - @Update("update lihu.queue set status = #{newStatus} where seq_num = \n" + + @Select("SELECT * from lihu.queue where room_id = #{roomId} and bed_no = #{bedNo} and status = #{curStatus} order by seq_num limit 1") + QueueDO getFirstItemByBedAndStatus(@Param("roomId")Long roomId, @Param("bedNo")String bedNo, @Param("curStatus")Integer curStatus); + + @Update("update lihu.queue set status = #{newStatus} where status = #{curStatus} and seq_num = \n" + "(select a.min_seq_num from \n" + " (select min(seq_num) as min_seq_num from lihu.queue where room_id = #{roomId} and bed_no = #{bedNo} and status = #{curStatus}) a )") Integer updateBedQueueStatus(@Param("roomId")Long roomId, @Param("bedNo")String bedNo, @Param("curStatus")Integer curStatus, @Param("newStatus")Integer newStatus); -- Gitblit v1.9.3