package ME.SM.OP.SM.AOP.MEC.SIQ.E; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; import java.math.BigDecimal; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import MS.OP.SM.AOP.MEC.SIQ.cache.DetaDBBufferCache_M; import OP.SM.AOP.MEC.SIQ.SM.reflection.Cell; import OP.SM.AOP.MEC.SIQ.SM.reflection.Row; import OP.SM.AOP.MEC.SIQ.SM.reflection.Table; import SVQ.stable.StableShellETL; @SuppressWarnings({ "unused", "unchecked"}) //作者,著作权人: 罗瑶光,浏阳 public class P_ConditionPLSQL_XCDX_Cache extends P_ConditionPLSQL_XCDX { public static void P_Cache(String[] sets, List> output , String tableName, String baseName, Map object) { Table table= DetaDBBufferCache_M.db.getBase(baseName).getTable(tableName); Iterator iterator= table.getRows().keySet().iterator(); int rowindex=0; while(iterator.hasNext()) { int count= rowindex++; String rowIndex= iterator.next(); Row row= table.getRow(rowIndex); Cell cell=new Cell(); cell.I_CellValue(rowIndex.replace("row", "")); row.putCell("Index", cell); if(sets[1].equalsIgnoreCase(StableShellETL.SHELL_ETL_SMALL) ||sets[1].equalsIgnoreCase(StableShellETL.SHELL_ETL_LESS_THAN)) { double rowCellFromBigDecimal= new BigDecimal(row.getCell(sets[0]) .getCellValue().toString()).doubleValue(); if(rowCellFromBigDecimal< new BigDecimal(sets[2]).doubleValue() && row.containsCell("is_delete_0")) { if(!((Map)(object.get("recordRows"))).containsKey(count)) { output.add(P_ConditionPLSQL_XCDX_Map.rowToRowMap(row)); Map recordRows = (Map) object.get("recordRows"); recordRows.put(count, true); } } } if(sets[1].equalsIgnoreCase(StableShellETL.SHELL_ETL_LESS_AND_EQUAL_TO) ||sets[1].equalsIgnoreCase(StableShellETL.SHELL_ETL_LESS_AND_EQUAL_TO_R) ||sets[1].equalsIgnoreCase(StableShellETL.SHELL_ETL_LESS_THAN_AND_EQUAL_TO)) { String set= sets[0]; Cell setCell= row.getCell(set); String cellString= setCell.getCellValue().toString(); cellString=cellString.isEmpty()? "0": cellString; double rowCellFromBigDecimal = new BigDecimal(cellString).doubleValue(); if(rowCellFromBigDecimal<= new BigDecimal(sets[2]).doubleValue() && row.containsCell("is_delete_0")) { if(!((Map)(object.get("recordRows"))).containsKey(count)) { output.add(P_ConditionPLSQL_XCDX_Map.rowToRowMap(row)); Map recordRows = (Map) object.get("recordRows"); recordRows.put(count, true); } } } if(sets[1].equalsIgnoreCase(StableShellETL.SHELL_ETL_DOUBLE_EQUALS) ||sets[1].equalsIgnoreCase(StableShellETL.SHELL_ETL_SIMPLE_EUQALS) ||sets[1].equalsIgnoreCase(StableShellETL.SHELL_ETL_TRIPAL_EQUALS)) { double rowCellFromBigDecimal = new BigDecimal(row.getCell(sets[0]) .getCellValue().toString()).doubleValue(); if(rowCellFromBigDecimal == new BigDecimal(sets[2]).doubleValue() && row.containsCell("is_delete_0")) { if(!((Map)(object.get("recordRows"))).containsKey(count)) { output.add(P_ConditionPLSQL_XCDX_Map.rowToRowMap(row)); Map recordRows = (Map) object.get("recordRows"); recordRows.put(count, true); } } } if(sets[1].equalsIgnoreCase(StableShellETL.SHELL_ETL_GREATER_AND_EQUAL_TO) ||sets[1].equalsIgnoreCase(StableShellETL.SHELL_ETL_GREATER_AND_EQUAL_TO_R) ||sets[1].equalsIgnoreCase(StableShellETL.SHELL_ETL_GREATER_THAN_AND_EQUAL_TO)) { double rowCellFromBigDecimal = new BigDecimal(row.getCell(sets[0]) .getCellValue().toString()).doubleValue(); if(rowCellFromBigDecimal >= new BigDecimal(sets[2]).doubleValue() && row.containsCell("is_delete_0")) { if(!((Map)(object.get("recordRows"))).containsKey(count)) { output.add(P_ConditionPLSQL_XCDX_Map.rowToRowMap(row)); Map recordRows = (Map) object.get("recordRows"); recordRows.put(count, true); } } } if(sets[1].equalsIgnoreCase(StableShellETL.SHELL_ETL_GREATER) ||sets[1].equalsIgnoreCase(StableShellETL.SHELL_ETL_GREATER_THAN)) { double rowCellFromBigDecimal = new BigDecimal(row.getCell(sets[0]) .getCellValue().toString()).doubleValue(); if(rowCellFromBigDecimal > new BigDecimal(sets[2]).doubleValue() && row.containsCell("is_delete_0")) { if(!((Map)(object.get("recordRows"))).containsKey(count)) { output.add(P_ConditionPLSQL_XCDX_Map.rowToRowMap(row)); Map recordRows = (Map) object.get("recordRows"); recordRows.put(count, true); } } } if(sets[1].equalsIgnoreCase(StableShellETL.SHELL_ETL_NOT_EUQAL_TO) ||sets[1].equalsIgnoreCase(StableShellETL.SHELL_ETL_NOT_EUQAL_TO_R)) { double rowCellFromBigDecimal = new BigDecimal(row.getCell(sets[0]) .getCellValue().toString()).doubleValue(); if(rowCellFromBigDecimal != new BigDecimal(sets[2]).doubleValue() && row.containsCell("is_delete_0")) { if(!((Map)(object.get("recordRows"))).containsKey(count)) { output.add(P_ConditionPLSQL_XCDX_Map.rowToRowMap(row)); Map recordRows = (Map) object.get("recordRows"); recordRows.put(count, true); } } } if(sets[1].equalsIgnoreCase(StableShellETL.SHELL_ETL_EQUAL) && row.containsCell("is_delete_0")) { String rowCellFromString = row.getCell(sets[0]).getCellValue().toString(); if(rowCellFromString.equalsIgnoreCase(sets[2])) { if(!((Map)(object.get("recordRows"))).containsKey(count)) { output.add(P_ConditionPLSQL_XCDX_Map.rowToRowMap(row)); Map recordRows = (Map) object.get("recordRows"); recordRows.put(count, true); } } } if(sets[1].equalsIgnoreCase(StableShellETL.SHELL_ETL_DOES_NOT_EQUALS)) { String rowCellFromString = row.getCell(sets[0]).getCellValue().toString(); if(!rowCellFromString.equalsIgnoreCase(sets[2]) && row.containsCell("is_delete_0")) { if(!((Map)(object.get("recordRows"))).containsKey(count)) { output.add(P_ConditionPLSQL_XCDX_Map.rowToRowMap(row)); Map recordRows = (Map) object.get("recordRows"); recordRows.put(count, true); } } } if(sets[1].equalsIgnoreCase((StableShellETL.SHELL_ETL_IN))) { String rowCellFromString = row.getCell(sets[0]).getCellValue().toString(); String set = "," + sets[2] + ","; if(set.contains("," + rowCellFromString + ",") && row.containsCell("is_delete_0")){ if(!((Map)(object.get("recordRows"))).containsKey(count)) { output.add(P_ConditionPLSQL_XCDX_Map.rowToRowMap(row)); Map recordRows = (Map) object.get("recordRows"); recordRows.put(count, true); } } } if(sets[1].equalsIgnoreCase(StableShellETL.SHELL_ETL_NOT_IN)) { String rowCellFromString = row.getCell(sets[0]).getCellValue().toString(); String set = "," + sets[2] + ","; if(!set.contains("," + rowCellFromString + ",") && row.containsCell("is_delete_0")){ if(!((Map)(object.get("recordRows"))).containsKey(count)) { output.add(P_ConditionPLSQL_XCDX_Map.rowToRowMap(row)); Map recordRows = (Map) object.get("recordRows"); recordRows.put(count, true); } } } } } }