package com.fs.watch.mapper;

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

import java.util.List;

/**
 * @author Administrator
 * @description 针对表【watch_basic_info(设备基础数据)】的数据库操作Mapper
 * @createDate 2024-10-15 11:06:50
 * @Entity watch.domain.WatchBasicInfo
 */
public interface WatchBasicInfoMapper {

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

    @DataSource(DataSourceType.CLICKHOUSE)
    WatchBasicInfo queryByDeviceId(@Param("deviceId") String deviceId);

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


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

    @DataSource(DataSourceType.CLICKHOUSE)
    WatchBasicInfo getLastByDeviceId(String deviceId);

    @DataSource(DataSourceType.CLICKHOUSE)
    List<WatchBasicInfo> page(WatchDataQueryParam param);

    @DataSource(DataSourceType.CLICKHOUSE)
    List<WatchBasicInfo> queryGnssByDate(@Param("startTime")String startTime,@Param("endTime") String endTime, @Param("deviceId")String deviceId);
}
