zhuguifei
2025-04-28 442928123f63ee497d766f9a7a14f0a6ee067e25
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package org.jeecg.modules.system.mapper;
 
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.system.entity.SysRole;
 
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.common.doc.vo.PathPermissionVO;
 
import java.util.List;
 
/**
 * <p>
 * 角色表 Mapper 接口
 * </p>
 *
 * @Author scott
 * @since 2018-12-19
 */
public interface SysRoleMapper extends BaseMapper<SysRole> {
 
    /**
     * @Author scott
     * @Date 2019/12/13 16:12
     * @Description: 删除角色与用户关系
     */
    @Delete("delete from sys_user_role where role_id = #{roleId}")
    void deleteRoleUserRelation(@Param("roleId") String roleId);
 
 
    /**
     * @Author scott
     * @Date 2019/12/13 16:12
     * @Description: 删除角色与权限关系
     */
    @Delete("delete from sys_role_permission where role_id = #{roleId}")
    void deleteRolePermissionRelation(@Param("roleId") String roleId);
 
    @Select("select id as roleId, role_name as roleName from sys_role")
    List<PathPermissionVO> queryPathRoles();
 
    @Select("select b.id as userId, b.realname as userName from sys_user_role a join sys_user b  on a.user_id = b.id where a.role_id = #{roleId}")
    List<PathPermissionVO> queryPathRoleUsers(@Param("roleId") String roleId);
}