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.WyBeerCoinPlanMapper;
import com.ruoyi.brewery.domain.WyBeerCoinPlan;
import com.ruoyi.brewery.service.IWyBeerCoinPlanService;

/**
 * 啤酒币方案Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-12-21
 */
@Service
public class WyBeerCoinPlanServiceImpl implements IWyBeerCoinPlanService 
{
    @Autowired
    private WyBeerCoinPlanMapper wyBeerCoinPlanMapper;

    /**
     * 查询啤酒币方案
     * 
     * @param id 啤酒币方案主键
     * @return 啤酒币方案
     */
    @Override
    public WyBeerCoinPlan selectWyBeerCoinPlanById(Long id)
    {
        return wyBeerCoinPlanMapper.selectWyBeerCoinPlanById(id);
    }

    /**
     * 查询啤酒币方案列表
     * 
     * @param wyBeerCoinPlan 啤酒币方案
     * @return 啤酒币方案
     */
    @Override
    public List<WyBeerCoinPlan> selectWyBeerCoinPlanList(WyBeerCoinPlan wyBeerCoinPlan)
    {
        return wyBeerCoinPlanMapper.selectWyBeerCoinPlanList(wyBeerCoinPlan);
    }

    /**
     * 新增啤酒币方案
     * 
     * @param wyBeerCoinPlan 啤酒币方案
     * @return 结果
     */
    @Override
    public int insertWyBeerCoinPlan(WyBeerCoinPlan wyBeerCoinPlan)
    {
        wyBeerCoinPlan.setCreateTime(DateUtils.getNowDate());
        return wyBeerCoinPlanMapper.insertWyBeerCoinPlan(wyBeerCoinPlan);
    }

    /**
     * 修改啤酒币方案
     * 
     * @param wyBeerCoinPlan 啤酒币方案
     * @return 结果
     */
    @Override
    public int updateWyBeerCoinPlan(WyBeerCoinPlan wyBeerCoinPlan)
    {
        wyBeerCoinPlan.setUpdateTime(DateUtils.getNowDate());
        return wyBeerCoinPlanMapper.updateWyBeerCoinPlan(wyBeerCoinPlan);
    }

    /**
     * 批量删除啤酒币方案
     * 
     * @param ids 需要删除的啤酒币方案主键
     * @return 结果
     */
    @Override
    public int deleteWyBeerCoinPlanByIds(Long[] ids)
    {
        return wyBeerCoinPlanMapper.deleteWyBeerCoinPlanByIds(ids);
    }

    /**
     * 删除啤酒币方案信息
     * 
     * @param id 啤酒币方案主键
     * @return 结果
     */
    @Override
    public int deleteWyBeerCoinPlanById(Long id)
    {
        return wyBeerCoinPlanMapper.deleteWyBeerCoinPlanById(id);
    }
}
