package com.njcn.event.mapper.distribution;

import cn.hutool.core.date.DateTime;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njcn.event.pojo.param.UniversalFrontEndParam;
import com.njcn.event.pojo.po.EventDetailNew;
import com.njcn.event.pojo.po.RmpEventDetailPO;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 * 配网-暂态事件明细
 *
 * @author yzh
 * @date 2022/10/31
 */

public interface PwRmpEventDetailMapper extends BaseMapper<RmpEventDetailPO> {

    /**
     * 获取配网暂态事件明细
     *
     * @param param 条件参数
     * @return java.util.List<com.njcn.event.pojo.po.RmpEventDetailPO>
     * @author yzh
     * @date 2022/10/31
     */
    Page<RmpEventDetailPO> getPwRmpEventDetail(@Param("page")Page<RmpEventDetailPO> page,@Param("param") UniversalFrontEndParam param,
                                               @Param("monitorIdList") List<String> monitorIdList);

    /**
     * 获取暂态事件明细
     *
     * @param monitorIds 监测点id
     * @param eventType  暂态指标类型
     * @param startTime  开始时间
     * @param endTime    结束时间
     * @return 暂态事件明细
     */
    List<RmpEventDetailPO> getDetailsOfTransientEvents(@Param("monitorIds") List<String> monitorIds,
                                                       @Param("eventType") List<String> eventType,
                                                       @Param("startTime") String startTime,
                                                       @Param("endTime") String endTime);

    /***
     * 与上面的方法区别是日期精确到月 yy-MM
     * @author jianghaifei
     * @date 2022-10-31 16:27
     * @param monitorIds
     * @param eventType
     * @param startTime
     * @param endTime
     * @return java.util.List<com.njcn.event.pojo.po.RmpEventDetailPO>
     */
    List<RmpEventDetailPO> getDetailsOfTransientEventsByMonth(@Param("monitorIds") List<String> monitorIds,
                                                              @Param("eventType") List<String> eventType,
                                                              @Param("startTime") String startTime,
                                                              @Param("endTime") String endTime);

    Page<EventDetailNew> selectByIdAndValue(Page<EventDetailNew> page,
                                              @Param("list") List<String> lineList,
                                              @Param("beginTime") DateTime beginOfDay,
                                              @Param("endTime") DateTime endOfDay,
                                              @Param("waveType") List<String> waveType,
                                              @Param("eventReason") List<String> eventReason,
                                              @Param("eventType") List<String> eventType,
                                              @Param("eventValueMin") BigDecimal eventValueMin,
                                              @Param("eventValueMax") BigDecimal eventValueMax,
                                              @Param("persistMin") Integer persistMin,
                                              @Param("persistMax") Integer persistMax,
                                              @Param("severityMin") BigDecimal severityMin,
                                              @Param("severityMax") BigDecimal severityMax,
                                              @Param("fileFlag") Integer fileFlag);
}
