mirror of
https://github.com/PlayEdu/PlayEdu
synced 2026-01-02 00:59:25 +08:00
后管-线上课、资源:选择分类、部门递归查询该子类、子部门数据
This commit is contained in:
@@ -56,4 +56,6 @@ public interface CategoryService extends IService<Category> {
|
||||
Map<Integer, String> id2name();
|
||||
|
||||
Long total();
|
||||
|
||||
List<Category> getChildCategorysByParentId(Integer parentId);
|
||||
}
|
||||
|
||||
@@ -68,4 +68,6 @@ public interface DepartmentService extends IService<Department> {
|
||||
Integer createWithChainList(List<String> ou);
|
||||
|
||||
Department findByName(String name, Integer parentId);
|
||||
|
||||
List<Department> getChildDepartmentsByParentId(Integer parentId);
|
||||
}
|
||||
|
||||
@@ -224,4 +224,13 @@ public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, Category>
|
||||
public Long total() {
|
||||
return count();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Category> getChildCategorysByParentId(Integer parentId) {
|
||||
return list(
|
||||
query().getWrapper()
|
||||
.eq("parent_id", parentId)
|
||||
.or()
|
||||
.likeRight("parent_chain", parentId + ","));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -293,4 +293,13 @@ public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Departm
|
||||
public Department findByName(String name, Integer parentId) {
|
||||
return getOne(query().getWrapper().eq("name", name).eq("parent_id", parentId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Department> getChildDepartmentsByParentId(Integer parentId) {
|
||||
return list(
|
||||
query().getWrapper()
|
||||
.eq("parent_id", parentId)
|
||||
.or()
|
||||
.likeRight("parent_chain", parentId + ","));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,8 @@ package xyz.playedu.common.types.paginate;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author 杭州白书科技有限公司
|
||||
*
|
||||
@@ -27,9 +29,9 @@ public class CoursePaginateFiler {
|
||||
|
||||
private String title;
|
||||
|
||||
private String depIds;
|
||||
private List<Integer> depIds;
|
||||
|
||||
private String categoryIds;
|
||||
private List<Integer> categoryIds;
|
||||
|
||||
private Integer isRequired;
|
||||
|
||||
|
||||
@@ -17,6 +17,8 @@ package xyz.playedu.common.types.paginate;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author 杭州白书科技有限公司
|
||||
*
|
||||
@@ -35,7 +37,7 @@ public class ResourcePaginateFilter {
|
||||
|
||||
private String sortAlgo;
|
||||
|
||||
private String categoryIds;
|
||||
private List<Integer> categoryIds;
|
||||
|
||||
private String type;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user