package com.shzg.project.worn.service;

import java.util.List;
import com.shzg.project.worn.domain.MqttSensorDevice;

/**
 * MQTT设备Service接口
 * 
 * @author shzg
 * @date 2026-04-01
 */
public interface IMqttSensorDeviceService 
{
    /**
     * 查询MQTT设备
     * 
     * @param id MQTT设备主键
     * @return MQTT设备
     */
    public MqttSensorDevice selectMqttSensorDeviceById(Long id);

    /**
     * 查询MQTT设备列表
     * 
     * @param mqttSensorDevice MQTT设备
     * @return MQTT设备集合
     */
    public List<MqttSensorDevice> selectMqttSensorDeviceList(MqttSensorDevice mqttSensorDevice);

    /**
     * 查询 MQTT 缓存专用设备列表（不按在线/离线状态过滤）
     *
     * @return 设备集合
     */
    public List<MqttSensorDevice> selectAllForMqttCache();

    /**
     * 新增MQTT设备
     * 
     * @param mqttSensorDevice MQTT设备
     * @return 结果
     */
    public int insertMqttSensorDevice(MqttSensorDevice mqttSensorDevice);

    /**
     * 修改MQTT设备
     * 
     * @param mqttSensorDevice MQTT设备
     * @return 结果
     */
    public int updateMqttSensorDevice(MqttSensorDevice mqttSensorDevice);

    /**
     * 批量删除MQTT设备
     * 
     * @param ids 需要删除的MQTT设备主键集合
     * @return 结果
     */
    public int deleteMqttSensorDeviceByIds(Long[] ids);

    /**
     * 删除MQTT设备信息
     * 
     * @param id MQTT设备主键
     * @return 结果
     */
    public int deleteMqttSensorDeviceById(Long id);

    /**
     * 根据devEui查询设备
     * @param devEui
     * @return
     */
    MqttSensorDevice selectByDevEui(String devEui);

    /**
     * 更新设备在线状态（0在线 1离线）
     *
     * @param deviceId 设备ID
     * @param status 状态
     * @return 结果
     */
    int updateRuntimeStatus(Long deviceId, String status);
}
