From be69c3d9d175027cb8d43f60a7744dc6e8c52433 Mon Sep 17 00:00:00 2001
From: eight <641137800@qq.com>
Date: 星期二, 20 八月 2024 15:01:32 +0800
Subject: [PATCH] update

---
 jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/queue/queueMapper.java |   23 ++++++++++++++++++++++-
 1 files changed, 22 insertions(+), 1 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 6e8745d..1e4e097 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
@@ -10,6 +10,7 @@
 import cn.lihu.jh.module.ecg.controller.admin.queue.vo.*;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
+import org.apache.ibatis.annotations.Update;
 
 import java.util.List;
 
@@ -49,4 +50,24 @@
             " group by room_id, bed_no; "
             +"</script>")
     List<QueueStatisticDO> queueStatistic(@Param("statusList")List<Byte> statusList);
-}
\ No newline at end of file
+
+    //@Update("update lihu.queue set status = #{newStatus} where pat_id = #{patId} ans status = #{curStatus} ")
+
+    @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("select * from lihu.queue where status = #{status} order by book_timeslot, create_time limit 1")
+    QueueDO getFirstInQueueByStatus(Byte status);
+
+    @Select("<script>" +
+            "SELECT * FROM lihu.queue " +
+            "where room_id = #{roomId} and bed_no = #{bedNo} and status in (" +
+            " <foreach collection='statusList' separator=',' item='status'>" +
+            " #{status} " +
+            " </foreach> )" +
+            " order by status desc" +
+            "</script>")
+    List<QueueDO> getDoctorQueueByStatus(@Param("roomId")Long roomId, @Param("bedNo")String bedNo, @Param("statusList")List<Byte> statusList);
+}

--
Gitblit v1.9.3