diff --git a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/mapper/SysDeptMapper.java b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/mapper/SysDeptMapper.java index 007c89675..e53acc3c5 100644 --- a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/mapper/SysDeptMapper.java +++ b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/mapper/SysDeptMapper.java @@ -13,7 +13,7 @@ import java.util.List; @Mapper public interface SysDeptMapper extends BaseMapper { - // @DataPermission + @DataPermission() @Override List selectList(@Param(Constants.WRAPPER) Wrapper queryWrapper); } diff --git a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/mapper/SysRoleMapper.java b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/mapper/SysRoleMapper.java index d3f0ca29a..0c9cabad2 100644 --- a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/mapper/SysRoleMapper.java +++ b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/mapper/SysRoleMapper.java @@ -1,8 +1,14 @@ package com.youlai.admin.mapper; +import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.youlai.admin.pojo.entity.SysDept; import com.youlai.admin.pojo.entity.SysRole; import com.youlai.admin.pojo.entity.SysUser; +import com.youlai.common.mybatis.annotation.DataPermission; +import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Mapper; @@ -12,4 +18,11 @@ import java.util.List; public interface SysRoleMapper extends BaseMapper { + @DataPermission() + @Override + List selectList(@Param(Constants.WRAPPER) Wrapper queryWrapper); + + @DataPermission() + > E selectPage(E page, @Param("ew") Wrapper queryWrapper); + } diff --git a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/service/impl/SysDeptServiceImpl.java b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/service/impl/SysDeptServiceImpl.java index e28e2f5ec..8f44892d3 100644 --- a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/service/impl/SysDeptServiceImpl.java +++ b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/service/impl/SysDeptServiceImpl.java @@ -125,10 +125,12 @@ public class SysDeptServiceImpl extends ServiceImpl impl .select(SysDept::getId, SysDept::getParentId, SysDept::getName) .orderByAsc(SysDept::getSort) ); - List