Commit a31053b128afa0365a59df51938353c7f3b24f45

Authored by 云中非
1 parent f7e6ff1f

refactor: 组态分页查询新增过滤条件:平台

... ... @@ -3,6 +3,7 @@ package org.thingsboard.server.controller.yunteng;
3 3 import io.swagger.annotations.Api;
4 4 import io.swagger.annotations.ApiOperation;
5 5 import lombok.RequiredArgsConstructor;
  6 +import org.apache.commons.lang3.StringUtils;
6 7 import org.springframework.http.ResponseEntity;
7 8 import org.springframework.security.access.prepost.PreAuthorize;
8 9 import org.springframework.validation.annotation.Validated;
... ... @@ -39,6 +40,7 @@ public class YtConfigurationCenterController extends BaseController {
39 40 @RequestParam(PAGE_SIZE) int pageSize,
40 41 @RequestParam(PAGE) int page,
41 42 @RequestParam(value = "name", required = false) String name,
  43 + @RequestParam(value = "platform", required = false) String platform,
42 44 @RequestParam(value = "organizationId", required = false) String organizationId,
43 45 @RequestParam(value = ORDER_FILED, required = false) String orderBy,
44 46 @RequestParam(value = ORDER_TYPE, required = false) OrderTypeEnum orderType)
... ... @@ -49,12 +51,15 @@ public class YtConfigurationCenterController extends BaseController {
49 51 queryMap.put(PAGE, page);
50 52 queryMap.put(ORDER_FILED, orderBy);
51 53 queryMap.put("tenantId", getCurrentUser().getCurrentTenantId());
52   - if (null != name) {
  54 + if (StringUtils.isNotBlank(name)) {
53 55 queryMap.put("name", name);
54 56 }
55   - if (null != organizationId) {
  57 + if (StringUtils.isNotBlank(organizationId)) {
56 58 queryMap.put("organizationId", organizationId);
57 59 }
  60 + if (StringUtils.isNotBlank(platform)) {
  61 + queryMap.put("platform", platform);
  62 + }
58 63 if (null != orderType) {
59 64 queryMap.put(ORDER_TYPE, orderType.name());
60 65 }
... ...
... ... @@ -40,6 +40,9 @@
40 40 <if test="queryMap.tenantId !=null and queryMap.tenantId !=''">
41 41 AND a.tenant_id = #{queryMap.tenantId}
42 42 </if>
  43 + <if test="queryMap.platform !=null and queryMap.platform !=''">
  44 + AND a.platform = #{queryMap.platform}
  45 + </if>
43 46 <if test="queryMap.name !=null and queryMap.name !=''">
44 47 AND a.name LIKE concat('%',#{queryMap.name}::TEXT,'%')
45 48 </if>
... ...