mirror of
https://github.com/continew-org/continew-admin.git
synced 2025-10-18 20:57:15 +08:00
refactor: 优化部分 Mapper 方法使用 (替换为 MP 新增方法)
This commit is contained in:
@@ -197,7 +197,7 @@ public class GeneratorServiceImpl implements GeneratorService {
|
||||
}
|
||||
fieldConfig.setTableName(tableName);
|
||||
}
|
||||
fieldConfigMapper.insertBatch(fieldConfigList);
|
||||
fieldConfigMapper.insert(fieldConfigList);
|
||||
// 保存或更新生成配置信息
|
||||
GenConfigDO newGenConfig = req.getGenConfig();
|
||||
GenConfigDO oldGenConfig = genConfigMapper.selectById(tableName);
|
||||
|
@@ -210,6 +210,6 @@ public class DeptServiceImpl extends BaseServiceImpl<DeptMapper, DeptDO, DeptRes
|
||||
dept.setAncestors(child.getAncestors().replaceFirst(oldAncestors, newAncestors));
|
||||
list.add(dept);
|
||||
}
|
||||
baseMapper.updateBatchById(list);
|
||||
baseMapper.updateById(list);
|
||||
}
|
||||
}
|
||||
|
@@ -75,7 +75,7 @@ public class MessageUserServiceImpl implements MessageUserService {
|
||||
messageUser.setIsRead(false);
|
||||
return messageUser;
|
||||
}).toList();
|
||||
baseMapper.insertBatch(messageUserList);
|
||||
baseMapper.insert(messageUserList);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -98,7 +98,7 @@ public class OptionServiceImpl implements OptionService {
|
||||
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
|
||||
|
@@ -69,7 +69,7 @@ public class UserRoleServiceImpl implements UserRoleService {
|
||||
|
||||
@Override
|
||||
public void saveBatch(List<UserRoleDO> list) {
|
||||
baseMapper.insertBatch(list);
|
||||
baseMapper.insert(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -287,7 +287,7 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, UserDO, UserRes
|
||||
@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);
|
||||
|
Reference in New Issue
Block a user