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.          }  
  • 相关阅读:
    卷积神经网络-目标探测-笔记
    卷积神经网络-目标分类简述
    深度学习-卷积神经网络的发展-笔记
    深度学习-卷积神经网络笔记
    深度学习-传统神经网络
    深度学习-初识深度学习-笔记
    数据结构-链式队列-C++
    查看线程的id名字正在运行的线程数量[getName()--ident--enumerate--activeCount]--线程池--协程(gevent)--优先级队列(LifoQueue)
    线程-线程的(锁、死锁现象、守护线程)
    ftp(网络传输)--BaseRequesHandler(tcp协议下的多个客户端连接)--urandom(随机生成字节字符串)--hmac(类似于hashlib)
  • 原文地址:https://www.cnblogs.com/Snowolf/p/2186181.html
Copyright © 2011-2022 走看看