wangyuzhe 3 months ago
parent
commit
6b325679a6

+ 4 - 1
blade-service/blade-system/src/main/java/org/springblade/system/controller/DeptController.java

@@ -189,5 +189,8 @@ public class DeptController extends BladeController {
 		return R.data(list);
 	}
 
-
+	@GetMapping("selectDeptByParentId")
+	public R selectDeptByParentId(Long parentId) {
+		return R.data(deptService.selectDeptByParentId(parentId));
+	}
 }

+ 1 - 0
blade-service/blade-system/src/main/java/org/springblade/system/mapper/DeptMapper.java

@@ -74,4 +74,5 @@ public interface DeptMapper extends BaseMapper<Dept> {
 	 */
 	List<String> getDeptNames(Long[] ids);
 
+    List<Dept> selectDeptByParentId(Long parentId);
 }

+ 3 - 0
blade-service/blade-system/src/main/java/org/springblade/system/mapper/DeptMapper.xml

@@ -112,4 +112,7 @@
         and is_deleted = 0
     </select>
 
+    <select id="selectDeptByParentId" resultMap="deptResultMap">
+        select * from jdrh.blade_dept where parent_id = #{parentId} and is_deleted = 0
+    </select>
 </mapper>

+ 1 - 0
blade-service/blade-system/src/main/java/org/springblade/system/service/IDeptService.java

@@ -125,4 +125,5 @@ public interface IDeptService extends IService<Dept> {
 	 */
 	List<DeptVO> search(String deptName, Long parentId);
 
+    List<Dept> selectDeptByParentId(Long parentId);
 }

+ 5 - 0
blade-service/blade-system/src/main/java/org/springblade/system/service/impl/DeptServiceImpl.java

@@ -179,4 +179,9 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
 		return DeptWrapper.build().listNodeVO(deptList);
 	}
 
+	@Override
+	public List<Dept> selectDeptByParentId(Long parentId) {
+		return baseMapper.selectDeptByParentId(parentId);
+	}
+
 }