package com.ruoyi.rocketmq.service.impl;

import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.rocketmq.domain.InitialBandwidthTraffic;
import com.ruoyi.rocketmq.domain.InitialBandwidthTrafficTemp;
import com.ruoyi.rocketmq.mapper.InitialBandwidthTrafficTempMapper;
import com.ruoyi.rocketmq.service.IInitialBandwidthTrafficTempService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 初始带宽流量临时表Service业务层处理
 * 
 * @author gyt
 * @date 2025-11-05
 */
@Service
public class InitialBandwidthTrafficTempServiceImpl implements IInitialBandwidthTrafficTempService 
{
    @Autowired
    private InitialBandwidthTrafficTempMapper initialBandwidthTrafficTempMapper;

    /**
     * 查询初始带宽流量临时表
     * 
     * @param id 初始带宽流量临时表主键
     * @return 初始带宽流量临时表
     */
    @Override
    public InitialBandwidthTrafficTemp selectInitialBandwidthTrafficTempById(Long id)
    {
        return initialBandwidthTrafficTempMapper.selectInitialBandwidthTrafficTempById(id);
    }

    /**
     * 查询初始带宽流量临时表列表
     * 
     * @param initialBandwidthTrafficTemp 初始带宽流量临时表
     * @return 初始带宽流量临时表
     */
    @Override
    public List<InitialBandwidthTrafficTemp> selectInitialBandwidthTrafficTempList(InitialBandwidthTrafficTemp initialBandwidthTrafficTemp)
    {
        return initialBandwidthTrafficTempMapper.selectInitialBandwidthTrafficTempList(initialBandwidthTrafficTemp);
    }

    /**
     * 新增初始带宽流量临时表
     * 
     * @param initialBandwidthTrafficTemp 初始带宽流量临时表
     * @return 结果
     */
    @Override
    public int insertInitialBandwidthTrafficTemp(InitialBandwidthTrafficTemp initialBandwidthTrafficTemp)
    {
        initialBandwidthTrafficTemp.setCreateTime(DateUtils.getNowDate());
        return initialBandwidthTrafficTempMapper.insertInitialBandwidthTrafficTemp(initialBandwidthTrafficTemp);
    }

    /**
     * 修改初始带宽流量临时表
     * 
     * @param initialBandwidthTrafficTemp 初始带宽流量临时表
     * @return 结果
     */
    @Override
    public int updateInitialBandwidthTrafficTemp(InitialBandwidthTrafficTemp initialBandwidthTrafficTemp)
    {
        initialBandwidthTrafficTemp.setUpdateTime(DateUtils.getNowDate());
        return initialBandwidthTrafficTempMapper.updateInitialBandwidthTrafficTemp(initialBandwidthTrafficTemp);
    }

    /**
     * 批量删除初始带宽流量临时表
     * 
     * @param ids 需要删除的初始带宽流量临时表主键
     * @return 结果
     */
    @Override
    public int deleteInitialBandwidthTrafficTempByIds(Long[] ids)
    {
        return initialBandwidthTrafficTempMapper.deleteInitialBandwidthTrafficTempByIds(ids);
    }

    /**
     * 删除初始带宽流量临时表信息
     * 
     * @param id 初始带宽流量临时表主键
     * @return 结果
     */
    @Override
    public int deleteInitialBandwidthTrafficTempById(Long id)
    {
        return initialBandwidthTrafficTempMapper.deleteInitialBandwidthTrafficTempById(id);
    }

    @Override
    public int deleteTempMsgByClientId(String clientId) {
        return initialBandwidthTrafficTempMapper.deleteTempMsgByClientId(clientId);
    }

    @Override
    public int batchInsertServerTemp(List<InitialBandwidthTraffic> interfaces) {
        return initialBandwidthTrafficTempMapper.batchInsertServerTemp(interfaces);
    }
}
