package com.ruoyi.brewery.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.brewery.mapper.WyBrewerySharePlanMapper;
import com.ruoyi.brewery.domain.WyBrewerySharePlan;
import com.ruoyi.brewery.service.IWyBrewerySharePlanService;

/**
 * 品牌方分享方案Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-02-23
 */
@Service
public class WyBrewerySharePlanServiceImpl implements IWyBrewerySharePlanService 
{
    @Autowired
    private WyBrewerySharePlanMapper wyBrewerySharePlanMapper;

    /**
     * 查询品牌方分享方案
     * 
     * @param id 品牌方分享方案主键
     * @return 品牌方分享方案
     */
    @Override
    public WyBrewerySharePlan selectWyBrewerySharePlanById(Long id)
    {
        return wyBrewerySharePlanMapper.selectWyBrewerySharePlanById(id);
    }

    /**
     * 查询品牌方分享方案列表
     * 
     * @param wyBrewerySharePlan 品牌方分享方案
     * @return 品牌方分享方案
     */
    @Override
    public List<WyBrewerySharePlan> selectWyBrewerySharePlanList(WyBrewerySharePlan wyBrewerySharePlan)
    {
        return wyBrewerySharePlanMapper.selectWyBrewerySharePlanList(wyBrewerySharePlan);
    }

    /**
     * 新增品牌方分享方案
     * 
     * @param wyBrewerySharePlan 品牌方分享方案
     * @return 结果
     */
    @Override
    public int insertWyBrewerySharePlan(WyBrewerySharePlan wyBrewerySharePlan)
    {
        wyBrewerySharePlan.setCreateTime(DateUtils.getNowDate());
        return wyBrewerySharePlanMapper.insertWyBrewerySharePlan(wyBrewerySharePlan);
    }

    /**
     * 修改品牌方分享方案
     * 
     * @param wyBrewerySharePlan 品牌方分享方案
     * @return 结果
     */
    @Override
    public int updateWyBrewerySharePlan(WyBrewerySharePlan wyBrewerySharePlan)
    {
        wyBrewerySharePlan.setUpdateTime(DateUtils.getNowDate());
        return wyBrewerySharePlanMapper.updateWyBrewerySharePlan(wyBrewerySharePlan);
    }

    /**
     * 批量删除品牌方分享方案
     * 
     * @param ids 需要删除的品牌方分享方案主键
     * @return 结果
     */
    @Override
    public int deleteWyBrewerySharePlanByIds(Long[] ids)
    {
        return wyBrewerySharePlanMapper.deleteWyBrewerySharePlanByIds(ids);
    }

    /**
     * 删除品牌方分享方案信息
     * 
     * @param id 品牌方分享方案主键
     * @return 结果
     */
    @Override
    public int deleteWyBrewerySharePlanById(Long id)
    {
        return wyBrewerySharePlanMapper.deleteWyBrewerySharePlanById(id);
    }
}
