mirror of
http://git.pig4cloud.com/pig/pigx.git
synced 2026-11-09 04:49:02 +08:00
新特性: 部门树增加 数据权限过滤
This commit is contained in:
1 parent
65604d745a
commit
28e390975e
3 files changed
+15
-1
No files matched your search
+10
@@ -21,6 +21,9 @@ package com.pig4cloud.pigx.admin.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.pig4cloud.pigx.admin.api.entity.SysDept;
|
||||
import com.pig4cloud.pigx.common.data.datascope.DataScope;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -32,4 +35,11 @@ import com.pig4cloud.pigx.admin.api.entity.SysDept;
|
||||
*/
|
||||
public interface SysDeptMapper extends BaseMapper<SysDept> {
|
||||
|
||||
/**
|
||||
* 根据数据权限查询部门
|
||||
*
|
||||
* @param dataScope
|
||||
* @return
|
||||
*/
|
||||
List<SysDept> listDepts(DataScope dataScope);
|
||||
}
|
||||
+2
-1
@@ -29,6 +29,7 @@ import com.pig4cloud.pigx.admin.api.vo.TreeUtil;
|
||||
import com.pig4cloud.pigx.admin.mapper.SysDeptMapper;
|
||||
import com.pig4cloud.pigx.admin.service.SysDeptRelationService;
|
||||
import com.pig4cloud.pigx.admin.service.SysDeptService;
|
||||
import com.pig4cloud.pigx.common.data.datascope.DataScope;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -120,7 +121,7 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
|
||||
*/
|
||||
@Override
|
||||
public List<DeptTree> selectTree() {
|
||||
return getDeptTree(this.list(Wrappers.emptyWrapper()));
|
||||
return getDeptTree(baseMapper.listDepts(new DataScope()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -21,4 +21,7 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.pig4cloud.pigx.admin.mapper.SysDeptMapper">
|
||||
|
||||
<select id="listDepts" resultType="com.pig4cloud.pigx.admin.api.entity.SysDept">
|
||||
SELECT * FROM sys_dept WHERE del_flag = '0'
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in new issue
Block a user