package me.chyxion.tigon.mybatis;

import org.apache.commons.lang3.StringUtils;

/**
 * @author Donghuang <br>
 * donghuang@wacai.com <br>
 * Feb 23, 2017 17:58:09
 */
class AndSearchProcessor extends AbstractSearchProcessor {

    /**
     * {@inheritDoc}
     */
    @Override
    CriterionType type() {
        return CriterionType.AND;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    void doProcess(SearchProcessArgs args) {
        final Search search = args.getCriterion().getSearch();
        if (StringUtils.isBlank(search.table())) {
            search.table(args.getTable());
        }
        args.getResult().addAll(search.assemble(true));
    }
}
