package com.fs.watch.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.fs.watch.domain.WatchDeviceDay;
import org.apache.ibatis.annotations.Param;

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

/**
 * 每天设备信息汇总Mapper接口
 *
 * @author fs
 * @date 2025-04-23
 */
public interface WatchDeviceDayMapper extends BaseMapper<WatchDeviceDay>{
    /**
     * 查询每天设备信息汇总
     *
     * @param id 每天设备信息汇总主键
     * @return 每天设备信息汇总
     */
    WatchDeviceDay selectWatchDeviceDayById(Long id);

    /**
     * 查询每天设备信息汇总列表
     *
     * @param watchDeviceDay 每天设备信息汇总
     * @return 每天设备信息汇总集合
     */
    List<WatchDeviceDay> selectWatchDeviceDayList(WatchDeviceDay watchDeviceDay);

    /**
     * 新增每天设备信息汇总
     *
     * @param watchDeviceDay 每天设备信息汇总
     * @return 结果
     */
    int insertWatchDeviceDay(WatchDeviceDay watchDeviceDay);

    /**
     * 修改每天设备信息汇总
     *
     * @param watchDeviceDay 每天设备信息汇总
     * @return 结果
     */
    int updateWatchDeviceDay(WatchDeviceDay watchDeviceDay);

    /**
     * 修改每天设备信息汇总
     *
     * @param watchDeviceDay 每天设备信息汇总
     * @return 结果
     */
    int updateByDeviceIdAndTime(WatchDeviceDay watchDeviceDay);

    /**
     * 删除每天设备信息汇总
     *
     * @param id 每天设备信息汇总主键
     * @return 结果
     */
    int deleteWatchDeviceDayById(Long id);

    /**
     * 批量删除每天设备信息汇总
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    int deleteWatchDeviceDayByIds(Long[] ids);

    WatchDeviceDay selectWatchDeviceDayByDeviceIdAndTime(@Param("deviceId") String deviceId,@Param("createTime") Date createTime);

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