From 6f9f5260a6ccf2fb653707f54b44bc5f111d684a Mon Sep 17 00:00:00 2001
From: eight <641137800@qq.com>
Date: 星期五, 20 九月 2024 14:58:34 +0800
Subject: [PATCH] 移除 已不用的字段

---
 jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/room/RoomMapper.java |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/room/RoomMapper.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/room/RoomMapper.java
index 3863bb2..a99128c 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/room/RoomMapper.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/room/RoomMapper.java
@@ -31,6 +31,9 @@
                 .orderByDesc(RoomDO::getId));
     }
 
+    @Select("select * from lihu.clinic_room where ip = #{ip}")
+    List<RoomDO> queueByIp(@Param("ip") String ip);
+
     @Update("<script> " +
             "update lihu.clinic_room set status=#{newStatus}, doc_id=null, doc_name=null " +
             " where 1 = 1 " +
@@ -54,8 +57,8 @@
     RoomDO getRoom(@Param("roomId")Long roomId, @Param("bedNo")String bedNo, @Param("docId")Long docId);
 
     @Update("<script> " +
-            "update lihu.clinic_room set status=#{newStatus.status}, doc_id=null, doc_name=null " +
-            " where room_id=#{roomId} and bed_no=#{bedNo} and doc_id = null " +
+            "update lihu.clinic_room set status=#{newStatus.status} " +
+            " where room_id=#{roomId} and bed_no=#{bedNo} and isNull(doc_id) " +
             " and status in ( " +
             "  <foreach collection='curStatusList' separator=',' item='curStatus'>" +
             "   #{curStatus.status} " +
@@ -65,7 +68,7 @@
 
     @Update("<script> " +
             "update lihu.clinic_room set status=#{newStatus.status}, doc_id=null, doc_name=null " +
-            " where room_id=#{roomId} and bed_no=#{bedNo} and doc_id != null " +
+            " where room_id=#{roomId} and bed_no=#{bedNo} and isNull(doc_id) " +
             " and status in ( " +
             "  <foreach collection='curStatusList' separator=',' item='curStatus'>" +
             "   #{curStatus.status} " +
@@ -85,7 +88,7 @@
 
     @Update("<script> " +
             "update lihu.clinic_room set status=#{newStatus.status}, doc_id=#{docId}, doc_name=#{docName} " +
-            "where room_id=#{roomId} and bed_no=#{bedNo} " +
+            "where room_id=#{roomId} and bed_no=#{bedNo} and isNull(doc_id)" +
             "and status in ( " +
             " <foreach collection='curStatusList' separator=',' item='curStatus'>" +
             "  #{curStatus.status} " +

--
Gitblit v1.9.3