package com.fs.watch.mapper;

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

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

/**
* @author Administrator
* @description 针对表【watch_sport_data(设备sport数据)】的数据库操作Mapper
* @createDate 2024-10-15 11:06:51
* @Entity watch.domain.WatchSportData
*/
@DataSource(DataSourceType.CLICKHOUSE)
public interface WatchSportDataMapper{
    Integer queryByCreateTime(@Param("createTime")String createTime);

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

    List<WatchSportData> getByDateAndDeviceId(@Param("date")String date,@Param("deviceId") String deviceId);

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

    List<WatchSportData> getByType(@Param("startTime")String startTime, @Param("endTime")String endTime,
                                   @Param("deviceId")String deviceId, @Param("type")String type);

    List<WatchSportRecordVo> queryRecord(@Param("startTime")Date startTime,
                                         @Param("endTime")Date endTime,
                                         @Param("deviceId")String deviceId,
                                         @Param("type")String type);

    WatchSportRecordVo getOtherData(@Param("startTime")Date startTime,
                                    @Param("endTime")Date endTime,
                                    @Param("deviceId")String deviceId,
                                    @Param("types") List<String> types);

    WatchSportData sumStepAndCalorie(@Param("deviceId")String deviceId);

    List<WatchSportData> getSport(@Param("deviceId")String deviceId,
                                  @Param("type") String type,
                                  @Param("queryType") String queryType);

    List<WatchSportData> getActivity(@Param("startTime")Date startTime, @Param("endTime")Date endTime, @Param("deviceId")String deviceId);

    List<WatchSportData> getOtherDetail(@Param("startTime")Date startTime,
                                        @Param("endTime")Date endTime,
                                        @Param("deviceId")String deviceId,
                                        @Param("types")List<String> types);
}
