From a21055c644b56fc44b56ed7e2bfe77a82e1b739d Mon Sep 17 00:00:00 2001
From: eight <641137800@qq.com>
Date: 星期四, 10 十月 2024 18:25:23 +0800
Subject: [PATCH] 检查类型 从 字典 换成 DB 表
---
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/queue/queueMapper.java | 64 ++++++++++++++++++++++---------
1 files changed, 45 insertions(+), 19 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..3daeeed 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
@@ -39,6 +39,40 @@
@Select("SELECT max(seq_num) FROM lihu.queue")
Integer getMaxSeqNum();
+ @Select("SELECT * FROM lihu.queue where pat_id = #{patId}")
+ QueueDO getQueueByPatId(@Param("patId")String patId);
+
+ @Select("<script>" +
+ "SELECT * FROM lihu.queue " +
+ "where room_id = #{roomId} and status in (" +
+ " <foreach collection='statusList' separator=',' item='status'>" +
+ " #{status} " +
+ " </foreach> )" +
+ " order by status desc, 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 status desc, 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'>" +
@@ -63,37 +97,28 @@
"</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 (" +
" <foreach collection='statusList' separator=',' item='status'>" +
" #{status} " +
" </foreach> )" +
- " order by seq_num" +
+ " order by status desc, seq_num" +
"</script>")
List<QueueDO> getDoctorQueueByStatus(@Param("roomId")Long roomId, @Param("bedNo")String bedNo, @Param("statusList")List<Byte> statusList);
+
+ @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" +
- " (select id from lihu.queue where status = #{curStatus} order by jump_flag desc, book_timeslot, create_time limit 1) a)")
+ " (select id from lihu.queue where status = #{curStatus} and book_check_type= #{checkType} order by jump_flag desc, book_timeslot, create_time limit 1) a)")
Integer preemptPatient(@Param("roomId")Long roomId, @Param("roomName")String roomName, @Param("bedNo")String bedNo,
- @Param("seqNum")Integer seqNum, @Param("curStatus")Byte curStatus, @Param("newStatus")Byte newStatus);
+ @Param("seqNum")Integer seqNum, @Param("curStatus")Byte curStatus, @Param("newStatus")Byte newStatus,
+ @Param("checkType")Integer checkType);
@Update("update lihu.queue set status = #{newStatus}, seq_num = #{seqNum}, passed = 1 " +
" where id = " +
@@ -111,7 +136,8 @@
" where status = #{curStatus} and pat_id = #{patId}")
Integer queueJump(@Param("patId")String patId, @Param("curStatus")Byte curStatus, @Param("jumped")Byte jumped );
+ //@Update("TRUNCATE TABLE lihu.queue")
@Delete("delete from lihu.queue where TO_DAYS(book_date) != TO_DAYS(NOW())")
- Integer clearQueue();
+ void clearQueue();
}
--
Gitblit v1.9.3