package com.fs.watch.mapper;

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

import java.util.List;
import java.util.Map;

/**
* @author Administrator
* @description 针对表【watch_heart_rate_data(设备心率数据)】的数据库操作Mapper
* @createDate 2024-10-15 11:06:50
* @Entity watch.domain.WatchHeartRateData
*/
@DataSource(DataSourceType.CLICKHOUSE)
public interface WatchHeartRateDataMapper{

    void insert(@Param("data")WatchHeartRateData data);

    Integer queryByCreateTime(@Param("createTime")String createTime);

    WatchHeartRateData queryByDeviceId(@Param("deviceId")String deviceId);

    List<WatchHeartRateData> queryByDate(@Param("date")String date, @Param("deviceId") String deviceId);

    List<WatchHeartRateData> list(@Param("startTime")String startTime,@Param("endTime") String endTime, @Param("deviceId")String deviceId);

    WatchHeartRateData getLatest(@Param("deviceId")String deviceId);

    List<WatchHeartRateData> queryHeartPageByDate(@Param("startTime")String startTime,@Param("endTime") String endTime,
                                                  @Param("deviceId")String deviceId,@Param("num")Integer num,
                                                  @Param("size")Integer size
    );

    int countHeartRateByDate(@Param("startTime")String startTime,@Param("endTime") String endTime,@Param("deviceId") String deviceId);

    List<Map<String, Object>> countBpByDate(@Param("startTime")String startTime, @Param("endTime") String endTime, @Param("deviceId")String deviceId);

    List<WatchHeartRateData> queryByMonth(@Param("deviceId")String deviceId, @Param("monthStr")String monthStr);
}
