Commit 10f7352ef845f97678ac956ca5a2add67733cbe9
1 parent
67e1879a
system:简化 mapper 的实现
Showing
2 changed files
with
4 additions
and
7 deletions
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dept/UserPostMapper.java
| @@ -13,8 +13,7 @@ import java.util.List; | @@ -13,8 +13,7 @@ import java.util.List; | ||
| 13 | public interface UserPostMapper extends BaseMapperX<UserPostDO> { | 13 | public interface UserPostMapper extends BaseMapperX<UserPostDO> { |
| 14 | 14 | ||
| 15 | default List<UserPostDO> selectListByUserId(Long userId) { | 15 | default List<UserPostDO> selectListByUserId(Long userId) { |
| 16 | - return selectList(new LambdaQueryWrapperX<UserPostDO>() | ||
| 17 | - .eq(UserPostDO::getUserId, userId)); | 16 | + return selectList(UserPostDO::getUserId, userId); |
| 18 | } | 17 | } |
| 19 | 18 | ||
| 20 | default void deleteByUserIdAndPostId(Long userId, Collection<Long> postIds) { | 19 | default void deleteByUserIdAndPostId(Long userId, Collection<Long> postIds) { |
| @@ -24,8 +23,7 @@ public interface UserPostMapper extends BaseMapperX<UserPostDO> { | @@ -24,8 +23,7 @@ public interface UserPostMapper extends BaseMapperX<UserPostDO> { | ||
| 24 | } | 23 | } |
| 25 | 24 | ||
| 26 | default List<UserPostDO> selectListByPostIds(Collection<Long> postIds) { | 25 | default List<UserPostDO> selectListByPostIds(Collection<Long> postIds) { |
| 27 | - return selectList(new LambdaQueryWrapperX<UserPostDO>() | ||
| 28 | - .in(UserPostDO::getPostId, postIds)); | 26 | + return selectList(UserPostDO::getPostId, postIds); |
| 29 | } | 27 | } |
| 30 | 28 | ||
| 31 | default void deleteByUserId(Long userId) { | 29 | default void deleteByUserId(Long userId) { |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/social/SocialUserBindMapper.java
| @@ -24,9 +24,8 @@ public interface SocialUserBindMapper extends BaseMapperX<SocialUserBindDO> { | @@ -24,9 +24,8 @@ public interface SocialUserBindMapper extends BaseMapperX<SocialUserBindDO> { | ||
| 24 | } | 24 | } |
| 25 | 25 | ||
| 26 | default SocialUserBindDO selectByUserTypeAndSocialUserId(Integer userType, Long socialUserId) { | 26 | default SocialUserBindDO selectByUserTypeAndSocialUserId(Integer userType, Long socialUserId) { |
| 27 | - return selectOne(new LambdaQueryWrapperX<SocialUserBindDO>() | ||
| 28 | - .eq(SocialUserBindDO::getUserType, userType) | ||
| 29 | - .eq(SocialUserBindDO::getSocialUserId, socialUserId)); | 27 | + return selectOne(SocialUserBindDO::getUserType, userType, |
| 28 | + SocialUserBindDO::getSocialUserId, socialUserId); | ||
| 30 | } | 29 | } |
| 31 | 30 | ||
| 32 | default List<SocialUserBindDO> selectListByUserIdAndUserType(Long userId, Integer userType) { | 31 | default List<SocialUserBindDO> selectListByUserIdAndUserType(Long userId, Integer userType) { |