package com.ruoyi.buyerapi.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.buyerapi.mapper.BuyerPolicyMapper;
import com.ruoyi.buyerapi.domain.BuyerPolicy;
import com.ruoyi.buyerapi.service.IBuyerPolicyService;

/**
 * 加计扣除相关政策Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-09-19
 */
@Service
public class BuyerPolicyServiceImpl implements IBuyerPolicyService 
{
    @Autowired
    private BuyerPolicyMapper buyerPolicyMapper;

    /**
     * 查询加计扣除相关政策
     * 
     * @param id 加计扣除相关政策主键
     * @return 加计扣除相关政策
     */
    @Override
    public BuyerPolicy selectBuyerPolicyById(String id)
    {
        return buyerPolicyMapper.selectBuyerPolicyById(id);
    }

    /**
     * 查询加计扣除相关政策列表
     * 
     * @param buyerPolicy 加计扣除相关政策
     * @return 加计扣除相关政策
     */
    @Override
    public List<BuyerPolicy> selectBuyerPolicyList(BuyerPolicy buyerPolicy)
    {
        return buyerPolicyMapper.selectBuyerPolicyList(buyerPolicy);
    }

    /**
     * 新增加计扣除相关政策
     * 
     * @param buyerPolicy 加计扣除相关政策
     * @return 结果
     */
    @Override
    public int insertBuyerPolicy(BuyerPolicy buyerPolicy)
    {
        buyerPolicy.setCreateTime(DateUtils.getNowDate());
        return buyerPolicyMapper.insertBuyerPolicy(buyerPolicy);
    }

    /**
     * 修改加计扣除相关政策
     * 
     * @param buyerPolicy 加计扣除相关政策
     * @return 结果
     */
    @Override
    public int updateBuyerPolicy(BuyerPolicy buyerPolicy)
    {
        buyerPolicy.setUpdateTime(DateUtils.getNowDate());
        return buyerPolicyMapper.updateBuyerPolicy(buyerPolicy);
    }

    /**
     * 批量删除加计扣除相关政策
     * 
     * @param ids 需要删除的加计扣除相关政策主键
     * @return 结果
     */
    @Override
    public int deleteBuyerPolicyByIds(String[] ids)
    {
        return buyerPolicyMapper.deleteBuyerPolicyByIds(ids);
    }

    /**
     * 删除加计扣除相关政策信息
     * 
     * @param id 加计扣除相关政策主键
     * @return 结果
     */
    @Override
    public int deleteBuyerPolicyById(String id)
    {
        return buyerPolicyMapper.deleteBuyerPolicyById(id);
    }
}
