From 0bea516b3063bad9093aeb3383b16cc9706bd6db Mon Sep 17 00:00:00 2001 From: eight <641137800@qq.com> Date: 星期四, 05 九月 2024 16:19:18 +0800 Subject: [PATCH] update --- jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/queue/queueMapper.java | 54 +++++++++++++++++++++++++++++++++++++++--------------- 1 files changed, 39 insertions(+), 15 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 64fed4b..0bbaaaf 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 @@ -40,6 +40,37 @@ Integer getMaxSeqNum(); @Select("<script>" + + "SELECT * FROM lihu.queue " + + "where room_id = #{roomId} and status in (" + + " <foreach collection='statusList' separator=',' item='status'>" + + " #{status} " + + " </foreach> )" + + " order by seq_num" + + "</script>") + List<QueueDO> getRoomQueueByStatus(@Param("roomId")Long roomId, @Param("statusList")List<Byte> statusList); + + @Select("<script>" + + "SELECT * FROM lihu.queue " + + "where status in (" + + " <foreach collection='statusList' separator=',' item='status'>" + + " #{status} " + + " </foreach> )" + + " order by seq_num" + + "</script>") + List<QueueDO> getQueueByStatus( @Param("statusList")List<Byte> statusList); + + @Select("<script>" + + "SELECT * FROM lihu.queue " + + "where id >= #{from} and status in (" + + " <foreach collection='statusList' separator=',' item='status'>" + + " #{status} " + + " </foreach> )" + + " limit #{size} " + + " order by id" + + "</script>") + List<QueueDO> getPartialQueueByStatus( @Param("statusList")List<Byte> statusList, @Param("from") Integer from, @Param("size") Integer size); + + @Select("<script>" + "SELECT count(1) as total_in_status FROM lihu.queue where status in (" + " <foreach collection='statusList' separator=',' item='status'>" + " #{status} " + @@ -63,21 +94,6 @@ "</script>") List<BedQueueStatisticDO> bedQueueStatistic(@Param("roomId")Long roomId, @Param("bedNo")String bedNo); - @Update("update lihu.queue set status = #{newStatus} where 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 updateQueueStatus(@Param("roomId")Long roomId, @Param("bedNo")String bedNo, @Param("curStatus")Byte curStatus, @Param("newStatus")Byte newStatus); - - @Select("<script>" + - "SELECT * FROM lihu.queue " + - "where room_id = #{roomId} and status in (" + - " <foreach collection='statusList' separator=',' item='status'>" + - " #{status} " + - " </foreach> )" + - " order by seq_num" + - "</script>") - List<QueueDO> getRoomQueueByStatus(@Param("roomId")Long roomId, @Param("statusList")List<Byte> statusList); - @Select("<script>" + "SELECT * FROM lihu.queue " + "where room_id = #{roomId} and bed_no = #{bedNo} and status in (" + @@ -88,6 +104,14 @@ "</script>") List<QueueDO> getDoctorQueueByStatus(@Param("roomId")Long roomId, @Param("bedNo")String bedNo, @Param("statusList")List<Byte> statusList); + @Update( "update lihu.queue set called = 1 where pat_id = #{patId}" ) + Integer markCalled(@Param("patId")String patId); + + @Update("update lihu.queue set status = #{newStatus} where 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 updateQueueStatus(@Param("roomId")Long roomId, @Param("bedNo")String bedNo, @Param("curStatus")Byte curStatus, @Param("newStatus")Byte newStatus); + @Update("update lihu.queue set status = #{newStatus}, room_id = #{roomId}, room_name = #{roomName}, \n" + " bed_no = #{bedNo}, seq_num = #{seqNum} where id = \n" + " (select a.id from \n" + -- Gitblit v1.9.3