package com.yuchen.saas.park.service.fault.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuchen.saas.park.api.entity.device.PmgBatSmartEquipment;
import com.yuchen.saas.park.api.entity.fault.ConnectEvent;
import com.yuchen.saas.park.api.entity.fault.EquipmentStatus;
import com.yuchen.saas.park.api.vo.fault.DeviceProperty;
import com.yuchen.saas.park.api.vo.fault.EquipmentStatusVo;
import org.nest.springwrap.core.mp.base.BaseService;
import org.nest.springwrap.core.tool.api.R;

/**
 * @Author: 肖润飞
 * @CreateTime: 2022/10/18 15:27
 * @Description: 设备状态表
 * @Version: 1.0
 */
public interface EquipmentStatusService extends BaseService<EquipmentStatus> {

    /**
     * 保存设备的状态
     * @param deviceProperty 设备属性值
     * @param equipment 设备基础信息
     * @return
     */
    Boolean saveEquipmentStatus(DeviceProperty deviceProperty, PmgBatSmartEquipment equipment);

    /**
     * 根据设备离线事件保存离线
     * @param connectEvent 设备离线事件
     * @return
     */
    Boolean saveEquipmentEvent(ConnectEvent connectEvent);

    /**
     * 状态数据分页
     * @param page
     * @param vo
     * @return
     */
    R pageStatus(Page page, EquipmentStatusVo vo);

    /**
     * 设备状态详情
     * @param id 状态id
     * @return
     */
    R detail(Long id);
}
