-- 今天生成环境数据突然多,系统异常 解决方案(必须用in 业务情况),也可以用其他函数解决 union all  或者 exists 等

1:截取list

List<Integer>  intList1apache=new ArrayLiat();

  1. List<List<Integer>> subs1apache = ListUtils.partition(intList1apache, 999);

2 :将List<String> 划分为List<List<String>>

按指定大小,分隔集合,将集合按规定个数分为n个部分

private static List<List<String>> splitList(List<String> list, int len) {
if (list == null || list.size() == 0 || len < 1) {
return null;
}
List<List<String>> result = new ArrayList<List<String>>();
int size = list.size();
int count = (size + len - 1) / len;
for (int i = 0; i < count; i++) {
List<String> subList = list.subList(i * len, ((i + 1) * len > size ? size : len * (i + 1)));
result.add(subList);
}
return result;
}



3.

改为: 入参为List<List<String>>

WHERE name IS NOT NULL
<if test="userids!=null and userids.size()>0" >
and
<foreach collection="userids" item="userid" open="(" separator="or" close=")">
createby in
<foreach collection="userid" item="createby" open="(" separator="," close=")">
#{createby}
</foreach>
</foreach>
</if>

效果 where xxx and (createby in (1,2,3,4,5 .... ,999) or createby in(1000,1001,....,1040))

最新文章

  1. Block formatting context(块级格式化上下文)
  2. Java生成随机验证码
  3. kaungbin_DP S (POJ 3666) Making the Grade
  4. bzoj 3718
  5. python 基础 基本数据类型
  6. 绘制图形与3D增强技巧(一)----点图元
  7. 【转载】Linux 与 BSD 有什么不同?
  8. C#新开一个线程取到数据,如何更新到主线程UI上面
  9. Oracle10g新特性——正则表达式 - 转
  10. wMy_Python ~储存相关~
  11. Unity3D 之3D动画机设置
  12. iOS ReactiveCocoa(RAC)学习详解
  13. Windows 10 安装 Docker for Windows
  14. 初识Java——一维数组的创建及使用
  15. Java Api Consumer 连接启用Kerberos认证的Kafka
  16. vue知识总结
  17. Redis的数据结构、通用操作及其特性
  18. OpenGL.Tutorial文章转载
  19. Oracle之ora-01031 insufficient privileges
  20. 大数据入门到精通2--spark rdd 获得数据的三种方法

热门文章

  1. HIVE- 删除功能
  2. vue重置data数据为初始状态
  3. 808.11ac的MAC层
  4. gitlab 配置汉化版
  5. G1 垃圾回收详解
  6. Camstar报错:cannot be accessed through null object reference at CDO &#39;xxx&#39;
  7. Hadoop集群搭建(详细简单粗暴
  8. ES6-Class类上
  9. 火星坐标系 (GCJ-02) 与百度坐标系 (BD-09) 的互转 JAVA
  10. python基础 补漏