Commit 7b7722f8c5eeb843f6536bb80198d8447889c813

Authored by 杨鸣坤
1 parent 7a4cd252

巡检/保养方案 列表接口增加状态查询

... ... @@ -39,7 +39,8 @@ public class TkCheckPlanController extends BaseController {
39 39 @RequestParam(PAGE_SIZE) int pageSize,
40 40 @RequestParam(PAGE) int page,
41 41 @RequestParam(value = "name", required = false) String name,
42   - @RequestParam(value = "type", required = false) TkCheckPlanTypeEnum type
  42 + @RequestParam(value = "type", required = false) TkCheckPlanTypeEnum type,
  43 + @RequestParam(value = "status", required = false) TkCheckPlanStatusEnum status
43 44 ) throws ThingsboardException {
44 45 Map<String, Object> queryMap = new HashMap<>();
45 46 queryMap.put(PAGE_SIZE, pageSize);
... ... @@ -52,6 +53,10 @@ public class TkCheckPlanController extends BaseController {
52 53 queryMap.put("type", type);
53 54 }
54 55
  56 + if (status != null) {
  57 + queryMap.put("status", status);
  58 + }
  59 +
55 60 return tkCheckPlanService.page(queryMap, getCurrentUser().isTenantAdmin());
56 61 }
57 62
... ...
... ... @@ -34,6 +34,10 @@ public class TkCheckPlanServiceImpl extends AbstractBaseService<TkCheckPlanMappe
34 34 lambda.eq(TkCheckPlanEntity::getType, queryMap.get("type").toString());
35 35 }
36 36
  37 + if (queryMap != null && queryMap.get("status") != null) {
  38 + lambda.eq(TkCheckPlanEntity::getStatus, queryMap.get("status").toString());
  39 + }
  40 +
37 41 IPage<TkCheckPlanEntity> page = baseMapper.selectPage(getPage(queryMap, "create_time", false),
38 42 wrapper);
39 43
... ...