package com.fs.watch.mapper;

import com.fs.common.annotation.DataSource;
import com.fs.common.enums.DataSourceType;
import com.fs.watch.domain.WatchRriData;
import org.apache.ibatis.annotations.Param;

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

/**
* @author Administrator
* @description 针对表【watch_rri_data(设备心跳间隙数据，每分钟一个数据包)】的数据库操作Mapper
* @createDate 2024-10-15 11:06:51
* @Entity watch.domain.WatchRriData
*/
public interface WatchRriDataMapper{


    @DataSource(DataSourceType.CLICKHOUSE)
    void insert(@Param("data")WatchRriData data);

    @DataSource(DataSourceType.CLICKHOUSE)
    Integer queryByCreateTime(@Param("createTime")String createTime);

    @DataSource(DataSourceType.CLICKHOUSE)
    List<WatchRriData> getByDateAndDeviceId(@Param("date")String date, @Param("deviceId") String deviceId);

    @DataSource(DataSourceType.CLICKHOUSE)
    List<WatchRriData> getLastByDateAndDeviceId(@Param("time")String time, @Param("deviceId")String deviceId);

    @DataSource(DataSourceType.CLICKHOUSE)
    String getLastTime(@Param("deviceId")String deviceId);
}
