package cn.cecep.talroad.service.impl.analysis;

import cn.cecep.talroad.domain.analysis.SRaHandworkEmissionsGas;
import cn.cecep.talroad.mapper.analysis.SRaHandworkEmissionsGasMapper;
import cn.cecep.talroad.service.analysis.ISRaHandworkEmissionsGasService;
import cn.cecep.talroad.vo.query.analysis.SRaHandworkEmissionsGasQuery;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;


/**
 * 手工监测排放监控-气污染要素Service业务层处理
 *
 * @author szhpt
 * @date 2023-03-24*/
@Service
public class SRaHandworkEmissionsGasServiceImpl extends ServiceImpl<SRaHandworkEmissionsGasMapper, SRaHandworkEmissionsGas> implements ISRaHandworkEmissionsGasService
{
    @Autowired
    private SRaHandworkEmissionsGasMapper sRaHandworkEmissionsGasMapper;

    /**
     * 查询手工监测排放监控-气污染要素列表
     *
     * @param sRaHandworkEmissionsGas 手工监测排放监控-气污染要素
     * @return 手工监测排放监控-气污染要素
     */
    @Override
    public List<SRaHandworkEmissionsGas> selectSRaHandworkEmissionsGasList(SRaHandworkEmissionsGasQuery sRaHandworkEmissionsGas)
    {
        DateTime startTime = DateUtil.parse(sRaHandworkEmissionsGas.getMonitorTimeStart()+" 00:00:00", "yyyy-MM-dd HH:mm:ss");
        DateTime endTime = DateUtil.parse(sRaHandworkEmissionsGas.getMonitorTimeEnd()+" 23:59:59", "yyyy-MM-dd HH:mm:ss");
        DateTime cycStartTime = DateUtil.parse(sRaHandworkEmissionsGas.getCheckCycleStart()+" 00:00:00", "yyyy-MM-dd HH:mm:ss");
        DateTime cycEndTime = DateUtil.parse(sRaHandworkEmissionsGas.getCheckCycleEnd()+" 23:59:59", "yyyy-MM-dd HH:mm:ss");
        return sRaHandworkEmissionsGasMapper.selectSRaHandworkEmissionsGasList(sRaHandworkEmissionsGas,startTime,endTime,cycStartTime,cycEndTime);
    }

    @Override
    public List<Map<String, String>> pullPointOptions() {
        return sRaHandworkEmissionsGasMapper.pullPointOptions();
    }

    @Override
    public List<Map<String, String>> pullPollutantOptions() {
        return sRaHandworkEmissionsGasMapper.pullPollutantOptions();
    }
}
