package cn.cecep.talroad.mapper;

import cn.cecep.talroad.domain.AmProblemFi;
import cn.cecep.talroad.domain.AmProblemFiVideo;
import cn.cecep.talroad.vo.AmProblemFiVo;
import cn.cecep.talroad.vo.analysis.FactoryOutletStaticsVo;
import cn.cecep.talroad.vo.query.AmProblemFiQuery;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;
import java.util.Map;

@Mapper
public interface AmProblemFiMapper extends BaseMapper<AmProblemFi>
{

    List<Map<String, Object>> selectChartData(@Param("chartDataParam") AmProblemFiQuery.ChartDataParam chartDataParam, @Param("regionCodes") List<String> regionCodes);

    List<AmProblemFiVo> selectProblemFiPage(@Param("page") Page<AmProblemFiVo> page, @Param("query") AmProblemFiQuery query);

    List<AmProblemFiVo> selectProblemFiList(@Param("query") AmProblemFiQuery query);

    List<Map<String, Object>> selectTrendData(AmProblemFiQuery.ChartDataParam param);

    List<String> selectByLastTimeAlarm(@Param("pointCode") String pointCode, @Param("startTime") String startTime, @Param("endTime") String endTime);

    Integer selectCountByParams(@Param("amProblemFi") AmProblemFi amProblemFi);

    void insertAmProblemFis(List<AmProblemFi> amProblemFis);

    List<AmProblemFiVideo.Vo> selectAmProblemFiVideo(String id);

    List<AmProblemFi> getProblemByTypeAndTime(@Param("problemType") String problemType, @Param("dateStr") String dateStr, @Param("dateStrEnd") String dateStrEnd);

  List<AmProblemFi> selectAmProblemFiByFactoriesIds(
      @Param("ids") List<String> factoriesIds,
      @Param("startTime") Date startTime,
      @Param("endTime") Date endTime,
      @Param("list") List<String> problemType);

  List<String> selectAmProblemFiFactoriesIdsByDate(
      @Param("startTime") Date startTime,
      @Param("endTime") Date endTime,
      @Param("list") List<String> problemType);

  List<AmProblemFi> selectPollutionWaterData(@Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime);

    List<FactoryOutletStaticsVo> selectStatisDataByMonth(@Param("startTime") Date startTime, @Param("endTime") Date endTime);
}
