Commit 0a2885e0 by 田超

Merge branch 'feature/listUtil' into 'master'

bug:[none]优化方法

See merge request rays/pcloud-common-parent!168
parents 6b3c8f6c 5585ed7a
......@@ -74,18 +74,18 @@ public class ListUtils {
return new ArrayList<>();
}
HashSet<Long>idSet = new HashSet<>(idList);
idList.clear();
idList.addAll(idSet);
List<Long>newList = new ArrayList<>();
newList.addAll(idSet);
List<T>result = new ArrayList<>();
if(idList.size()>500){
List<List<Long>> lists = groupList(idList);
if(newList.size()>500){
List<List<Long>> lists = groupList(newList);
for (List<Long> list : lists) {
List<T> tempList = listForInSQL.processSQL(list);
result.addAll(tempList);
}
return result;
}else if(idList.size()>0){
return listForInSQL.processSQL(idList);
}else if(newList.size()>0){
return listForInSQL.processSQL(newList);
}else{
return new ArrayList<>();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment