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

import cn.cecep.talroad.domain.analysis.SRaHandworkEmissionsWater;
import cn.cecep.talroad.mapper.analysis.SRaHandworkEmissionsWaterMapper;
import cn.cecep.talroad.service.analysis.ISRaHandworkEmissionsWaterService;
import cn.cecep.talroad.vo.query.analysis.SRaHandworkEmissionsWaterQuery;
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 SRaHandworkEmissionsWaterServiceImpl extends ServiceImpl<SRaHandworkEmissionsWaterMapper, SRaHandworkEmissionsWater> implements ISRaHandworkEmissionsWaterService
{
    @Autowired
    private SRaHandworkEmissionsWaterMapper sRaHandworkEmissionsWaterMapper;

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

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

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