package com.fs.watch.mapper;

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

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

/**
* @author Administrator
* @description 针对表【watch_third_bp_data(设备三方血压)】的数据库操作Mapper
* @createDate 2024-10-15 11:06:51
* @Entity watch.domain.WatchThirdBpData
*/
@DataSource(DataSourceType.CLICKHOUSE)
public interface WatchThirdBpDataMapper{


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

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

    List<WatchThirdBpData> queryByDateAndDeviceId(@Param("date")String date, @Param("deviceId")String deviceId);

    List<WatchThirdBpData> queryBpByDate(@Param("startTime")String startTime, @Param("endTime")String endTime,
                                         @Param("deviceId") String deviceId, @Param("status")Integer status);


    WatchThirdBpData getLastByDeviceId(String deviceId);

    WatchThirdBpData getLast(String deviceId);

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

    int countBpPageByDate(@Param("startTime") String startTime,
                          @Param("endTime") String endTime,
                          @Param("deviceId") String deviceId,
                          @Param("status") Integer status);

    List<WatchThirdBpData> queryBgPageByDate(@Param("startTime") String startTime,
                                             @Param("endTime") String endTime,
                                             @Param("deviceId") String deviceId,
                                             @Param("status") Integer status,
                                             @Param("num") Integer num,
                                             @Param("size") Integer size
    );

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