From 2a2885f45160b4048a27e75d5be03ba9232c7363 Mon Sep 17 00:00:00 2001 From: fuliqi <fuliqi@qq.com> Date: 星期二, 10 九月 2024 17:34:42 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- ycl-server/src/main/resources/mapper/zgyw/TMonitorMapper.xml | 16 +++++++++++----- 1 files changed, 11 insertions(+), 5 deletions(-) diff --git a/ycl-server/src/main/resources/mapper/zgyw/TMonitorMapper.xml b/ycl-server/src/main/resources/mapper/zgyw/TMonitorMapper.xml index 3ab225e..5bfc1f0 100644 --- a/ycl-server/src/main/resources/mapper/zgyw/TMonitorMapper.xml +++ b/ycl-server/src/main/resources/mapper/zgyw/TMonitorMapper.xml @@ -594,16 +594,22 @@ serial_number in <foreach collection="gbList" open="(" separator="," close=")" item="no">#{no}</foreach> </select> - <select id="getDistinctIP" resultType="string"> + <select id="getDistinctIP" resultType="com.ycl.platform.domain.entity.TMonitor"> SELECT - DISTINCT ip + DISTINCT ip, serial_number FROM t_monitor </select> <update id="updateOnline"> - update t_yw_ponit set online = #{online.online}, update_time = #{online.updateTime} WHERE EXISTS ( - SELECT 1 FROM t_monitor WHERE ip = #{online.ip} AND t_monitor.serial_number = t_yw_point.serial_number - ); + <foreach collection="onlineList" item="online" separator=";"> + UPDATE + t_yw_point + SET + online = #{online.online}, + update_time = #{online.updateTime} + WHERE + EXISTS (SELECT 1 FROM t_monitor WHERE ip = #{online.ip} AND t_monitor.serial_number = t_yw_point.serial_number) + </foreach> </update> </mapper> -- Gitblit v1.8.0