package weaver.interfaces.shuzhi.cronjob;

import weaver.conn.RecordSet;
import weaver.general.BaseBean;
import weaver.interfaces.schedule.BaseCronJob;

/**
 * 定时更新人员简历黑名单状态
 *
 * @author:dxfeng
 * @createTime: 2023/06/05
 * @version: 1.0
 */
public class SyncBlackListJob extends BaseCronJob {
    // TODO 正式、测试表名切换
    private static final String TABLE_NAME = "edc_uf_table160";

    @Override
    public void execute() {
        new BaseBean().writeLog("######定时更新人员简历黑名单状态,任务开始######");
        RecordSet rs = new RecordSet();
        // 通过身份证号更新候选人信息台账
        String sql = "update " + TABLE_NAME + " set sfhmd = 0 where field004 in(select sfzh from uf_hmdk)";
        rs.executeUpdate(sql);
        // 通过手机号码更新候选人信息台账
        sql = "update " + TABLE_NAME + " set sfhmd = 0 where field005 in(select sjhm from uf_hmdk)";
        rs.executeUpdate(sql);
        new BaseBean().writeLog("######定时更新人员简历黑名单状态,任务结束######");
    }
}
