From 2f9bd859f4ce03bed602819e6b2e1bebd3656e34 Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: Tue, 7 Nov 2023 18:27:57 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=80=9A=E9=81=93=E6=9F=A5?=
=?UTF-8?q?=E8=AF=A2BUG?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../iot/vmp/storager/dao/CommonGbChannelMapper.java | 6 +++---
.../iot/vmp/vmanager/channel/CommonChannelController.java | 5 +++++
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/CommonGbChannelMapper.java b/src/main/java/com/genersoft/iot/vmp/storager/dao/CommonGbChannelMapper.java
index 9c074192..23034098 100644
--- a/src/main/java/com/genersoft/iot/vmp/storager/dao/CommonGbChannelMapper.java
+++ b/src/main/java/com/genersoft/iot/vmp/storager/dao/CommonGbChannelMapper.java
@@ -332,14 +332,14 @@ public interface CommonGbChannelMapper {
@Param("groupDeviceIdForNew") String groupDeviceIdForNew);
@Select("")
List getChannelsInRegion(@Param("regionDeviceId") String regionDeviceId,
@Param("query") String query);
@Select("")
List queryChannelListInGroup(@Param("groupDeviceId") String groupDeviceId,
@@ -349,5 +349,5 @@ public interface CommonGbChannelMapper {
"select * from wvp_common_gb_channel where 1=1 " +
" and ( common_gb_device_id LIKE concat('%',#{query},'%') or common_gb_name LIKE concat('%',#{query},'%') ) " +
"")
- List query(String query);
+ List query(@Param("query") String query);
}
diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/channel/CommonChannelController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/channel/CommonChannelController.java
index 0e0475f4..43848f9d 100755
--- a/src/main/java/com/genersoft/iot/vmp/vmanager/channel/CommonChannelController.java
+++ b/src/main/java/com/genersoft/iot/vmp/vmanager/channel/CommonChannelController.java
@@ -7,6 +7,7 @@ import com.google.common.collect.Lists;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
+import org.apache.commons.lang3.ObjectUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -55,6 +56,10 @@ public class CommonChannelController {
@RequestParam(required = true) int page,
@RequestParam(required = true) int count ){
+ if (ObjectUtils.isEmpty(query)) {
+ query = null;
+ }
+ assert !ObjectUtils.isEmpty(groupDeviceId);
return commonGbChannelService.queryChannelListInGroup(groupDeviceId, query, page, count);
}