/**
* 切分查询
* @param phoneList 集合
* @return
*/
private List<PhoneNumberOperatorVO> queryOperator(List<String> phoneList) {
int size = phoneList.size();
int batchSize = 100; // 切割大小
int batchCount = (size + batchSize - 1) / batchSize; // 计算需要分多少次查询
List<PhoneNumberOperatorVO> exportList = new ArrayList<>();
for (int i = 0; i < batchCount; i++) {
int startIndex = i * batchSize; // 当前批次查询的起始索引
int endIndex = Math.min(startIndex + batchSize, size); // 当前批次查询的结束索引
List<String> batchPhoneList = phoneList.subList(startIndex, endIndex); // 当前批次的电话列表
List<PhoneNumberOperatorVO> batchResult = ctSegmentNumberInfoMapper.queryOperatorList(batchPhoneList); // 查询当前批次的记录
exportList.addAll(batchResult); // 将当前批次的结果添加到总结果列表中
}
return exportList;
}
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
文章由极客之音整理,本文链接:https://www.bmabk.com/index.php/post/192690.html