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.BuyerVoucherProjectMapper;
import com.ruoyi.buyerapi.domain.BuyerVoucherProject;
import com.ruoyi.buyerapi.service.IBuyerVoucherProjectService;

/**
 * 辅助帐凭证项目关系Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-09-22
 */
@Service
public class BuyerVoucherProjectServiceImpl implements IBuyerVoucherProjectService 
{
    @Autowired
    private BuyerVoucherProjectMapper buyerVoucherProjectMapper;

    /**
     * 查询辅助帐凭证项目关系
     * 
     * @param id 辅助帐凭证项目关系主键
     * @return 辅助帐凭证项目关系
     */
    @Override
    public BuyerVoucherProject selectBuyerVoucherProjectById(Long id)
    {
        return buyerVoucherProjectMapper.selectBuyerVoucherProjectById(id);
    }

    /**
     * 查询辅助帐凭证项目关系列表
     * 
     * @param buyerVoucherProject 辅助帐凭证项目关系
     * @return 辅助帐凭证项目关系
     */
    @Override
    public List<BuyerVoucherProject> selectBuyerVoucherProjectList(BuyerVoucherProject buyerVoucherProject)
    {
        return buyerVoucherProjectMapper.selectBuyerVoucherProjectList(buyerVoucherProject);
    }

    /**
     * 新增辅助帐凭证项目关系
     * 
     * @param buyerVoucherProject 辅助帐凭证项目关系
     * @return 结果
     */
    @Override
    public int insertBuyerVoucherProject(BuyerVoucherProject buyerVoucherProject)
    {
        buyerVoucherProject.setCreateTime(DateUtils.getNowDate());
        return buyerVoucherProjectMapper.insertBuyerVoucherProject(buyerVoucherProject);
    }

    /**
     * 修改辅助帐凭证项目关系
     * 
     * @param buyerVoucherProject 辅助帐凭证项目关系
     * @return 结果
     */
    @Override
    public int updateBuyerVoucherProject(BuyerVoucherProject buyerVoucherProject)
    {
        buyerVoucherProject.setUpdateTime(DateUtils.getNowDate());
        return buyerVoucherProjectMapper.updateBuyerVoucherProject(buyerVoucherProject);
    }

    /**
     * 批量删除辅助帐凭证项目关系
     * 
     * @param ids 需要删除的辅助帐凭证项目关系主键
     * @return 结果
     */
    @Override
    public int deleteBuyerVoucherProjectByIds(Long[] ids)
    {
        return buyerVoucherProjectMapper.deleteBuyerVoucherProjectByIds(ids);
    }

    /**
     * 删除辅助帐凭证项目关系信息
     * 
     * @param id 辅助帐凭证项目关系主键
     * @return 结果
     */
    @Override
    public int deleteBuyerVoucherProjectById(Long id)
    {
        return buyerVoucherProjectMapper.deleteBuyerVoucherProjectById(id);
    }
}
