package com.zcxk.rmcp.core.dao;

import com.zcxk.core.common.pojo.UserCondition;
import com.zcxk.rmcp.api.dto.alarm.DeviceAlarmQueryDto;
import com.zcxk.rmcp.api.vo.DeviceAlarmVo;
import com.zcxk.rmcp.core.entity.DeviceAlarm;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * @author linqingwei
 * @date 2021-08-06 15:42
 */
@Mapper
public interface DeviceAlarmMapper {
    int insertSelective(DeviceAlarm record);

    int updateByPrimaryKeySelective(DeviceAlarm record);

    int batchInsert(@Param("list") List<DeviceAlarm> list);

    List<DeviceAlarm> getLastDeviceErrorList(Long deviceId);

    List<DeviceAlarmVo> findList(@Param("dto") DeviceAlarmQueryDto dto, @Param("userCondition") UserCondition userCondition);

    int deleteByDeviceId(@Param("deviceIds") List<Long> deviceIds);
}