package cn.com.ctop.common.module.mapper;


import cn.com.ctop.common.module.entity.SysRole;
import cn.com.ctop.common.module.vo.UserDto;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.lettuce.core.dynamic.annotation.Param;
import org.apache.ibatis.annotations.Delete;

import java.util.List;

/**
 * <p>
 * 角色表 Mapper 接口
 * </p>
 *
 * @Author scott
 * @since 2018-12-19
 */
public interface SysRoleExtMapper extends BaseMapper<SysRole> {
    /**
     * 根据roleCode获取相对应的用户信息
     */


    String getRoleIdByRoleCode(@Param("roleCode") String roleCode);

    String getRoleCodeByUserId(@Param("userId") String userId);
    /**
     * @Author scott
     * @Date 2019/12/13 16:12
     * @Description: 删除角色与用户关系
     */
    @Delete("delete from sys_user_role where role_id = #{roleId}")
    void deleteRoleUserRelation(@org.apache.ibatis.annotations.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(@org.apache.ibatis.annotations.Param("roleId") String roleId);
}
