package com.qmth.paper.library.common.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qmth.paper.library.common.bean.dto.MenuDto;
import com.qmth.paper.library.common.entity.SysRole;
import com.qmth.paper.library.common.entity.SysUserRole;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 用户和角色关联表 Mapper 接口
 * </p>
 *
 * @author xf
 * @since 2021-03-23
 */
public interface SysUserRoleMapper extends BaseMapper<SysUserRole> {

    List<SysRole> listRoleByUserId(@Param("userId") Long userId);

    List<MenuDto> listByUserId(@Param("userId") Long userId, @Param("schoolId") Long schoolId);

    List<MenuDto> listAll(@Param("schoolId") Long schoolId);

    List<SysUserRole> listByRoleId(@Param("roleId") Long roleId, @Param("schoolId") Long schoolId);
}
