From 54df5df0313f251b8d84b77bbc64e4a8bfe86393 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E4=BF=8A=E6=9D=B0?= <502612493@qq.com> Date: Mon, 14 Feb 2022 10:18:00 +0800 Subject: [PATCH] =?UTF-8?q?mapper=E6=94=B9=E7=94=A8=E6=B3=A8=E9=87=8A?= =?UTF-8?q?=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vmp/storager/dao/DeviceChannelMapper.java | 14 +++++++ .../vmp/storager/dao/DeviceChannelMapper.xml | 37 ------------------- .../vmp/vmanager/bean/DeviceChannelTree.java | 15 ++++++++ 3 files changed, 29 insertions(+), 37 deletions(-) delete mode 100644 src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.xml 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 896d730e..f882766f 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 @@ -203,5 +203,19 @@ public interface DeviceChannelMapper { @Select("SELECT * FROM device_channel WHERE deviceId=#{deviceId} AND status=1") List queryOnlineChannelsByDeviceId(String deviceId); + @Select(" SELECT\n" + + " channelId,\n" + + " channelId as id,\n" + + " deviceId,\n" + + " parentId,\n" + + " status,\n" + + " name as title,\n" + + " channelId as \"value\",\n" + + " channelId as \"key\",\n" + + " channelId,\n" + + " longitude,\n" + + " latitude\n" + + " from device_channel\n" + + " where deviceId = #{deviceId}") List tree(String deviceId); } diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.xml b/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.xml deleted file mode 100644 index ce69d222..00000000 --- a/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/bean/DeviceChannelTree.java b/src/main/java/com/genersoft/iot/vmp/vmanager/bean/DeviceChannelTree.java index b147a9e5..773f2c13 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/bean/DeviceChannelTree.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/bean/DeviceChannelTree.java @@ -28,6 +28,12 @@ public class DeviceChannelTree extends DeviceChannel implements INode 0) { + return true; + } else { + return this.hasChildren; + } + } }