Skip to content

Commit

Permalink
refactor: 优化部分 Mapper 方法使用 (替换为 MP 新增方法)
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles7c committed Sep 24, 2024
1 parent d7e8fc9 commit ad69d44
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ public void saveConfig(GenConfigReq req, String tableName) {
}
fieldConfig.setTableName(tableName);
}
fieldConfigMapper.insertBatch(fieldConfigList);
fieldConfigMapper.insert(fieldConfigList);
// 保存或更新生成配置信息
GenConfigDO newGenConfig = req.getGenConfig();
GenConfigDO oldGenConfig = genConfigMapper.selectById(tableName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,6 @@ private void updateChildrenAncestors(String newAncestors, String oldAncestors, L
dept.setAncestors(child.getAncestors().replaceFirst(oldAncestors, newAncestors));
list.add(dept);
}
baseMapper.updateBatchById(list);
baseMapper.updateById(list);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public void add(Long messageId, List<Long> userIdList) {
messageUser.setIsRead(false);
return messageUser;
}).toList();
baseMapper.insertBatch(messageUserList);
baseMapper.insert(messageUserList);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public void update(List<OptionReq> options) {
passwordPolicy.validateRange(Integer.parseInt(value), passwordPolicyOptionMap);
}
RedisUtils.deleteByPattern(CacheConstants.OPTION_KEY_PREFIX + StringConstants.ASTERISK);
baseMapper.updateBatchById(BeanUtil.copyToList(options, OptionDO.class));
baseMapper.updateById(BeanUtil.copyToList(options, OptionDO.class));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public void deleteByUserIds(List<Long> userIds) {

@Override
public void saveBatch(List<UserRoleDO> list) {
baseMapper.insertBatch(list);
baseMapper.insert(list);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ public UserImportResp importUser(UserImportReq req) {
@Transactional(rollbackFor = Exception.class)
public void doImportUser(List<UserDO> insertList, List<UserDO> updateList, List<UserRoleDO> userRoleDOList) {
if (CollUtil.isNotEmpty(insertList)) {
baseMapper.insertBatch(insertList);
baseMapper.insert(insertList);
}
if (CollUtil.isNotEmpty(updateList)) {
this.updateBatchById(updateList);
Expand Down

0 comments on commit ad69d44

Please sign in to comment.