From bea63f67e75ea6c38d946c2ee463260fcf815f87 Mon Sep 17 00:00:00 2001 From: Fang <costa11@qq.com> Date: 星期一, 07 三月 2022 14:21:29 +0800 Subject: [PATCH] Merge branch '648540858:wvp-28181-2.0' into wvp-28181-2.0 --- src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java | 37 +++++++++++++++++++++++++++++++++++++ 1 files changed, 37 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java b/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java index d4cace4..2431699 100644 --- a/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java @@ -135,6 +135,32 @@ "'${item.ipAddress}', ${item.port}, '${item.password}', ${item.PTZType}, ${item.status}, " + "'${item.streamId}', ${item.longitude}, ${item.latitude},'${item.createTime}', '${item.updateTime}')" + "</foreach> " + + "ON DUPLICATE KEY UPDATE " + + "updateTime=VALUES(updateTime), " + + "name=VALUES(name), " + + "manufacture=VALUES(manufacture), " + + "model=VALUES(model), " + + "owner=VALUES(owner), " + + "civilCode=VALUES(civilCode), " + + "block=VALUES(block), " + + "subCount=VALUES(subCount), " + + "address=VALUES(address), " + + "parental=VALUES(parental), " + + "parentId=VALUES(parentId), " + + "safetyWay=VALUES(safetyWay), " + + "registerWay=VALUES(registerWay), " + + "certNum=VALUES(certNum), " + + "certifiable=VALUES(certifiable), " + + "errCode=VALUES(errCode), " + + "secrecy=VALUES(secrecy), " + + "ipAddress=VALUES(ipAddress), " + + "port=VALUES(port), " + + "password=VALUES(password), " + + "PTZType=VALUES(PTZType), " + + "status=VALUES(status), " + + "streamId=VALUES(streamId), " + + "longitude=VALUES(longitude), " + + "latitude=VALUES(latitude)" + "</script>") int batchAdd(List<DeviceChannel> addChannels); @@ -211,4 +237,15 @@ " from device_channel\n" + " where deviceId = #{deviceId}") List<DeviceChannelTree> tree(String deviceId); + + @Delete(value = {" <script>" + + "DELETE " + + "from " + + "device_channel " + + "WHERE " + + "deviceId = #{deviceId} " + + " AND channelId NOT IN " + + "<foreach collection='channels' item='item' open='(' separator=',' close=')' > #{item.channelId}</foreach>" + + " </script>"}) + int cleanChannelsNotInList(String deviceId, List<DeviceChannel> channels); } -- Gitblit v1.8.0