package com.fs.watch.mapper;

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

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

/**
* @author Administrator
* @description 针对表【watch_temperature_data(设备温度数据)】的数据库操作Mapper
* @createDate 2024-10-15 11:06:51
* @Entity watch.domain.WatchTemperatureData
*/
@DataSource(DataSourceType.CLICKHOUSE)
public interface WatchTemperatureDataMapper{

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

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


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

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

    List<WatchTemperatureData> page(WatchDataQueryParam param);

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

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