package com.aucma.base.service;

import com.aucma.base.domain.BaseDeviceParamVal;

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

/**
 * 统一旁路参数读取能力
 */
public interface IDeviceParamReadFacade {

    /**
     * 查询设备参数最新值
     */
    BaseDeviceParamVal getLatestParamValue(String deviceCode, String paramCode, String paramName);

    /**
     * 查询某个时间点附近的参数集
     */
    List<BaseDeviceParamVal> listParamsByTimePoint(String deviceCode, Date snapshotTime, int windowSeconds);

    /**
     * 对比两个时间点的参数差异
     */
    List<Map<String, Object>> compareParamsByTimePoint(String deviceCode, Date timePoint1, Date timePoint2, int windowSeconds);

    /**
     * 查询参数历史明细
     */
    List<BaseDeviceParamVal> listHistoryParamValues(String deviceCode, String paramCode, String paramName,
                                                    Date beginTime, Date endTime, Integer limit);

    /**
     * 按参数名集合查询参数历史明细
     */
    List<BaseDeviceParamVal> listHistoryParamValuesByNames(String deviceCode, List<String> paramNames,
                                                           Date beginTime, Date endTime, Integer limit);

    /**
     * 查询数值型历史值
     */
    List<Double> listNumericHistoryValues(String deviceCode, String paramCode, Date beginTime, Date endTime);
}
