eight
2024-11-11 ea1364fb67048883b2566d6320822a2d80560adf
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/queue/QueueMapper.java
@@ -73,7 +73,18 @@
            " </foreach> )" +
            " and TO_DAYS(book_date) = TO_DAYS(NOW()) " +
            "</script>")
    List<QueueDO> getCurPatGivenCheckItems(@Param("patId")String patId, @Param("checkTypeList")Integer[] arrCheckType);
    List<QueueDO> getCurPatGivenCheckTypes(@Param("patId")String patId, @Param("arrCheckType")Integer[] arrCheckType);
    @Select("<script>" +
            "SELECT * FROM lihu.queue " +
            "where pat_id = #{patId} and book_check_type in (" +
            " <foreach collection='arrCheckType' separator=',' item='checkType'>" +
            "   #{checkType} " +
            " </foreach> ) " +
            " and status = #{status} " +
            " and TO_DAYS(book_date) = TO_DAYS(NOW()) " +
            "</script>")
    List<QueueDO> getCurPatGivenCheckTypesAndStatus(@Param("patId")String patId, @Param("arrCheckType")Integer[] arrCheckType, @Param("status")Integer status);
    @Select("<script>" +
            "SELECT * FROM lihu.queue " +
@@ -149,7 +160,10 @@
            "</script>")
    List<QueueDO> getBedQueueByStatus(@Param("roomId")Long roomId, @Param("bedNo")String bedNo, @Param("statusList")List<Integer> statusList);
    @Update("update lihu.queue set status = #{newStatus} where seq_num = \n" +
    @Select("SELECT * from lihu.queue where room_id = #{roomId} and bed_no = #{bedNo} and status = #{curStatus} order by seq_num limit 1")
    QueueDO getFirstItemByBedAndStatus(@Param("roomId")Long roomId, @Param("bedNo")String bedNo, @Param("curStatus")Integer curStatus);
    @Update("update lihu.queue set status = #{newStatus} where status = #{curStatus} and 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 updateBedQueueStatus(@Param("roomId")Long roomId, @Param("bedNo")String bedNo, @Param("curStatus")Integer curStatus, @Param("newStatus")Integer newStatus);