system:简化 mapper 的实现

This commit is contained in:
YunaiV 2023-02-04 00:34:03 +08:00
parent f6d259b620
commit df65b88fe9
2 changed files with 4 additions and 7 deletions

View File

@ -13,8 +13,7 @@ import java.util.List;
public interface UserPostMapper extends BaseMapperX<UserPostDO> {
default List<UserPostDO> selectListByUserId(Long userId) {
return selectList(new LambdaQueryWrapperX<UserPostDO>()
.eq(UserPostDO::getUserId, userId));
return selectList(UserPostDO::getUserId, userId);
}
default void deleteByUserIdAndPostId(Long userId, Collection<Long> postIds) {
@ -24,8 +23,7 @@ public interface UserPostMapper extends BaseMapperX<UserPostDO> {
}
default List<UserPostDO> selectListByPostIds(Collection<Long> postIds) {
return selectList(new LambdaQueryWrapperX<UserPostDO>()
.in(UserPostDO::getPostId, postIds));
return selectList(UserPostDO::getPostId, postIds);
}
default void deleteByUserId(Long userId) {

View File

@ -24,9 +24,8 @@ public interface SocialUserBindMapper extends BaseMapperX<SocialUserBindDO> {
}
default SocialUserBindDO selectByUserTypeAndSocialUserId(Integer userType, Long socialUserId) {
return selectOne(new LambdaQueryWrapperX<SocialUserBindDO>()
.eq(SocialUserBindDO::getUserType, userType)
.eq(SocialUserBindDO::getSocialUserId, socialUserId));
return selectOne(SocialUserBindDO::getUserType, userType,
SocialUserBindDO::getSocialUserId, socialUserId);
}
default List<SocialUserBindDO> selectListByUserIdAndUserType(Long userId, Integer userType) {