提交 | 用户 | 时间
|
e7c126
|
1 |
package com.iailab.module.system.dal.mysql.dept; |
H |
2 |
|
|
3 |
import com.iailab.framework.mybatis.core.mapper.BaseMapperX; |
|
4 |
import com.iailab.framework.mybatis.core.query.LambdaQueryWrapperX; |
|
5 |
import com.iailab.module.system.dal.dataobject.dept.UserPostDO; |
|
6 |
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
7 |
import org.apache.ibatis.annotations.Mapper; |
|
8 |
|
|
9 |
import java.util.Collection; |
|
10 |
import java.util.List; |
|
11 |
|
|
12 |
@Mapper |
|
13 |
public interface UserPostMapper extends BaseMapperX<UserPostDO> { |
|
14 |
|
|
15 |
default List<UserPostDO> selectListByUserId(Long userId) { |
|
16 |
return selectList(UserPostDO::getUserId, userId); |
|
17 |
} |
|
18 |
|
|
19 |
default void deleteByUserIdAndPostId(Long userId, Collection<Long> postIds) { |
|
20 |
delete(new LambdaQueryWrapperX<UserPostDO>() |
|
21 |
.eq(UserPostDO::getUserId, userId) |
|
22 |
.in(UserPostDO::getPostId, postIds)); |
|
23 |
} |
|
24 |
|
|
25 |
default List<UserPostDO> selectListByPostIds(Collection<Long> postIds) { |
|
26 |
return selectList(UserPostDO::getPostId, postIds); |
|
27 |
} |
|
28 |
|
|
29 |
default void deleteByUserId(Long userId) { |
|
30 |
delete(Wrappers.lambdaUpdate(UserPostDO.class).eq(UserPostDO::getUserId, userId)); |
|
31 |
} |
|
32 |
} |