package com.shzg.project.worn.service.impl;

import java.util.List;
import com.shzg.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.shzg.project.worn.mapper.MqttSensorCommandMapper;
import com.shzg.project.worn.domain.MqttSensorCommand;
import com.shzg.project.worn.service.IMqttSensorCommandService;

/**
 * 指令管理Service业务层处理
 * 
 * @author shzg
 * @date 2026-04-01
 */
@Service
public class MqttSensorCommandServiceImpl implements IMqttSensorCommandService 
{
    @Autowired
    private MqttSensorCommandMapper mqttSensorCommandMapper;

    /**
     * 查询指令管理
     * 
     * @param id 指令管理主键
     * @return 指令管理
     */
    @Override
    public MqttSensorCommand selectMqttSensorCommandById(Long id)
    {
        return mqttSensorCommandMapper.selectMqttSensorCommandById(id);
    }

    /**
     * 查询指令管理列表
     * 
     * @param mqttSensorCommand 指令管理
     * @return 指令管理
     */
    @Override
    public List<MqttSensorCommand> selectMqttSensorCommandList(MqttSensorCommand mqttSensorCommand)
    {
        return mqttSensorCommandMapper.selectMqttSensorCommandList(mqttSensorCommand);
    }

    /**
     * 新增指令管理
     * 
     * @param mqttSensorCommand 指令管理
     * @return 结果
     */
    @Override
    public int insertMqttSensorCommand(MqttSensorCommand mqttSensorCommand)
    {
        mqttSensorCommand.setCreateTime(DateUtils.getNowDate());
        return mqttSensorCommandMapper.insertMqttSensorCommand(mqttSensorCommand);
    }

    /**
     * 修改指令管理
     * 
     * @param mqttSensorCommand 指令管理
     * @return 结果
     */
    @Override
    public int updateMqttSensorCommand(MqttSensorCommand mqttSensorCommand)
    {
        mqttSensorCommand.setUpdateTime(DateUtils.getNowDate());
        return mqttSensorCommandMapper.updateMqttSensorCommand(mqttSensorCommand);
    }

    /**
     * 批量删除指令管理
     * 
     * @param ids 需要删除的指令管理主键
     * @return 结果
     */
    @Override
    public int deleteMqttSensorCommandByIds(Long[] ids)
    {
        return mqttSensorCommandMapper.deleteMqttSensorCommandByIds(ids);
    }

    /**
     * 删除指令管理信息
     * 
     * @param id 指令管理主键
     * @return 结果
     */
    @Override
    public int deleteMqttSensorCommandById(Long id)
    {
        return mqttSensorCommandMapper.deleteMqttSensorCommandById(id);
    }
}
