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 @@ --> -->