package com.CUST.brain.dao.mapper;

import com.CUST.brain.dao.domain.relation.SysUserRole;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;

/**
 * 用户角色关联Mapper接口
 */
@Mapper
public interface SysUserRoleMapper extends BaseMapper<SysUserRole> {
    /**
     * 根据角色ID查找所有拥有该角色的用户ID
     */
    @Select("SELECT user_id FROM sys_user_role WHERE role_id = #{roleId}")
    List<String> selectUserIdsByRoleId(@Param("roleId") String roleId);
} 