From e3eebc41e9b1e5c92fc6212fe51dcce8da366306 Mon Sep 17 00:00:00 2001 From: xiangpei <xiangpei@timesnew.cn> Date: 星期二, 10 九月 2024 15:26:06 +0800 Subject: [PATCH] 监测点位在线完善 --- 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 7c7aef2..9bb7416 100644 --- a/ycl-server/src/main/resources/mapper/zgyw/TMonitorMapper.xml +++ b/ycl-server/src/main/resources/mapper/zgyw/TMonitorMapper.xml @@ -583,16 +583,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