package com.fs.watch.mapper;

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

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

/**
* @author Administrator
* @description 针对表【watch_third_ua_data(设备三方尿酸)】的数据库操作Mapper
* @createDate 2024-10-15 11:06:51
* @Entity watch.domain.WatchThirdUaData
*/
public interface WatchThirdUaDataMapper{


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

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

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

    @DataSource(DataSourceType.CLICKHOUSE)
    WatchThirdUaData getLatest(@Param("deviceId") String deviceId);

    @DataSource(DataSourceType.CLICKHOUSE)
    List<WatchThirdUaData> list(@Param("startTime")Date startTime,@Param("endTime") Date endTime,@Param("deviceId") String deviceId);

    @DataSource(DataSourceType.CLICKHOUSE)
    List<Map<String, Object>> countUaByDate(@Param("startTime")String startTime, @Param("endTime") String endTime, @Param("deviceId")String deviceId);

    @DataSource(DataSourceType.CLICKHOUSE)
    int countTotalDate(@Param("startTime")String startTime,
                       @Param("endTime") String endTime,
                       @Param("deviceId") String deviceId,
                       @Param("status")Integer status);

    @DataSource(DataSourceType.CLICKHOUSE)
    List<WatchThirdUaData> queryListByDate(@Param("startTime")String startTime,
                                           @Param("endTime") String endTime,
                                           @Param("deviceId")String deviceId,
                                           @Param("num")Integer num,
                                           @Param("size")Integer size,
                                           @Param("status")Integer status
                                           );
}
