public Map<String,Map<String, Object>> getConsInfo(List<String> consIdList) { Map<String,Map<String,Object>> retMap = new HashMap<>(); if(consIdList == null || consIdList.size() == 0){ return null; } int len =consIdList.size(); int cnt = 20; for (int i = 0; i <= len/cnt; i++) { StringBuilder consIdsBuider = new StringBuilder(); for (int j = 0; j<cnt && i*cnt+j < len; j++) { consIdsBuider.append(",").append(consIdList.get(i*cnt+j)); } String consIds = consIdsBuider.toString().substring(1); } return retMap; }
最近写了一个sql查询in条件的拆分,但是没用到。记下来,避免以后用到的时候重新写