From f14d9737da8bbe94e82427f2d0e727fd15c88f2e Mon Sep 17 00:00:00 2001 From: eight <641137800@qq.com> Date: 星期一, 23 九月 2024 11:44:35 +0800 Subject: [PATCH] update --- jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/room/RoomMapper.java | 70 +++++++++++++++++++++++++---------- 1 files changed, 50 insertions(+), 20 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 f62617b..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 @@ -3,17 +3,17 @@ import java.util.*; import cn.lihu.jh.framework.common.pojo.PageResult; -import cn.lihu.jh.framework.mybatis.core.query.LambdaQueryWrapperX; import cn.lihu.jh.framework.mybatis.core.mapper.BaseMapperX; - -import cn.lihu.jh.module.ecg.controller.admin.room.vo.RoomPageReqVO; +import cn.lihu.jh.framework.mybatis.core.query.LambdaQueryWrapperX; import cn.lihu.jh.module.ecg.dal.dataobject.room.RoomDO; -import cn.lihu.jh.module.ecg.dal.dataobject.room.RoomStatisticsDO; -import cn.lihu.jh.module.ecg.enums.BedStatusEnum; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Update; + +import cn.lihu.jh.module.ecg.controller.admin.room.vo.RoomPageReqVO; +import cn.lihu.jh.module.ecg.dal.dataobject.room.RoomStatisticsDO; +import cn.lihu.jh.module.ecg.enums.BedStatusEnum; /** * 璇婂鍜岃瘖鐤楀簥 Mapper @@ -31,34 +31,64 @@ .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 " + + "</script>") + Integer resetRoom(@Param("newStatus") Integer newStatus); + @Select({ "SELECT room_id, room_name, count(1) as bed_num FROM lihu.clinic_room group by room_id;" }) List<RoomStatisticsDO> roomStatistic(); - @Select({ "SELECT id, room_id, room_name, bed_no, status, doc_id, doc_name FROM lihu.clinic_room where status >= 10;" }) - List<RoomDO> simpleRoomList(); - - @Update("<script> " + - "update lihu.clinic_room set status=#{newStatus.status} where room_id=#{roomId} and bed_no=#{bedNo} " + - "and status in ( " + - " <foreach collection='curStatusList' separator=',' item='curStatus'>" + - " #{curStatus.status} " + - " </foreach> );" + + @Select("<script> " + + "SELECT id, room_id, room_name, bed_no, status, doc_id, doc_name FROM lihu.clinic_room " + + "where status in ( " + + " <foreach collection='curStatusList' separator=',' item='curStatus'>" + + " #{curStatus.status} " + + " </foreach> )" + + " and deleted = 0;" + "</script>") - Integer setBedStatus(@Param("roomId")Long roomId, @Param("bedNo")String bedNo, @Param("newStatus") BedStatusEnum newStatus, @Param("curStatusList") List<BedStatusEnum> curStatusList); + List<RoomDO> simpleRoomList(@Param("curStatusList") List<BedStatusEnum> curStatusList); + + @Select("SELECT * FROM lihu.clinic_room where room_id=#{roomId} and bed_no=#{bedNo} and doc_id=#{docId}") + RoomDO getRoom(@Param("roomId")Long roomId, @Param("bedNo")String bedNo, @Param("docId")Long docId); @Update("<script> " + "update lihu.clinic_room set status=#{newStatus.status} " + - "where room_id=#{roomId} and bed_no=#{bedNo} and doc_id=#{docId} and doc_name=#{docName}" + + " where room_id=#{roomId} and bed_no=#{bedNo} and isNull(doc_id) " + + " and status in ( " + + " <foreach collection='curStatusList' separator=',' item='curStatus'>" + + " #{curStatus.status} " + + " </foreach> );" + + "</script>") + Integer setBedOpeningOpening(@Param("roomId")Long roomId, @Param("bedNo")String bedNo, @Param("newStatus") BedStatusEnum newStatus, @Param("curStatusList") List<BedStatusEnum> curStatusList); + + @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 isNull(doc_id) " + + " and status in ( " + + " <foreach collection='curStatusList' separator=',' item='curStatus'>" + + " #{curStatus.status} " + + " </foreach> );" + + "</script>") + Integer setBedOpeningClosed(@Param("roomId")Long roomId, @Param("bedNo")String bedNo, @Param("newStatus") BedStatusEnum newStatus, @Param("curStatusList") List<BedStatusEnum> curStatusList); + + @Update("<script> " + + "update lihu.clinic_room set status=#{newStatus.status} " + + "where room_id=#{roomId} and bed_no=#{bedNo} and doc_id=#{docId} " + "and status in ( " + " <foreach collection='curStatusList' separator=',' item='curStatus'>" + " #{curStatus.status} " + " </foreach> );" + "</script>") - Integer setBedDoctorPause(@Param("roomId")Long roomId, @Param("bedNo")String bedNo, @Param("docId")Long docId, @Param("docName")String docName, @Param("newStatus") BedStatusEnum newStatus, @Param("curStatusList") List<BedStatusEnum> curStatusList); + Integer setBedDoctorStatus(@Param("roomId")Long roomId, @Param("bedNo")String bedNo, @Param("docId")Long docId, @Param("newStatus") BedStatusEnum newStatus, @Param("curStatusList") List<BedStatusEnum> curStatusList); @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} " + @@ -68,11 +98,11 @@ @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=#{docId} and doc_name=#{docName}" + + "where room_id=#{roomId} and bed_no=#{bedNo} and doc_id=#{docId} " + "and status in ( " + " <foreach collection='curStatusList' separator=',' item='curStatus'>" + " #{curStatus.status} " + " </foreach> );" + "</script>") - Integer setBedDoctorOff(@Param("roomId")Long roomId, @Param("bedNo")String bedNo, @Param("docId")Long docId, @Param("docName")String docName, @Param("newStatus") BedStatusEnum newStatus, @Param("curStatusList") List<BedStatusEnum> curStatusList); + Integer setBedDoctorOff(@Param("roomId")Long roomId, @Param("bedNo")String bedNo, @Param("docId")Long docId, @Param("newStatus") BedStatusEnum newStatus, @Param("curStatusList") List<BedStatusEnum> curStatusList); } -- Gitblit v1.9.3