class PartitionTable extends PartitionTableMetaData {

    public List<TargetTableEntity> execute(CalculateUnit calculateUnit) {
        // and 相连的条件
        Set<ConditionUnit/*column value*/> conditionUnits = calculateUnit.getTablesAndConditions().get(getLogicTableName());

        if (conditionUnits == null || conditionUnits.size() == 0){
            return null;
        }

        // 检查conditon

        List<TargetTableEntity> targetList = new ArrayList<TargetTableEntity>(1);

        for (PartitionColumn column : columns){
            ConditionUnit matchingConditon = findColumnFromConditions(conditionUnits, column.getName());
            // 寻找到了分区列
            if (matchingConditon != null){
                if (matchingConditon.getOperator() == ConditionUnitOperator.EQUAL){
                    // values
                    executeRule(targetList, rule.getFunction(), column, matchingConditon.getValues().get(0), conditionUnits);
                }else if (matchingConditon.getOperator() == ConditionUnitOperator.IN){
                    for (Object obj : matchingConditon.getValues()){
                        executeRule(targetList, rule.getFunction(), column, obj, conditionUnits);
                    }
                }
            }
            // 以第一个有结果的PartitionColumn为准,因为Baymax3.0规定，对于有多个分区列的，路由结果必须相同.
            if (targetList.size() != 0){
                break;
            }
        }
        return targetList;
    }

}