新增业务字典查询接口,可以根据code 和 parentId 查询字典信息
| | |
| | | } |
| | | |
| | | /** |
| | | * 获取字典 |
| | | */ |
| | | @GetMapping("/dictionaryByParentId") |
| | | @ApiOperationSupport(order = 8) |
| | | @ApiOperation(value = "获取字典", notes = "获取字典") |
| | | public R<List<DictBiz>> dictionaryByParentId(String code,Long parentId) { |
| | | List<DictBiz> tree = dictService.getListByParentId(code,parentId); |
| | | return R.data(tree); |
| | | } |
| | | |
| | | /** |
| | | * 获取字典树 |
| | | */ |
| | | @GetMapping("/dictionary-tree") |
| | |
| | | */ |
| | | List<DictBizVO> parentTree(); |
| | | |
| | | /** |
| | | * 获取字典 |
| | | * @param code |
| | | * @param parentId |
| | | * @return |
| | | */ |
| | | List<DictBiz> getListByParentId(String code, Long parentId); |
| | | } |
| | |
| | | select id, parent_id, dict_value as title, id as "value", id as "key" from blade_dict_biz where is_deleted = 0 and parent_id = 0 |
| | | </select> |
| | | |
| | | <!--获取字典-根据父id及code--> |
| | | <select id="getListByParentId" resultMap="dictResultMap"> |
| | | select id, tenant_id, parent_id, code, dict_key, dict_value, sort, remark from blade_dict_biz |
| | | where parent_id in( |
| | | select id from blade_dict_biz where parent_id > 0 and is_sealed = 0 and is_deleted = 0 |
| | | and code like concat(concat('%',#{param1}),'%') and parent_id = #{param2} |
| | | ) |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | */ |
| | | List<DictBizVO> childList(Map<String, Object> dict, Long parentId); |
| | | |
| | | /** |
| | | * 获取字典 |
| | | * @param code |
| | | * @param parentId |
| | | * @return |
| | | */ |
| | | List<DictBiz> getListByParentId(String code, Long parentId); |
| | | } |
| | |
| | | List<DictBiz> list = this.list(Condition.getQueryWrapper(dict, DictBiz.class).lambda().ne(DictBiz::getId, parentId).eq(DictBiz::getCode, parentDict.getCode()).orderByAsc(DictBiz::getSort)); |
| | | return DictBizWrapper.build().listNodeVO(list); |
| | | } |
| | | |
| | | /** |
| | | * 获取字典 |
| | | * @param code |
| | | * @param parentId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<DictBiz> getListByParentId(String code, Long parentId) { |
| | | return baseMapper.getListByParentId(code,parentId); |
| | | } |
| | | } |