@@ -189,8 +189,8 @@ public class DictBizController extends BladeController {
@GetMapping("/dictionary")
@ApiOperationSupport(order = 8)
@Operation(summary = "获取字典", description = "获取字典")
- public R<List<DictBiz>> dictionary(String code,Integer type) {
- List<DictBiz> tree = dictService.getList(code,type);
+ public R<List<DictBiz>> dictionary(String parentId,String code,Integer type) {
+ List<DictBiz> tree = dictService.getList(parentId,code,type);
return R.data(tree);
}
@@ -54,7 +54,7 @@ public interface DictBizMapper extends BaseMapper<DictBiz> {
* @param code 字典编号
* @return
*/
- List<DictBiz> getList(String code,@Param("type") Integer type);
+ List<DictBiz> getList(@Param("parentId") String parentId,@Param("code") String code,@Param("type") Integer type);
/**
* 获取树形节点
@@ -41,13 +41,16 @@
select id, tenant_id, parent_id, code, dict_key, dict_value, sort, remark
from blade_dict_biz
where
- code = #{param1}
+ code = #{code}
and parent_id > 0
and is_sealed = 0
and is_deleted = 0
<if test="type != null">
and system_type = #{type}
</if>
+ <if test="parentId != null and parentId != ''">
+ and parent_id = #{parentId}
+ </if>
</select>
<select id="tree" resultMap="treeNodeResultMap">
@@ -78,7 +78,7 @@ public interface IDictBizService extends IService<DictBiz> {
- List<DictBiz> getList(String code,Integer type);
+ List<DictBiz> getList(String parentId,String code,Integer type);
* 新增或修改
@@ -81,12 +81,12 @@ public class DictBizServiceImpl extends ServiceImpl<DictBizMapper, DictBiz> impl
@Override
public List<DictBiz> getList(String code) {
- return baseMapper.getList(code,null);
+ return baseMapper.getList(null,code,null);
- public List<DictBiz> getList(String code, Integer type) {
- return baseMapper.getList(code,type);
+ public List<DictBiz> getList(String parentId,String code, Integer type) {
+ return baseMapper.getList(parentId,code,type);