| | |
| | | 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 |
| | |
| | | .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); |
| | | |
| | | @Select("SELECT * FROM lihu.clinic_room where doc_id=#{docId} limit 1") |
| | | RoomDO getRoomByDocId(@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} " + |
| | |
| | | Integer setBedDoctorOn(@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); |
| | | |
| | | @Update("<script> " + |
| | | "update lihu.clinic_room set status=#{newStatus.status}, doc_id=null, doc_name='' " + |
| | | "where room_id=#{roomId} and bed_no=#{bedNo} and doc_id=#{docId} and doc_name=#{docName}" + |
| | | "and status=( " + |
| | | "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 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); |
| | | } |