/**
* 批量保存客户信息
* @param pBaseCustomers 客户档案信息
* @return int
*/
@Transactional(rollbackFor = Exception.class)
public int saveBaseCustomerBatch(List<BaseCustomer> pBaseCustomers){
//分批次保存信息客户信息
//每批保存200条数据
Integer batchCount = 200;
int count = 0;
for (int i = 0; i < Math.ceil(pBaseCustomers.size()/batchCount.doubleValue()); i++) {
List<BaseCustomer> zBaseCustomers = pBaseCustomers.subList(i * batchCount,
(i + 1) * batchCount > pBaseCustomers.size() ? pBaseCustomers.size() : (i + 1) * batchCount);
int zCount = baseCustomerMapper.insertBatch(zBaseCustomers);
count += zCount;
}
return count;
}