package com.gyee.wisdom.alarm.sharding.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gyee.wisdom.alarm.sharding.entity.AlarmSnap;
import com.gyee.wisdom.alarm.sharding.entity.AlarmStat1;
import com.gyee.wisdom.alarm.sharding.entity.FaultSnap;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

@Repository
@Mapper
public interface FaultSnapMapper extends BaseMapper<FaultSnap> {

    FaultSnap findByAlarmSnapId(@Param("alarmSnapId") long alarmSnapId);

    int batchInsert(List<FaultSnap> list);

    void batchUpdate(List<FaultSnap> list);


    List<FaultSnap> queryMultiFaultSnap(@Param("ids") String[] snapIds) throws Exception;

    FaultSnap queryByTagId(@Param("tagId") String tagId);

    List<FaultSnap> queryByTimeAndStation(@Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("stationId") String stationId);

    List<FaultSnap> getTopNumFault(int topNum);
}

