From ba8633e99a27b90c55b47e8f7d6225f1f0efc6bb Mon Sep 17 00:00:00 2001 From: 648540858 <456panlinlin> Date: 星期五, 08 四月 2022 18:09:23 +0800 Subject: [PATCH] 优化地图-添加地图页面以及设备树 --- src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java | 28 +++++++++++++++++++++++++++- 1 files changed, 27 insertions(+), 1 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 5e6ffed..42e46e1 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 @@ -1,6 +1,7 @@ package com.genersoft.iot.vmp.storager.dao; import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel; +import com.genersoft.iot.vmp.gb28181.bean.DeviceChannelInPlatform; import com.genersoft.iot.vmp.vmanager.bean.DeviceChannelTree; import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.ChannelReduce; import org.apache.ibatis.annotations.*; @@ -105,12 +106,25 @@ " <if test='online == true' > AND dc.status=1</if> " + " <if test='online == false' > AND dc.status=0</if> " + " <if test='hasSubChannel!= null and hasSubChannel == true' > AND dc.subCount > 0</if> " + - " <if test='hasSubChannel!= null and hasSubChannel == false' > AND dc.subCount == 0</if> " + + " <if test='hasSubChannel!= null and hasSubChannel == false' > AND dc.subCount = 0</if> " + " <if test='catalogId == null ' > AND dc.id not in (select deviceChannelId from platform_gb_channel where platformId=#{platformId} ) </if> " + " <if test='catalogId != null ' > AND pgc.platformId = #{platformId} and pgc.catalogId=#{catalogId} </if> " + " ORDER BY dc.deviceId, dc.channelId ASC" + " </script>"}) List<ChannelReduce> queryChannelListInAll(String query, Boolean online, Boolean hasSubChannel, String platformId, String catalogId); + + @Select(value = {" <script>" + + "SELECT " + + " dc.*,\n" + + " pgc.platformId as platformId,\n" + + " pgc.catalogId as catalogId " + + " FROM device_channel dc " + + " LEFT JOIN platform_gb_channel pgc on pgc.deviceChannelId = dc.id " + + " WHERE pgc.platformId = #{platformId} " + + " ORDER BY dc.deviceId, dc.channelId ASC" + + " </script>"}) + List<DeviceChannelInPlatform> queryChannelByPlatformId(String platformId); + @Select("SELECT * FROM device_channel WHERE channelId=#{channelId}") List<DeviceChannel> queryChannelByChannelId( String channelId); @@ -247,4 +261,16 @@ "<foreach collection='channels' item='item' open='(' separator=',' close=')' > #{item.channelId}</foreach>" + " </script>"}) int cleanChannelsNotInList(String deviceId, List<DeviceChannel> channels); + + @Update(" update device_channel" + + " set subCount = (select *" + + " from (select count(0)" + + " from device_channel" + + " where deviceId = #{deviceId} and parentId = #{channelId}) as temp)" + + " where deviceId = #{deviceId} " + + " and channelId = #{channelId}") + int updateChannelSubCount(String deviceId, String channelId); + + @Update(value = {"UPDATE device_channel SET latitude=${latitude}, longitude=${longitude} WHERE deviceId=#{deviceId} AND channelId=#{channelId}"}) + void updatePotion(String deviceId, String channelId, double longitude, double latitude); } -- Gitblit v1.8.0