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.BdPlanMapper;
import com.fs.baidu.domain.BdPlan;
import com.fs.baidu.service.IBdPlanService;

/**
 * 百度计划Service业务层处理
 * 
 * @author fs
 * @date 2025-01-20
 */
@Service
public class BdPlanServiceImpl extends ServiceImpl<BdPlanMapper, BdPlan> implements IBdPlanService {

    /**
     * 查询百度计划
     * 
     * @param campaignFeedId 百度计划主键
     * @return 百度计划
     */
    @Override
    public BdPlan selectBdPlanByCampaignFeedId(Long campaignFeedId)
    {
        return baseMapper.selectBdPlanByCampaignFeedId(campaignFeedId);
    }

    /**
     * 查询百度计划列表
     * 
     * @param bdPlan 百度计划
     * @return 百度计划
     */
    @Override
    public List<BdPlan> selectBdPlanList(BdPlan bdPlan)
    {
        return baseMapper.selectBdPlanList(bdPlan);
    }

    /**
     * 新增百度计划
     * 
     * @param bdPlan 百度计划
     * @return 结果
     */
    @Override
    public int insertBdPlan(BdPlan bdPlan)
    {
        bdPlan.setCreateTime(DateUtils.getNowDate());
        return baseMapper.insertBdPlan(bdPlan);
    }

    /**
     * 修改百度计划
     * 
     * @param bdPlan 百度计划
     * @return 结果
     */
    @Override
    public int updateBdPlan(BdPlan bdPlan)
    {
        bdPlan.setUpdateTime(DateUtils.getNowDate());
        return baseMapper.updateBdPlan(bdPlan);
    }

    /**
     * 批量删除百度计划
     * 
     * @param campaignFeedIds 需要删除的百度计划主键
     * @return 结果
     */
    @Override
    public int deleteBdPlanByCampaignFeedIds(Long[] campaignFeedIds)
    {
        return baseMapper.deleteBdPlanByCampaignFeedIds(campaignFeedIds);
    }

    /**
     * 删除百度计划信息
     * 
     * @param campaignFeedId 百度计划主键
     * @return 结果
     */
    @Override
    public int deleteBdPlanByCampaignFeedId(Long campaignFeedId)
    {
        return baseMapper.deleteBdPlanByCampaignFeedId(campaignFeedId);
    }
}
