package com.iailab.module.system.dal.mysql.permission; import com.iailab.framework.mybatis.core.mapper.BaseMapperX; import com.iailab.module.system.dal.dataobject.permission.UserRoleDO; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import org.apache.ibatis.annotations.Mapper; import java.util.Collection; import java.util.List; @Mapper public interface UserRoleMapper extends BaseMapperX { default List selectListByUserId(Long userId) { return selectList(UserRoleDO::getUserId, userId); } default void deleteListByUserIdAndRoleIdIds(Long userId, Collection roleIds) { delete(new LambdaQueryWrapper() .eq(UserRoleDO::getUserId, userId) .in(UserRoleDO::getRoleId, roleIds)); } default void deleteListByUserId(Long userId) { delete(new LambdaQueryWrapper().eq(UserRoleDO::getUserId, userId)); } default void deleteListByRoleId(Long roleId) { delete(new LambdaQueryWrapper().eq(UserRoleDO::getRoleId, roleId)); } default List selectListByRoleIds(Collection roleIds) { return selectList(UserRoleDO::getRoleId, roleIds); } }