system:简化 mapper 的实现

pull/2/head
YunaiV 2023-02-04 00:33:55 +08:00
parent 67e1879a8f
commit 10f7352ef8
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) {