package com.kidgrow.usercenter.mapper;
import com.kidgrow.common.model.SysRole;
import com.kidgrow.db.mapper.SuperMapper;
import com.kidgrow.usercenter.model.SysRoleUser;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
/**
* 石家庄喜高科技有限责任公司 版权所有 © Copyright 2020
*
* @Description: 用户角色关系接口Mapper
* @Project:
* @CreateDate: Created in 2020/2/13 16:34
* @Author: liuke
*/
@Mapper
public interface SysUserRoleMapper extends SuperMapper {
int deleteUserRole(@Param("userId") Long userId, @Param("roleId") Long roleId);
@Insert("insert into sys_role_user(user_id, role_id) values(#{userId}, #{roleId})")
int saveUserRoles(@Param("userId") Long userId, @Param("roleId") Long roleId);
/**
* 根据用户id获取角色
*
* @param userId
* @return
*/
List findRolesByUserId(@Param("userId") Long userId);
/**
* 根据用户ids 获取
*
* @param userIds
* @return
*/
@Select("")
List findRolesByUserIds(List userIds);
}