Commit 1294081a9cdf9bb4b4523ffc872a4accb5d11144
1 parent
639e0bab
优化树形列表通道查询
Showing
1 changed file
with
2 additions
and
2 deletions
src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java
| ... | ... | @@ -459,8 +459,8 @@ public interface DeviceChannelMapper { |
| 459 | 459 | "select * " + |
| 460 | 460 | "from wvp_device_channel " + |
| 461 | 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 | 464 | " <if test='onlyCatalog == true '> and parental = 1 </if>" + |
| 465 | 465 | " </script>"}) |
| 466 | 466 | List<DeviceChannel> getSubChannelsByDeviceId(String deviceId, String parentId, boolean onlyCatalog); | ... | ... |