package com.zksy.base.gas.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.zksy.base.gas.domain.GasMonitorData;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

/**
* @author Administrator
* @description 针对表【gas_monitor_data(可燃气体监测仪数据表)】的数据库操作Service
* @createDate 2025-09-19 14:51:16
*/
public interface GasMonitorDataService extends IService<GasMonitorData> {
    GasMonitorData getLatestByDeviceId(String deviceId);

    Map<String, Object> getDailyStats(String deviceId, LocalDate date);

    double getOnlineRate(String deviceId, LocalDate start, LocalDate end);

    List<GasMonitorData> getAlarms(String deviceId, LocalDateTime start, LocalDateTime end, double threshold);

    List<Map<String, Object>> getTrend(String deviceId, LocalDateTime start, LocalDateTime end);
    /**
     * 查询带报警位解析的监测数据
     */
    GasMonitorData getLatestWithAlarmBits(String deviceId);
    /**
     * 查询设备分组
     */
    List<String> getDeviceGroup();
}
