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

import cn.hutool.core.date.DateTime;
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
import com.njcn.device.pq.pojo.po.PqsTopMsg;
import com.njcn.prepare.harmonic.bo.TopMsgPO;
import com.njcn.prepare.harmonic.pojo.mysql.po.line.AlarmPO;
import com.njcn.prepare.harmonic.pojo.mysql.po.line.AlarmStrategyVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface DeviceAbnormaStatisticsMapper extends MppBaseMapper<PqsTopMsg>{

    /**
     * 获取所有有等级监测点以及对应设备
     * @return List<AlarmPO>
     */
    List<AlarmPO> getLines();

    /**
     * 获取所有有等级监测点以及对应设备
     * @return List<AlarmPO>
     */
    List<AlarmPO> getLinesById(@Param("list") List<String> list);

    List<AlarmPO> getFlowByDevice(@Param("list") List<String> list, @Param("time") String startTime);

    List<AlarmPO> getIntegrityByLineIds(@Param("list") List<String> list, @Param("startTime") DateTime startTime, @Param("endTime") DateTime endTime);

    /**
     * 告警信息
     * @param monitorIds
     * @param devIds
     * @param startTime
     * @param endTime
     * @return
     */
    List<AlarmPO> getAlarmByLines(@Param("monitorIds") List<String> monitorIds,@Param("devIds") List<String> devIds,@Param("startTime") DateTime startTime, @Param("endTime") DateTime endTime);

    Boolean insertTopMsg(@Param("list") List<TopMsgPO> topMsgPOS);

    List<AlarmStrategyVO> selectAlarmStrategy();

    List<AlarmPO> getOnlineRateByDevice(@Param("list") List<String> devIds, @Param("startTime") DateTime beginOfDay,  @Param("endTime") DateTime endOfDay);
}
