Procházet zdrojové kódy

投资效益系统-字段添加根据父级查询

LHB před 3 měsíci
rodič
revize
e91cc4f4b9

+ 2 - 2
src/main/java/org/springblade/modules/system/controller/DictBizController.java

@@ -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);
 	}
 

+ 1 - 1
src/main/java/org/springblade/modules/system/mapper/DictBizMapper.java

@@ -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);
 
 	/**
 	 * 获取树形节点

+ 4 - 1
src/main/java/org/springblade/modules/system/mapper/DictBizMapper.xml

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

+ 1 - 1
src/main/java/org/springblade/modules/system/service/IDictBizService.java

@@ -78,7 +78,7 @@ public interface IDictBizService extends IService<DictBiz> {
 	 * @param code 字典编号
 	 * @return
 	 */
-	List<DictBiz> getList(String code,Integer type);
+	List<DictBiz> getList(String parentId,String code,Integer type);
 
 	/**
 	 * 新增或修改

+ 3 - 3
src/main/java/org/springblade/modules/system/service/impl/DictBizServiceImpl.java

@@ -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);
 	}
 
 	@Override
-	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);
 	}
 
 	@Override