yxh
6 天以前 68ff33beff11310e830b0615b5a81f83fad0f683
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/call/CallMapper.java
@@ -37,6 +37,20 @@
    @Select("select * from lihu.call_patient where pat_id = #{patId} order by id desc limit 1")
    CallDO getLatestPatientCall(@Param("patId") String patId);
    /**
     * 各患者**最近一次叫号记录**的 id(key=pat_id,value=最新 id)。
     *
     * <p>【重叫(本需求)】大屏/诊间屏靠"数据变化"触发播报,重叫本身不会改变队列数据,
     * 因此下发这个 callId:医生每点一次重叫都会**新增一条叫号记录**(见 {@code CallService#callAgain}),
     * callId 随之变大 → 屏幕据此重新播报。
     *
     * <p>用 create_time 限定近 2 天(call_patient 会被每日清理,见 clearCall),
     * 避免全表 group by;不依赖 book_date(可能为空)。
     */
    @Select("select pat_id as patId, max(id) as callId from lihu.call_patient " +
            "where create_time >= date_sub(now(), interval 2 day) group by pat_id")
    List<Map<String, Object>> selectLatestCallIds();
    // call_type 0  大屏
    @Select("select * from lihu.call_patient where called = 0 and call_type = 0 order by id limit 1")
    CallDO getNextCall( );