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 IdCardSexExportWhereStrategy implements ExportWhereStrategy {

    @Override
    public String spliceWhereStr(SignType signType, Map<String,String> columnMap, Map<Object, Object> searchParams, Object key) {
        StringBuilder columnStr = new StringBuilder();
        columnStr.append(" and  IF(mod(SUBSTR(")
                .append(columnMap.get(key))
                .append(",17,1),2),'1','2') ")
                .append(signType.getOperator())
                .append(" '")
                .append(searchParams.get(key))
                .append("'");
        return columnStr.toString();
    }
}
