手动分页。。

int count = 0;
        if(matchObject.size()>100){
            int pageSize = 98;
            int pageSum=(matchObject.size()-1)/pageSize+1;
            for(int i=0;i<pageSum;i++){
                int start = i*pageSize;
                int end = (i+1)*pageSize;
                if(end>matchObject.size()){
                    end = matchObject.size();
                }
                //subList 前闭后开
                count += mappingDAO.batchInsertPackage(matchObject.subList(start,end));
            }
            //count += mappingDAO.insert(matchObject.get(matchObject.size()));
        }else{
            return mappingDAO.batchInsertPackage(matchObject);
        }
        return count;
添加新评论