eight
2024-08-22 2cb4f97e706193afbddf49e56fcf798e9dc8eb85
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/queue/queueMapper.java
@@ -96,8 +96,24 @@
    @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 book_timeslot, create_time limit 1) a)")
            "    (select id from lihu.queue where status = #{curStatus} 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);
    @Update("update lihu.queue set status = #{newStatus}, seq_num = #{seqNum}, passed = 1 " +
            " where id = " +
            "  (select a.id from \n" +
            "    (select id from lihu.queue where status = #{curStatus} and room_id = #{roomId} and room_name = #{roomName} and bed_no = #{bedNo} order by seq_num limit 1) a)")
    Integer procPassedReturnPatient(@Param("roomId")Long roomId, @Param("roomName")String roomName, @Param("bedNo")String bedNo,
                           @Param("seqNum")Integer seqNum, @Param("curStatus")Byte curStatus, @Param("newStatus")Byte newStatus);
    @Update("update lihu.queue set status = #{newStatus} " +
            " where pat_id = #{patId} amd status = #{curStatus} and room_id = #{roomId} and bed_no = #{bedNo}")
    Integer passedPatientReturn(@Param("roomId")Long roomId, @Param("bedNo")String bedNo, @Param("patId")String patId,
                                @Param("curStatus")Byte curStatus, @Param("newStatus")Byte newStatus);
    @Update("update lihu.queue set jumped = #{jumped} " +
            " where pat_id = #{patId} amd status = #{curStatus}")
    Integer queueJump(@Param("patId")String patId, @Param("curStatus")Byte curStatus, @Param("jumped")Byte jumped );
}