myabtis 更新大量数据时候,分批次更新,加快更新效率
if (list_share_date.size() < 1000) {
shareDateMapper.updateBatchShareAndDate(list_share_date);
} else {
int len = 1000;
int size = list_share_date.size();
int count = (size + len - 1) / len;
for (int i = 0; i < count; i++) {
List subListOK = list_share_date.subList(i * len, ((i
-
-
-
len > size ? size : len * (i + 1)));
shareDateMapper.updateBatchShareAndDate(subListOK);
}
}
-
-
本文转自 jimolvxing.blog.csdn.net/article/det…,如有侵权,请联系删除。