package com.nokia.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.nokia.pojo.Role;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface RoleDao extends BaseMapper<Role> {

    @Select("select r.role_id, r.role_name, r.system from sqmdb_rpt.acl_role r, sqmdb_rpt.acl_user_role ur where r.role_id = ur.role_id and ur.user_id = #{userId}")
    List<Role> findByUserId(Integer userId);

    @Select("select * from sqmdb_rpt.acl_role where role_name like concat('%',#{roleName},'%')")
    List<Role> findRoleNameLike(String roleName);
}
