package com.fs.watch.mapper;

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

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

/**
* @author Administrator
* @description 针对表【watch_fatigue_data(设备疲劳度)】的数据库操作Mapper
* @createDate 2024-10-15 11:06:50
* @Entity watch.domain.WatchFatigueData
*/
public interface WatchFatigueDataMapper{
    @DataSource(DataSourceType.CLICKHOUSE)
    Integer queryByCreateTime(@Param("createTime") String createTime);

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

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

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

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

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

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