package com.xzzn.ems.service.impl;

import java.util.List;
import com.xzzn.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.xzzn.ems.mapper.EmsMqttTopicConfigMapper;
import com.xzzn.ems.domain.EmsMqttTopicConfig;
import com.xzzn.ems.service.IEmsMqttTopicConfigService;

/**
 * 站点topic配置Service业务层处理
 *
 * @author xzzn
 * @date 2025-11-06
 */
@Service
public class EmsMqttTopicConfigServiceImpl implements IEmsMqttTopicConfigService
{
    @Autowired
    private EmsMqttTopicConfigMapper emsMqttTopicConfigMapper;

    /**
     * 查询站点topic配置
     *
     * @param id 站点topic配置主键
     * @return 站点topic配置
     */
    @Override
    public EmsMqttTopicConfig selectEmsMqttTopicConfigById(Long id)
    {
        return emsMqttTopicConfigMapper.selectEmsMqttTopicConfigById(id);
    }

    /**
     * 查询站点topic配置列表
     *
     * @param emsMqttTopicConfig 站点topic配置
     * @return 站点topic配置
     */
    @Override
    public List<EmsMqttTopicConfig> selectEmsMqttTopicConfigList(EmsMqttTopicConfig emsMqttTopicConfig)
    {
        return emsMqttTopicConfigMapper.selectEmsMqttTopicConfigList(emsMqttTopicConfig);
    }

    /**
     * 新增站点topic配置
     *
     * @param emsMqttTopicConfig 站点topic配置
     * @return 结果
     */
    @Override
    public int insertEmsMqttTopicConfig(EmsMqttTopicConfig emsMqttTopicConfig)
    {
        emsMqttTopicConfig.setCreateTime(DateUtils.getNowDate());
        return emsMqttTopicConfigMapper.insertEmsMqttTopicConfig(emsMqttTopicConfig);
    }

    /**
     * 修改站点topic配置
     *
     * @param emsMqttTopicConfig 站点topic配置
     * @return 结果
     */
    @Override
    public int updateEmsMqttTopicConfig(EmsMqttTopicConfig emsMqttTopicConfig)
    {
        emsMqttTopicConfig.setUpdateTime(DateUtils.getNowDate());
        return emsMqttTopicConfigMapper.updateEmsMqttTopicConfig(emsMqttTopicConfig);
    }

    /**
     * 批量删除站点topic配置
     *
     * @param ids 需要删除的站点topic配置主键
     * @return 结果
     */
    @Override
    public int deleteEmsMqttTopicConfigByIds(Long[] ids)
    {
        return emsMqttTopicConfigMapper.deleteEmsMqttTopicConfigByIds(ids);
    }

    /**
     * 删除站点topic配置信息
     *
     * @param id 站点topic配置主键
     * @return 结果
     */
    @Override
    public int deleteEmsMqttTopicConfigById(Long id)
    {
        return emsMqttTopicConfigMapper.deleteEmsMqttTopicConfigById(id);
    }
}
