package com.bcxin.ars.export;

import com.bcxin.ars.enums.SignType;

import java.util.Map;

/**
 * @author linqinglin
 * @date 2020/04/07 0007 9:20
 */
public class InExportWhereStrategy implements ExportWhereStrategy {

    @Override
    public String spliceWhereStr(SignType signType, Map<String,String> columnMap, Map<Object, Object> searchParams, Object key) {
        StringBuilder columnStr = new StringBuilder();
        if("0102".equals(searchParams.get(key))){
            columnStr.append(" and ")
                    .append(columnMap.get(key))
                    .append(" in ('0102','0105')");

        }else{
            columnStr.append(" and ")
                    .append(columnMap.get(key))
                    .append(signType.getOperator())
                    .append("( '")
                    .append(searchParams.get(key))
                    .append("' )");
        }

        return columnStr.toString();
    }
}
