不同的库的不同的表之间的数据移植4

//组装查询语句 

        if(CollectionUtils.isNotEmpty(basicList)){

            Set<String> zuheSet = new HashSet<String>();

            //获取的Map:{table1*table2:"A as D,B as E,C as F",table3*table4:"O as X,P as Y,Q as Z"}

            Map<String, StringBuffer> sqlBuildMap = new HashMap<String, StringBuffer>();

            for(Map<String, Object> map : basicList){

                String tt = ObjectUtils.toString(map.get("t1"))+"#"+ObjectUtils.toString(map.get("t2"));

                if(!zuheSet.contains(tt)){

                    zuheSet.add(tt);

                    StringBuffer subBuffer = new StringBuffer(32);

                    subBuffer.append(map.get("f1")+" as "+map.get("f2"));

                    sqlBuildMap.put(tt, subBuffer);

                }else{

                    sqlBuildMap.get(tt).append(",").append(map.get("f1")+" as "+map.get("f2"));

                }

            }



你可能感兴趣的:(数据移植)