package cn.cecep.talroad.mapper;

import cn.cecep.talroad.domain.SEnvGasMonHour;
import cn.cecep.talroad.domain.analysis.SRaWaterPermittedOnline;
import cn.cecep.talroad.vo.analysis.FactoryOutletStaticsVo;
import cn.cecep.talroad.vo.effective.SEnvGasMonValueVo;
import cn.cecep.talroad.vo.query.analysis.SRaWaterPermittedOnlineQuery;
import cn.hutool.core.date.DateTime;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Set;

/**
 * 废气监测数据Mapper接口
 *
 * @author szhpt
 * @date 2023-01-10*/
@Mapper
public interface SEnvGasMonHourMapper extends BaseMapper<SEnvGasMonHour>
{


    List<SEnvGasMonHour> selectLastHourData(@Param("pollutantOutletType") String pollutantOutletType,@Param("lastHour")String lastHour);

    /**
     * 查询大于入参日期 且 根据企业id 和排口id 分组 查询 所有污染物最大的值
     * @param dateTime
     * @return
     */
    List<SEnvGasMonHour> selectMaxProblemTypeByDateGroupFactoryIdAndOutletId(@Param("dateTime") String dateTime);

    List<SEnvGasMonHour> selectLastDayData(@Param("pollutantOutletType")String pollutantOutletType, @Param("lastDayBegin")Date lastDayBegin, @Param("lastDayEnd")Date lastDayEnd);

    List<SEnvGasMonValueVo> selectEntPollutionMapper(@Param("entId") String entId ,
                                                     @Param("start") Date start,
                                                     @Param("end") Date end,
                                                     @Param("groupBy") String groupBy);

    List<SEnvGasMonHour> selectSRaWaterPermittedOnlineListBy(SRaWaterPermittedOnlineQuery lambdaQueryWrapper);

    List<SEnvGasMonHour> selectSRaWaterSourceListBy(SRaWaterPermittedOnlineQuery lambdaQueryWrapper);

    List<SRaWaterPermittedOnline> selectSRaWaterSourceListByPoll(@Param("lambdaQueryWrapper") Set<String> lambdaQueryWrapper);

    List<FactoryOutletStaticsVo> selectLastDayCountData(@Param("lastDayBegin") DateTime queryBeginTime, @Param("lastDayEnd") DateTime queryEndTime);

    List<SEnvGasMonHour> selectHourDataByTime(@Param("factoryId") String factoryId, @Param("outletId") String monitorId, @Param("monitorTime") Date monitorTime);

    List<SEnvGasMonHour> selectManualSRaWaterPermittedOnlineListBy(SRaWaterPermittedOnlineQuery lambdaQueryWrapper);

    List<SEnvGasMonHour> selectManualSRaWaterSourceListBy(SRaWaterPermittedOnlineQuery lambdaQueryWrapper);
}
