private void explanWhere(BoolFilterBuilder boolFilter, Where where) throws SqlParseException { while (where.getWheres().size() == 1) { where = where.getWheres().getFirst(); } if (where instanceof Condition) { addSubFilter(boolFilter, where, (BaseFilterBuilder) make((Condition) where)); } else { BoolFilterBuilder subFilter = FilterBuilders.boolFilter(); addSubFilter(boolFilter, where, subFilter); for (Where subWhere : where.getWheres()) { explanWhere(subFilter, subWhere); } } }
/** * 增加嵌套插 * * @param boolFilter * @param where * @param subFilter */ private void addSubFilter(BoolFilterBuilder boolFilter, Where where, BaseFilterBuilder subFilter) { if (where.getConn() == CONN.AND) { boolFilter.must(subFilter); } else { boolFilter.should(subFilter); } }