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; + } + } }