package com.zhentao.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhentao.entity.UserRole;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 用户角色关联Mapper
 */
@Mapper
public interface UserRoleMapper extends BaseMapper<UserRole> {
    
    /**
     * 根据用户ID查询角色ID列表
     */
    List<Integer> selectRoleIdsByUserId(@Param("userId") Integer userId);
    
    /**
     * 根据用户ID删除所有角色关联
     */
    int deleteByUserId(@Param("userId") Integer userId);
}

