package com.njcn.device.pq.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njcn.device.pq.pojo.param.TerminalCheckParam;
import com.njcn.device.pq.pojo.po.Alarm;
import com.njcn.device.pq.pojo.vo.TerminalAlarmVO;
import com.njcn.device.pq.pojo.vo.TerminalCheckVO;
import org.apache.ibatis.annotations.Param;

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

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author cdf
 * @since 2022-01-07
 */
public interface AlarmMapper extends BaseMapper<Alarm> {

    /**
     * 获取告警主列表sql
     * @author cdf
     * @date 2022/5/23
     */
    Page<TerminalAlarmVO> getAlarmInfo(Page<TerminalAlarmVO> page, @Param("startTime") LocalDateTime startTime, @Param("endTime")LocalDateTime endTime, @Param("flag")Integer flag, @Param("type")String type, @Param("alarmLevel") Integer alarmLevel, @Param("lineGrade") String lineGrade);

    /**
     * 获取告警详情
     * @author cdf
     * @date 2022/5/23
     */
    List<TerminalAlarmVO> getAlarmDetail(@Param("startTime") LocalDateTime startTime, @Param("endTime")LocalDateTime endTime, @Param("flag")Integer flag, @Param("type")String type, @Param("devLineId") String devLineId,@Param("processTime")LocalDateTime processTime);

    /**
     * 批量处理
     * @author cdf
     * @date 2022/5/23
     */
    boolean updateAlarmInfo(@Param("type")String type,@Param("devLineId")String devLineId,@Param("processTime")LocalDateTime processTime,@Param("userIndex")String userIndex);


    Page<TerminalCheckVO> terminalCheckPage(Page<TerminalCheckVO> page, @Param("terminalCheckParam")TerminalCheckParam terminalCheckParam);

}
