Commit 10f7352ef845f97678ac956ca5a2add67733cbe9

Authored by YunaiV
1 parent 67e1879a

system:简化 mapper 的实现

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 13 public interface UserPostMapper extends BaseMapperX<UserPostDO> {
14 14  
15 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 19 default void deleteByUserIdAndPostId(Long userId, Collection<Long> postIds) {
... ... @@ -24,8 +23,7 @@ public interface UserPostMapper extends BaseMapperX&lt;UserPostDO&gt; {
24 23 }
25 24  
26 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 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&lt;SocialUserBindDO&gt; {
24 24 }
25 25  
26 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 31 default List<SocialUserBindDO> selectListByUserIdAndUserType(Long userId, Integer userType) {
... ...