提交 | 用户 | 时间
|
e7c126
|
1 |
package com.iailab.module.system.dal.mysql.permission; |
H |
2 |
|
|
3 |
import com.iailab.framework.mybatis.core.mapper.BaseMapperX; |
|
4 |
import com.iailab.module.system.dal.dataobject.permission.UserRoleDO; |
|
5 |
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
6 |
import org.apache.ibatis.annotations.Mapper; |
|
7 |
|
|
8 |
import java.util.Collection; |
|
9 |
import java.util.List; |
|
10 |
|
|
11 |
@Mapper |
|
12 |
public interface UserRoleMapper extends BaseMapperX<UserRoleDO> { |
|
13 |
|
|
14 |
default List<UserRoleDO> selectListByUserId(Long userId) { |
|
15 |
return selectList(UserRoleDO::getUserId, userId); |
|
16 |
} |
|
17 |
|
|
18 |
default void deleteListByUserIdAndRoleIdIds(Long userId, Collection<Long> roleIds) { |
|
19 |
delete(new LambdaQueryWrapper<UserRoleDO>() |
|
20 |
.eq(UserRoleDO::getUserId, userId) |
|
21 |
.in(UserRoleDO::getRoleId, roleIds)); |
|
22 |
} |
|
23 |
|
|
24 |
default void deleteListByUserId(Long userId) { |
|
25 |
delete(new LambdaQueryWrapper<UserRoleDO>().eq(UserRoleDO::getUserId, userId)); |
|
26 |
} |
|
27 |
|
|
28 |
default void deleteListByRoleId(Long roleId) { |
|
29 |
delete(new LambdaQueryWrapper<UserRoleDO>().eq(UserRoleDO::getRoleId, roleId)); |
|
30 |
} |
|
31 |
|
|
32 |
default List<UserRoleDO> selectListByRoleIds(Collection<Long> roleIds) { |
|
33 |
return selectList(UserRoleDO::getRoleId, roleIds); |
|
34 |
} |
|
35 |
|
|
36 |
} |