package com.zjrs.ggfw.rlzysc.blo.impl;

import org.apache.commons.lang.StringUtils;
import com.zjrs.ggfw.rlzysc.blo.ZwssqScheduleTaskBLO;
import com.zjrs.ggfw.rlzysc.entity.RsRlzyZwssqMapper;
import com.zjrs.ggfw.rlzysc.po.ZyssqPO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import jakarta.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class ZwssqScheduleTaskBLOImpl implements ZwssqScheduleTaskBLO {

    private static final Logger LOG = LoggerFactory.getLogger(ZwssqScheduleTaskBLOImpl.class);

    @Resource
    RsRlzyZwssqMapper rsRlzyZwssqMapper;

    @Override
    public List<ZyssqPO> queryZwssq() {
        return this.rsRlzyZwssqMapper.queryZwssq();
    }


    @Override
    public List<Map> getZwxx(ZyssqPO po) {
        Map<String, Object> params = new HashMap<String, Object>();
        if (StringUtils.isNotBlank(po.getRsyhlsh())){
            params.put("yhlsh",po.getYhlsh());
        }
        if (StringUtils.isNotBlank(po.getFszws())){//请求的职位个数
            params.put("fszws",po.getFszws());
        }
        LOG.info("查询条件params==========================" + params.toString());
        return  rsRlzyZwssqMapper.getZwxx(params);
    }

    @Override
    public void updatedsqzxsj(String rsrlzyzyssqlsh) {
        Date date = new Date();
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
        String dataString = dateFormat.format(date);
        ZyssqPO po = new ZyssqPO();
        po.setDsqzxsj(dataString);
        rsRlzyZwssqMapper.updateById(po);
    }


}



