package com.tongran.rocketmq.service.impl;

import com.tongran.common.core.utils.DateUtils;
import com.tongran.rocketmq.domain.RmPppoeConfigSub;
import com.tongran.rocketmq.mapper.RmPppoeConfigSubMapper;
import com.tongran.rocketmq.service.IRmPppoeConfigSubService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * PPPoE配置子表Service业务层处理
 * 
 * @author tongran
 * @date 2025-12-29
 */
@Service
public class RmPppoeConfigSubServiceImpl implements IRmPppoeConfigSubService 
{
    @Autowired
    private RmPppoeConfigSubMapper rmPppoeConfigSubMapper;

    /**
     * 查询PPPoE配置子表
     * 
     * @param id PPPoE配置子表主键
     * @return PPPoE配置子表
     */
    @Override
    public RmPppoeConfigSub selectRmPppoeConfigSubById(Long id)
    {
        return rmPppoeConfigSubMapper.selectRmPppoeConfigSubById(id);
    }

    /**
     * 查询PPPoE配置子表列表
     * 
     * @param rmPppoeConfigSub PPPoE配置子表
     * @return PPPoE配置子表
     */
    @Override
    public List<RmPppoeConfigSub> selectRmPppoeConfigSubList(RmPppoeConfigSub rmPppoeConfigSub)
    {
        return rmPppoeConfigSubMapper.selectRmPppoeConfigSubList(rmPppoeConfigSub);
    }

    /**
     * 新增PPPoE配置子表
     * 
     * @param rmPppoeConfigSub PPPoE配置子表
     * @return 结果
     */
    @Override
    public int insertRmPppoeConfigSub(RmPppoeConfigSub rmPppoeConfigSub)
    {
        rmPppoeConfigSub.setCreateTime(DateUtils.getNowDate());
        return rmPppoeConfigSubMapper.insertRmPppoeConfigSub(rmPppoeConfigSub);
    }

    /**
     * 修改PPPoE配置子表
     * 
     * @param rmPppoeConfigSub PPPoE配置子表
     * @return 结果
     */
    @Override
    public int updateRmPppoeConfigSub(RmPppoeConfigSub rmPppoeConfigSub)
    {
        rmPppoeConfigSub.setUpdateTime(DateUtils.getNowDate());
        return rmPppoeConfigSubMapper.updateRmPppoeConfigSub(rmPppoeConfigSub);
    }

    /**
     * 批量删除PPPoE配置子表
     * 
     * @param ids 需要删除的PPPoE配置子表主键
     * @return 结果
     */
    @Override
    public int deleteRmPppoeConfigSubByIds(Long[] ids)
    {
        return rmPppoeConfigSubMapper.deleteRmPppoeConfigSubByIds(ids);
    }

    /**
     * 删除PPPoE配置子表信息
     * 
     * @param id PPPoE配置子表主键
     * @return 结果
     */
    @Override
    public int deleteRmPppoeConfigSubById(Long id)
    {
        return rmPppoeConfigSubMapper.deleteRmPppoeConfigSubById(id);
    }

    @Override
    public int updateRmPppoeConfigSubByVlan(RmPppoeConfigSub rmPppoeConfigSub) {
        return rmPppoeConfigSubMapper.updateRmPppoeConfigSubByVlan(rmPppoeConfigSub);
    }
}
