package com.ruoyi.rocketmq.service.impl;

import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.rocketmq.domain.InitialSwitchFanInfo;
import com.ruoyi.rocketmq.mapper.InitialSwitchFanInfoMapper;
import com.ruoyi.rocketmq.service.IInitialSwitchFanInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 风扇信息Service业务层处理
 * 
 * @author gyt
 * @date 2025-09-22
 */
@Service
public class InitialSwitchFanInfoServiceImpl implements IInitialSwitchFanInfoService 
{
    @Autowired
    private InitialSwitchFanInfoMapper initialSwitchFanInfoMapper;

    /**
     * 查询风扇信息
     * 
     * @param id 风扇信息主键
     * @return 风扇信息
     */
    @Override
    public InitialSwitchFanInfo selectInitialSwitchFanInfoById(Long id)
    {
        return initialSwitchFanInfoMapper.selectInitialSwitchFanInfoById(id);
    }

    /**
     * 查询风扇信息列表
     * 
     * @param initialSwitchFanInfo 风扇信息
     * @return 风扇信息
     */
    @Override
    public List<InitialSwitchFanInfo> selectInitialSwitchFanInfoList(InitialSwitchFanInfo initialSwitchFanInfo)
    {
        return initialSwitchFanInfoMapper.selectInitialSwitchFanInfoList(initialSwitchFanInfo);
    }

    /**
     * 新增风扇信息
     * 
     * @param initialSwitchFanInfo 风扇信息
     * @return 结果
     */
    @Override
    public int insertInitialSwitchFanInfo(InitialSwitchFanInfo initialSwitchFanInfo)
    {
        return initialSwitchFanInfoMapper.insertInitialSwitchFanInfo(initialSwitchFanInfo);
    }

    /**
     * 修改风扇信息
     * 
     * @param initialSwitchFanInfo 风扇信息
     * @return 结果
     */
    @Override
    public int updateInitialSwitchFanInfo(InitialSwitchFanInfo initialSwitchFanInfo)
    {
        initialSwitchFanInfo.setUpdateTime(DateUtils.getNowDate());
        return initialSwitchFanInfoMapper.updateInitialSwitchFanInfo(initialSwitchFanInfo);
    }

    /**
     * 批量删除风扇信息
     * 
     * @param ids 需要删除的风扇信息主键
     * @return 结果
     */
    @Override
    public int deleteInitialSwitchFanInfoByIds(Long[] ids)
    {
        return initialSwitchFanInfoMapper.deleteInitialSwitchFanInfoByIds(ids);
    }

    /**
     * 删除风扇信息信息
     * 
     * @param id 风扇信息主键
     * @return 结果
     */
    @Override
    public int deleteInitialSwitchFanInfoById(Long id)
    {
        return initialSwitchFanInfoMapper.deleteInitialSwitchFanInfoById(id);
    }
    /**
     * 批量新增风扇信息
     * @param list
     * @return
     */
    @Override
    public int insertBatchInitialSwitchFanInfo(List<InitialSwitchFanInfo> list) {
        return initialSwitchFanInfoMapper.insertBatchInitialSwitchFanInfo(list);
    }

    /**
     * 获取指定交换机的风扇名称
     * @param initialSwitchFanInfo
     * @return
     */
    @Override
    public List<Map> getAllFanName(InitialSwitchFanInfo initialSwitchFanInfo) {
        return initialSwitchFanInfoMapper.getAllFanName(initialSwitchFanInfo);
    }

    /**
     * 获取风扇基础信息
     * @param initialSwitchFanInfo
     * @return
     */
    @Override
    public List<InitialSwitchFanInfo> getFanMsg(InitialSwitchFanInfo initialSwitchFanInfo) {
        return initialSwitchFanInfoMapper.getFanMsg(initialSwitchFanInfo);
    }
}
