package com.fs.watch.mapper;

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

import java.util.List;

/**
* @author Administrator
* @description 针对表【watch_ecg_data(设备心电数据，一次测量会分成很多包上传，同一次测量的心电数据包时间是一样的，可以通过时间分辨每一次测量的数据)】的数据库操作Mapper
* @createDate 2024-10-15 11:06:50
* @Entity watch.domain.WatchEcgData
*/
public interface WatchEcgDataMapper{

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

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

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

    @DataSource(DataSourceType.CLICKHOUSE)
    WatchEcgData getLastByDeviceId(String deviceId);
}
