1. private string getOracleSQLIn(string[] ids, string field)
  2. {
  3. int count = Math.Min(ids.Length, 1000);
  4. int len = ids.Length;
  5. int size = len % count;
  6. if (size == 0)
  7. {
  8. size = len / count;
  9. }
  10. else
  11. {
  12. size = (len / count) + 1;
  13. }
  14. StringBuilder builder = new StringBuilder();
  15. for (int i = 0; i < size; i++)
  16. {
  17. int fromIndex = i * count;
  18. int toIndex = Math.Min(fromIndex + count, len);
  19. string productId = string.Join("','", getArrayValues(fromIndex, toIndex, ids).ToArray());
  20. if (i != 0)
  21. {
  22. builder.Append(" or ");
  23. }
  24. builder.Append(field).Append(" in ('").Append(productId).Append("')");
  25. }
  26. return " ("+builder.ToString()+") ";
  27. }
  28. public List<string> getArrayValues(int fromindex, int toindex, string[] array)
  29. {
  30. List<string> listret = new List<string>();
  31. for (int i = fromindex; i < toindex; i++)
  32. {
  33. listret.Add(array[i]);
  34. }
  35. return listret;
  36. }

最新文章

  1. lua中的string类型
  2. [转]在WPF中区别TextBlock和Label
  3. Oracle PL/SQL块
  4. Java 集合系列10之 HashMap详细介绍(源码解析)和使用示例
  5. wp8 入门到精通 高仿微信发信息 键盘不消失
  6. android源码解析(十七)--&gt;Activity布局加载流程
  7. 使用CSS3美化复选框checkbox
  8. POJ1840 hash
  9. 百度,google的地理编码
  10. BZOJ4554 - [TJOI2016&HEOI2016]游戏
  11. 人工智能之基于face_recognition的人脸检测与识别
  12. react-native项目中禁止截屏与录屏
  13. redis命令String类型(四)
  14. Springboot+ActiveMQ(ActiveMQ消息持久化,保证JMS的可靠性,消费者幂等性)
  15. Ubuntu18.04 搭建zookeeper单机版集群
  16. python网络编程:socket、服务端、客户端
  17. springboot 中事件监听模型的一种实现
  18. CentOS上部署JAVA服务【转】
  19. java.sql.SQLException: ORA-00932: 数据类型不一致: 应为 -, 但却获得 CLOB
  20. ZooKeeper客户端原生API的使用以及ZkClient第三方API的使用

热门文章

  1. Websocket 突破最大长连接
  2. AppCan调试问题
  3. QQ登陆
  4. nohup重定向到其它的日志文件
  5. 安装gitlab ce
  6. QVector与QMap查找效率实战(QMap快N倍,因为QVector是数组,QMap是有序二叉树,查找的时候是N和LogN的速度对比)
  7. bzoj 4237 稻 草 人
  8. k8s弹性伸缩概念以及测试用例
  9. Linux中的grep 命令
  10. JVM-类加载原理