package ME.SM.OP.SM.AOP.MEC.SIQ.E; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import SVQ.stable.StableShellETL; @SuppressWarnings({"unused", "unchecked"}) //作者,著作权人: 罗瑶光,浏阳 public class P_GetCulumnsPLSQL { public static Object getCulumnsMapWithAs(String[] sets, Map row) { return row.get(sets[2]); } public static Object getCulumnsMap(String[] sets, Map row) { return row.get(sets[0]); } public static Object P_GetCulumnsMap(List> obj , String[] getCulumnsValueArray) { List> newobj = new ArrayList>(); Iterator> iterator = obj.iterator(); int count = 0; NextRow: while(iterator.hasNext()) { int rowId = count ++; Map row = iterator.next(); Map newRow = new HashMap<>(); Map rowValue = new HashMap<>(); NextCell: for(int i = 1; i < getCulumnsValueArray.length; i++) { String[] sets = getCulumnsValueArray[i].split("\\|"); if(null != sets && ((Map)row .get(StableShellETL.SHELL_ETL_ROWVALUE)).containsKey(sets[0])) { Map cell = (Map)((Map)row .get(StableShellETL.SHELL_ETL_ROWVALUE)).get(sets[0]); if(1 == sets.length) { rowValue.put(sets[0], cell); continue NextCell; } if(3 == sets.length && sets[1].equalsIgnoreCase("as")) { cell.put(StableShellETL.SHELL_ETL_CULUMNNAME, sets[2]); rowValue.put(sets[2], cell); continue NextCell; } } } newRow.put(StableShellETL.SHELL_ETL_ROWVALUE, rowValue); newobj.add(newRow); } obj.clear(); return obj.addAll(newobj); } } // i' m tin god