package com.fs.baidu.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fs.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fs.baidu.mapper.BdUnitMapper;
import com.fs.baidu.domain.BdUnit;
import com.fs.baidu.service.IBdUnitService;

/**
 * 百度推广单元Service业务层处理
 * 
 * @author fs
 * @date 2025-01-20
 */
@Service
public class BdUnitServiceImpl extends ServiceImpl<BdUnitMapper, BdUnit> implements IBdUnitService {

    /**
     * 查询百度推广单元
     * 
     * @param adgroupFeedId 百度推广单元主键
     * @return 百度推广单元
     */
    @Override
    public BdUnit selectBdUnitByAdgroupFeedId(Long adgroupFeedId)
    {
        return baseMapper.selectBdUnitByAdgroupFeedId(adgroupFeedId);
    }

    /**
     * 查询百度推广单元列表
     * 
     * @param bdUnit 百度推广单元
     * @return 百度推广单元
     */
    @Override
    public List<BdUnit> selectBdUnitList(BdUnit bdUnit)
    {
        return baseMapper.selectBdUnitList(bdUnit);
    }

    /**
     * 新增百度推广单元
     * 
     * @param bdUnit 百度推广单元
     * @return 结果
     */
    @Override
    public int insertBdUnit(BdUnit bdUnit)
    {
        bdUnit.setCreateTime(DateUtils.getNowDate());
        return baseMapper.insertBdUnit(bdUnit);
    }

    /**
     * 修改百度推广单元
     * 
     * @param bdUnit 百度推广单元
     * @return 结果
     */
    @Override
    public int updateBdUnit(BdUnit bdUnit)
    {
        bdUnit.setUpdateTime(DateUtils.getNowDate());
        return baseMapper.updateBdUnit(bdUnit);
    }

    /**
     * 批量删除百度推广单元
     * 
     * @param adgroupFeedIds 需要删除的百度推广单元主键
     * @return 结果
     */
    @Override
    public int deleteBdUnitByAdgroupFeedIds(Long[] adgroupFeedIds)
    {
        return baseMapper.deleteBdUnitByAdgroupFeedIds(adgroupFeedIds);
    }

    /**
     * 删除百度推广单元信息
     * 
     * @param adgroupFeedId 百度推广单元主键
     * @return 结果
     */
    @Override
    public int deleteBdUnitByAdgroupFeedId(Long adgroupFeedId)
    {
        return baseMapper.deleteBdUnitByAdgroupFeedId(adgroupFeedId);
    }
}
