package com.zksy.base.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zksy.base.domain.EquipmentStatus;
import com.zksy.manhole.dto.in.EquipmentStatusInDTO;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public interface EquipmentStatusService extends IService<EquipmentStatus> {

    Page<EquipmentStatus> findByPage(long pageNum, long pageSize, String statusId,String equipmentId,Integer currentStatus,Integer alarmStatus,Integer onlineStatus,Long userId);
    /**
     * 批量新增仪器状态
     * @param entityList
     * @return
     */
    boolean saveBatchWithCheck(List<EquipmentStatus> entityList);

    /**
     * 新增仪器状态
     * @param entity
     * @return
     */
    boolean saveWithCheck(EquipmentStatus entity);

    /**
     * 修改仪器状态
     * @param entity
     * @return
     */
    boolean updateWithCheck(EquipmentStatus entity);

    /**
     * 修改设备状态
     * @param inDTO
     * @return
     */
    boolean updateDeviceStatus(EquipmentStatusInDTO inDTO);

    /**
     * 根据设备编码（deviceCode）查询设备状态
     * <p>
     * 先通过 equipment_base 表找到 equipmentId，再查询 equipment_status 表。
     *
     * @param deviceCode 设备编码
     * @return 设备状态，未找到返回 null
     */
    EquipmentStatus getByDeviceCode(String deviceCode);
}
