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

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

/**
 * @Author: 肖润飞
 * @CreateTime: 2022/10/18 15:24
 * @Description: 设备故障规则
 * @Version: 1.0
 */
public interface EquipmentBreakdownRuleService extends BaseService<EquipmentBreakdownRule> {


    /**
     * 判断设备属性是否是故障属性
     * @param deviceProperty IOT传递的设备属性
     * @return String = null, 表示状态正常 ; String != null 表示状态异常 ,且 String = 设备异常code(breakdownCode)
     */
    EquipmentBreakdownRule checkEquipmentStatus(DeviceProperty deviceProperty);

    /**
     * 修改规则,并更新规则缓存
     * @param rule
     * @return
     */
    R updateRule(EquipmentBreakdownRule rule);

    /**
     * 规则分页
     * @param page
     * @param rule
     * @return
     */
    R pageVo(Page page, EquipmentBreakdownRule rule);

    /**
     * 新增规则
     * @param rule
     * @return
     */
    R saveRule(EquipmentBreakdownRule rule);

    /**
     * 删除规则
     * @param rule
     * @return
     */
    R deleteRule(EquipmentBreakdownRule rule);
}
