package cn.cecep.talroad.mapper;

import cn.cecep.talroad.domain.PcOutlet;
import cn.cecep.talroad.domain.analysis.SRaOverWaterPollutionTraceability;
import cn.cecep.talroad.domain.analysis.SRaWaterPermittedOnline;
import cn.cecep.talroad.vo.*;
import cn.cecep.talroad.vo.analysis.SRaRealTimeAnalysicComsitMonitorVo;
import cn.cecep.talroad.vo.query.GasPEMonitoringPointQuery;
import cn.cecep.talroad.vo.query.PcOutletGasQuery;
import cn.cecep.talroad.vo.query.PcOutletQuery;
import cn.cecep.talroad.vo.query.analysis.SRaOverWaterPollutionTraceabilityQuery;
import cn.cecep.talroad.vo.query.analysis.SRaWaterPermittedOnlineQuery;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.HashMap;
import java.util.List;

/**
 * 废气有组织、无组织排口Mapper接口
 *
 * @author szhpt
 * @date 2023-01-11*/
@Mapper
public interface PcOutletMapper extends BaseMapper<PcOutlet>
{
    /**
     * 查询废气有组织、无组织排口列表
     *
     * @param pcOutlet 废气有组织、无组织排口
     * @return 废气有组织、无组织排口集合
     */
    public List<PcOutlet> selectPcOutletList(PcOutlet pcOutlet);

    /**
     *  查询地图点位
     * @param factoryId
     * @param pollutantType 污染物类型 1废气 2废水 3无组织
     * @return
     */
    List<MapPointVo> selectMapPoints(@Param("factoryId") String factoryId, @Param("pollutantType") String pollutantType);

    /**
     * 查询排污许可期限内的企业排口信息
     * @return
     */
    List<PcOutlet> selectPermitOutletList(@Param("pollutantType") String pollutantType,@Param("outletType") String outletType);

    List<PcOutlet> selectPointList(PcOutlet pcOutlet);

    List<PcOutlet> selectLabelRequirements();

    List<PcOutlet> selectLabelReceivingWaterObjective();

    List<PcOutlet> selectLabeRreceivingWaterName();

    List<PcOutlet> selectListByOnline(@Param("name") String name);

    List<EmissionsStatVo.PointRow> selectEmissionsStatPointList(@Param("search") EmissionsStatVo.PointSearch search);

    List<PcOutletGasVO> queryPcOutletGasList(Page<PcOutletGasVO> page, @Param("pcOutletGasQuery") PcOutletGasQuery pcOutletGasQuery, @Param("factoryId") String factoryId,@Param("pollutantOutletTypes") List<String> pollutantOutletTypes);

    Page<GasPEMonitoringPointVO> queryGasPEMonitoringPointList(Page<GasPEMonitoringPointVO> page, @Param("factoryId") String factoryId, @Param("gasPEMonitoringPointQuery") GasPEMonitoringPointQuery gasPEMonitoringPointQuery);

    IPage<SRaOverWaterPollutionTraceability> pageAndFactory(@Param("page")Page<PcOutlet> page, @Param("query") SRaOverWaterPollutionTraceabilityQuery query);

    List<HashMap<String, Object>> queryPcOutletsByPcFactoryId(@Param("factoryId") String facotryId, @Param("pollutantType") String pollutantType, @Param("pollutantOutletType") String pollutantOutletType, @Param("monitorPointName") String monitorPointName);

    List<PcOutlet> selectEnableList(@Param("factoryId") String factoryId,@Param("pollutantOutletType") String pollutantOutletType,@Param("portName")String portName);

    List<PcOutlet> selectEnableOutletList(String pollutantOutletType);

    PcOutlet getOutletByPoint(String stationId);

    List<PcOutlet> selectOnLinePoints(@Param("factoryId") String factoryId,@Param("pollutantType") String pollutantType);

    List<PcOutlet> selectByDevice(String deviceId);

    List<SRaWaterPermittedOnline> selectByOnlineAndSource(Page<?> page, @Param("lambdaQueryWrapper") SRaWaterPermittedOnlineQuery lambdaQueryWrapper);

    List<SRaWaterPermittedOnline> selectBySource(Page<?> page, @Param("lambdaQueryWrapper") SRaWaterPermittedOnlineQuery lambdaQueryWrapper);

    List<HashMap<String, Object>> sourceOutlets(@Param("factoryId") String factoryId, @Param("type") String type, @Param("pollutantOutletType") String pollutantOutletType, @Param("monitorPointName") String monitorPointName);

    List<SRaRealTimeAnalysicComsitMonitorVo> selectContrastPointList(Page<?> page, @Param("pcOutlet") SRaRealTimeAnalysicComsitMonitorVo pcOutlet);

    int updateBatchCoordinate(List<PcOutlet> pcOutletList);

    List<PcOutletVo.PwxkGas> selectPwxkList(@Param("factoryIds") List<String> factoryIds, @Param("query") PcOutletQuery.PwxkGas query);

    List<PcOutletVo.PwxkWaterDirect> selectPwxkWaterDirect(@Param("factoryIds") List<String> factoryIds, @Param("query") PcOutletQuery.PwxkWaterDirect query);

    List<PcOutletVo.PwxkWaterIndirect> selectPwxkWaterIndirect(@Param("factoryIds") List<String> factoryIds, @Param("query") PcOutletQuery.PwxkWaterIndirect query);
}
