zoukankan      html  css  js  c++  java
  • ORACLE SQL语句in超过1000个的处理方法

    1. Iterator agitr = args.iterator();  
    2.          Set rst = new HashSet();  
    3.          Set rst1 = new HashSet();  
    4.         while (agitr.hasNext()) {  
    5.              String gpcode = (String) agitr.next();  
    6.             boolean isretain = true;  
    7.             if (grpusr_code != null && grpusr_code.length() > 0) {  
    8.                  isretain &= cdlist.contains(gpcode);  
    9.              }  
    10.             if (grpusr_name != null && grpusr_name.length() > 0) {  
    11.                  isretain &= nmlist.contains(gpcode);  
    12.              }  
    13.             if (citystr != null && citystr.length() > 0) {  
    14.                  isretain &= arlist.contains(gpcode);  
    15.              }  
    16.             if (propstr != null && propstr.length() > 0) {  
    17.                  isretain &= pplist.contains(gpcode);  
    18.              }  
    19.              isretain &= uslist.contains(gpcode);  
    20.             if (isretain) {  
    21.                 if (rst.size() <=800){  
    22.                      rst.add("'" + gpcode + "'");  
    23.                  }else{  
    24.                      rst1.add("'" + gpcode + "'");  
    25.                  }  
    26.                   
    27.              }  
    28.          }  
    29.          String cdstr = StringUtils.join(rst.iterator(), ",");  
    30.          String cdstr1 = StringUtils.join(rst1.iterator(),",");  
    31.         // 查询总积分  
    32.           
    33.         if (cdstr != null && cdstr.length() > 0) {  
    34.             if (cdstr1 !=null && cdstr1.length()>0){  
    35.                  String hql = "select tot_cash from TotalCashPromotionData as tot_cash where tot_cash.groupUserInfo.groupUserCode in ("  
    36.                      + cdstr + ") or tot_cash.groupUserInfo.groupUserCode in ("+cdstr1+")";  
    37.                 return this.paginatedDAO.getPaginatedList(hql, page, pageSize);  
    38.              }else{  
    39.                  String hql = "select tot_cash from TotalCashPromotionData as tot_cash where tot_cash.groupUserInfo.groupUserCode in ("  
    40.                      + cdstr + ")";  
    41.                 return this.paginatedDAO.getPaginatedList(hql, page, pageSize);  
    42.              }  
    43.               
    44.          } else {  
    45.              String hql = "select tot_cash from TotalCashPromotionData as tot_cash where tot_cash.groupUserInfo.groupUserCode in ('0')";  
    46.             return this.paginatedDAO.getPaginatedList(hql, page, pageSize);  
    47.          }  
  • 相关阅读:
    uniapp 基于 flyio 的 http 请求封装
    微信小程序实现连续扫码功能(uniapp)
    定时器+echarts运行时间太长导致内存溢出页面崩溃
    vue2.0 + element ui 实现表格穿梭框
    js 不同时间格式介绍以及相互间的转换
    vue2.0+Element UI 表格前端分页和后端分页
    vue2.0 + Element UI + axios实现表格分页
    kafka能做什么?kafka集群配置 (卡夫卡 大数据)
    Java List和Map遍历的方法,forEach()的使用
    Flink 集群搭建,Standalone,集群部署,HA高可用部署
  • 原文地址:https://www.cnblogs.com/Snowolf/p/2186181.html
Copyright © 2011-2022 走看看