@Test public void test_合并_AND条件() { TableNode table = new TableNode("TABLE1"); table.query("ID > 1 AND ID < 10"); table.build(); FilterPreProcessor.optimize(table, true); Assert.assertEquals(table.getWhereFilter().toString(), "(TABLE1.ID > 1 AND TABLE1.ID < 10)"); table.query("ID > 1 AND ID < 10 AND ID >= 2 AND ID < 11"); table.build(); FilterPreProcessor.optimize(table, true); Assert.assertEquals(table.getWhereFilter().toString(), "(TABLE1.ID >= 2 AND TABLE1.ID < 10)"); table.query("ID > 1 AND ID < 0"); table.build(); try { FilterPreProcessor.optimize(table, true); Assert.fail(); } catch (EmptyResultFilterException e) { } }
public static QueryTreeNode optimize(QueryTreeNode qtn, boolean typeConvert) throws QueryException { qtn = preProcess(qtn, typeConvert); return qtn; }
FilterPreProcessor { public static QueryTreeNode optimize(QueryTreeNode qtn, boolean typeConvert) throws QueryException { qtn = preProcess(qtn, typeConvert); return qtn; } }
FilterPreProcessor { public static QueryTreeNode optimize(QueryTreeNode qtn, boolean typeConvert) throws QueryException { qtn = preProcess(qtn, typeConvert); return qtn; }  }
FilterPreProcessor { public static QueryTreeNode optimize(QueryTreeNode qtn, boolean typeConvert) throws QueryException { qtn = preProcess(qtn, typeConvert); return qtn; }  static QueryTreeNode optimize(QueryTreeNode qtn, boolean typeConvert); }
FilterPreProcessor { public static QueryTreeNode optimize(QueryTreeNode qtn, boolean typeConvert) throws QueryException { qtn = preProcess(qtn, typeConvert); return qtn; }  static QueryTreeNode optimize(QueryTreeNode qtn, boolean typeConvert);  }