package weaver.formmode.recruit.customsearch;

import org.apache.commons.lang3.StringUtils;
import weaver.formmode.customjavacode.AbstractCustomSqlConditionJavaCode;
import weaver.general.Util;

import java.util.Map;

/**
 * 招聘流程，浏览按钮条件
 *
 * @author:dxfeng
 * @createTime: 2024/10/15
 * @version: 1.0
 */
public class RecruitFlowSearchTemplate extends AbstractCustomSqlConditionJavaCode {
    @Override
    public String generateSqlCondition(Map<String, Object> param) {
        // 只展示启用的数据
        String whereSql = " t1.lczt = 0 ";
        Map<String, String> extensionParam = (Map<String, String>) param.get("extensionParam");
        String flowId = Util.null2String(extensionParam.get("flowId"));
        if (StringUtils.isNotBlank(flowId)) {
            whereSql += " and t1.id = '" + flowId + "' ";
        }
        return whereSql;
    }
}
