From c08074423d90082296c7c0d93c1ea99822a9f9f4 Mon Sep 17 00:00:00 2001 From: smallchill Date: Wed, 11 Dec 2019 15:48:18 +0800 Subject: [PATCH] =?UTF-8?q?:zap:=20=E4=BF=AE=E5=A4=8Dpostgresql=E5=AD=97?= =?UTF-8?q?=E5=85=B8=E6=A8=A1=E5=9D=97=E7=B1=BB=E5=9E=8B=E8=BD=AC=E6=8D=A2?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/springblade/system/controller/DictBizController.java | 5 +++-- .../org/springblade/system/controller/DictController.java | 5 +++-- .../java/org/springblade/system/mapper/DictBizMapper.xml | 2 +- .../main/java/org/springblade/system/mapper/DictMapper.xml | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/controller/DictBizController.java b/blade-service/blade-system/src/main/java/org/springblade/system/controller/DictBizController.java index 7e5796b6..30a1b98f 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/controller/DictBizController.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/controller/DictBizController.java @@ -104,8 +104,9 @@ public class DictBizController extends BladeController { }) @ApiOperationSupport(order = 4) @ApiOperation(value = "列表", notes = "传入dict") - public R> childList(@ApiIgnore @RequestParam Map dict, Query query) { - IPage page = dictService.page(Condition.getPage(query), Condition.getQueryWrapper(dict, DictBiz.class).lambda().orderByAsc(DictBiz::getSort)); + public R> childList(@ApiIgnore @RequestParam Map dict, @RequestParam(required = false, defaultValue = "-1") Long parentId, Query query) { + dict.remove("parentId"); + IPage page = dictService.page(Condition.getPage(query), Condition.getQueryWrapper(dict, DictBiz.class).lambda().eq(DictBiz::getParentId, parentId).orderByAsc(DictBiz::getSort)); return R.data(DictBizWrapper.build().pageVO(page)); } diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/controller/DictController.java b/blade-service/blade-system/src/main/java/org/springblade/system/controller/DictController.java index 6aa32af7..c73879b3 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/controller/DictController.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/controller/DictController.java @@ -107,8 +107,9 @@ public class DictController extends BladeController { }) @ApiOperationSupport(order = 4) @ApiOperation(value = "列表", notes = "传入dict") - public R> childList(@ApiIgnore @RequestParam Map dict, Query query) { - IPage page = dictService.page(Condition.getPage(query), Condition.getQueryWrapper(dict, Dict.class).lambda().orderByAsc(Dict::getSort)); + public R> childList(@ApiIgnore @RequestParam Map dict, @RequestParam(required = false, defaultValue = "-1") Long parentId, Query query) { + dict.remove("parentId"); + IPage page = dictService.page(Condition.getPage(query), Condition.getQueryWrapper(dict, Dict.class).lambda().eq(Dict::getParentId, parentId).orderByAsc(Dict::getSort)); return R.data(DictWrapper.build().pageVO(page)); } diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/mapper/DictBizMapper.xml b/blade-service/blade-system/src/main/java/org/springblade/system/mapper/DictBizMapper.xml index 76b36ab2..9e7cbff3 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/mapper/DictBizMapper.xml +++ b/blade-service/blade-system/src/main/java/org/springblade/system/mapper/DictBizMapper.xml @@ -37,7 +37,7 @@ --> -->