package com.fs.watch.mapper;

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

import java.util.List;

/**
* @author Administrator
* @description 针对表【watch_continuous_spo2_data(设备连续的血氧数据)】的数据库操作Mapper
* @createDate 2024-10-15 11:06:50
* @Entity watch.domain.WatchContinuousSpo2Data
*/

@DataSource(DataSourceType.CLICKHOUSE)
public interface WatchContinuousSpo2DataMapper{


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

    void insert(@Param("data") WatchContinuousSpo2Data watchContinuousSpo2Data);

    WatchContinuousSpo2Data getLastByDeviceId(String deviceId);

    List<WatchContinuousSpo2Data> queryByDateAndDeviceIdAndState(@Param("date") String date, @Param("deviceId") String deviceId);

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

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

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

    List<WatchContinuousSpo2Data> querySpByDate(
            @Param("startTime") String startTime,
            @Param("endTime") String endTime,
            @Param("deviceId") String deviceId
    );

    List<WatchContinuousSpo2Data> queryOneByDateAndDeviceIdAndState(@Param("date")String date, @Param("deviceId")String deviceId);

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