package com.bcxin.ars.export;

import com.bcxin.ars.enums.SignType;
import java.util.Map;

public class IsHaveTaskExportWhereStrategy implements ExportWhereStrategy {
    @Override
    public String spliceWhereStr(SignType signType, Map<String,String> columnMap, Map<Object, Object> searchParams, Object key) {
        StringBuilder columnStr = new StringBuilder();
        if("1".equals(searchParams.get(key))){
            columnStr.append(" and (\n" +
                    "          SELECT\n" +
                    "          count(1)\n" +
                    "          FROM com_task ct\n" +
                    "          where t1.comContractId = ct.comContractId and ct.isDelete ='0'\n" +
                    "          ) > 0");

        }else{
            columnStr.append(" and  (\n" +
                    "          SELECT\n" +
                    "          count(1)\n" +
                    "          FROM com_task ct\n" +
                    "          where t1.comContractId = ct.comContractId and ct.isDelete ='0'\n" +
                    "          ) = 0");

        }
        return columnStr.toString();
    }
}
