From 68ff33beff11310e830b0615b5a81f83fad0f683 Mon Sep 17 00:00:00 2001
From: yxh <172933527@qq.com>
Date: 星期日, 08 十一月 2026 23:33:14 +0800
Subject: [PATCH] ai优化
---
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/call/CallMapper.java | 31 ++++++++++++++++++++++++++-----
1 files changed, 26 insertions(+), 5 deletions(-)
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/call/CallMapper.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/call/CallMapper.java
index 952896d..a5e3ee7 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/call/CallMapper.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/call/CallMapper.java
@@ -6,10 +6,8 @@
import cn.lihu.jh.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.lihu.jh.framework.mybatis.core.mapper.BaseMapperX;
import cn.lihu.jh.module.ecg.dal.dataobject.call.CallDO;
-import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.*;
import cn.lihu.jh.module.ecg.controller.admin.call.vo.*;
-import org.apache.ibatis.annotations.Param;
-import org.apache.ibatis.annotations.Select;
/**
* 鍙彿 Mapper
@@ -39,6 +37,29 @@
@Select("select * from lihu.call_patient where pat_id = #{patId} order by id desc limit 1")
CallDO getLatestPatientCall(@Param("patId") String patId);
- @Select("select * from lihu.call_patient where called = 0 order by id limit 1")
- CallDO getNextCall();
+ /**
+ * 鍚勬偅鑰�**鏈�杩戜竴娆″彨鍙疯褰�**鐨� id锛坘ey=pat_id锛寁alue=鏈�鏂� 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( );
+
+ // call_type 1 璇婇棿灞�
+ @Select("select * from lihu.call_patient where called = 0 and call_type = 1 and room_id = #{roomId} order by id limit 1")
+ CallDO getNextInstallCall(@Param("roomId") Long roomId);
+
+ //@Update("TRUNCATE TABLE lihu.call_patient") 淇濇寔褰撳ぉ鏁版嵁
+ @Delete("delete from lihu.call_patient where TO_DAYS(book_date) != TO_DAYS(NOW())")
+ void clearCall();
}
--
Gitblit v1.9.3