Commit 9c349789633a27ec0cecc2499933012492807642

Authored by wangyimeng
1 parent 6afcd517

修复查询设备通道目录时查询报错的问题

src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java
... ... @@ -316,10 +316,10 @@ public interface DeviceChannelMapper {
316 316 "select * " +
317 317 "from device_channel " +
318 318 "where deviceId=#{deviceId}" +
319   - " <if test='parentId != null and length != null' > and parentId = #{parentId} or left(channelId, #{parentId.length()}) = #{parentId} and length(channelId)=#{length} </if>" +
  319 + " <if test='parentId != null and length != null' > and parentId = #{parentId} or left(channelId, LENGTH(#{parentId})) = #{parentId} and length(channelId)=#{length} </if>" +
320 320 " <if test='parentId == null and length != null' > and parentId = #{parentId} or length(channelId)=#{length} </if>" +
321 321 " <if test='parentId == null and length == null' > and parentId = #{parentId} </if>" +
322   - " <if test='parentId != null and length == null' > and parentId = #{parentId} or left(channelId, #{parentId.length()}) = #{parentId} </if>" +
  322 + " <if test='parentId != null and length == null' > and parentId = #{parentId} or left(channelId, LENGTH(#{parentId})) = #{parentId} </if>" +
323 323 " </script>"})
324 324 List<DeviceChannel> getChannelsWithCivilCodeAndLength(String deviceId, String parentId, Integer length);
325 325  
... ...