int times = projectNos.size()%1000 ==0 ? projectNos.size()/1000 : (projectNos.size()/1000+1);
List<SynProductInfoPO> existPos = new ArrayList<SynProductInfoPO>();
if(CollectionUtils.isNotEmpty(projectNos)){
for (int i = 0; i < times; i++) {
List<? extends SynProductInfoPO> list = null;
if((i+1)*1000 <= projectNos.size()){
list = jySynProductInfoMapper.listByProjectNo(projectNos.subList(i*1000, (i+1)*1000));
}else {
list = jySynProductInfoMapper.listByProjectNo(projectNos.subList(i*1000, projectNos.size()));
}
existPos.addAll(list);
}
}
ORA-01795: maximum number of expressions in a list is 1000
Oracle 的in query list 的大小要不大于1000,
可以才采用分组query。