Commit 1294081a9cdf9bb4b4523ffc872a4accb5d11144

Authored by 648540858
1 parent 639e0bab

优化树形列表通道查询

src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java
@@ -459,8 +459,8 @@ public interface DeviceChannelMapper { @@ -459,8 +459,8 @@ public interface DeviceChannelMapper {
459 "select * " + 459 "select * " +
460 "from wvp_device_channel " + 460 "from wvp_device_channel " +
461 "where device_id=#{deviceId}" + 461 "where device_id=#{deviceId}" +
462 - " <if test='parentId != null '> and parent_id = #{parentId} </if>" +  
463 - " <if test='parentId == null '> and parent_id is null </if>" + 462 + " <if test='parentId != null and parentId != deviceId'> and parent_id = #{parentId} </if>" +
  463 + " <if test='parentId == null or parentId == deviceId'> and parent_id is null or parent_id = #{deviceId}</if>" +
464 " <if test='onlyCatalog == true '> and parental = 1 </if>" + 464 " <if test='onlyCatalog == true '> and parental = 1 </if>" +
465 " </script>"}) 465 " </script>"})
466 List<DeviceChannel> getSubChannelsByDeviceId(String deviceId, String parentId, boolean onlyCatalog); 466 List<DeviceChannel> getSubChannelsByDeviceId(String deviceId, String parentId, boolean onlyCatalog);