package com.njcn.prepare.harmonic.mapper.mysql.line;

import cn.hutool.core.date.DateTime;
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
import com.njcn.event.pojo.po.RMpEventDetailD;
import com.njcn.event.pojo.po.RMpEventDetailM;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDate;
import java.util.List;
import java.util.Map;

/**
 * Description:
 * 接口文档访问地址：http://serverIP:port/swagger-ui.html
 * Date: 2022/12/28  14:58【需求编号】
 *
 * @author clam
 * @version V1.0.0
 */
@Mapper
public interface RMpEventDetailDMapper extends MppBaseMapper<RMpEventDetailD> {

    int getSagTimes(@Param("lineId") String lineId, @Param("date") LocalDate date);

    int getInterruptTimes(@Param("lineId") String lineId, @Param("date") LocalDate date);

    Map<String, Object> getSumAndCount(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("lineIds") List<String> lineIds);


    /***
     * 处理在暂态指标明细——月报表数据获取
     * @author hongawen
     * @date 2023/11/2 10:54
     * @param lineIds 监测点集合
     * @param dataDate 统计日期
     * @param beginMonth 起始时间
     * @param endMonth 截止时间
     * @return List<RMpEventDetailDPO>
     */
    List<RMpEventDetailM> handleMonth(@Param("lineIds") List<String> lineIds, @Param("dataDate") String dataDate, @Param("beginMonth") DateTime beginMonth, @Param("endMonth") DateTime endMonth);
}