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.BuyerAgreementMapper;
import com.ruoyi.buyerapi.domain.BuyerAgreement;
import com.ruoyi.buyerapi.service.IBuyerAgreementService;

/**
 * 系统协议Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-09-19
 */
@Service
public class BuyerAgreementServiceImpl implements IBuyerAgreementService 
{
    @Autowired
    private BuyerAgreementMapper buyerAgreementMapper;

    /**
     * 查询系统协议
     * 
     * @param id 系统协议主键
     * @return 系统协议
     */
    @Override
    public BuyerAgreement selectBuyerAgreementById(String id)
    {
        return buyerAgreementMapper.selectBuyerAgreementById(id);
    }

    /**
     * 查询系统协议列表
     * 
     * @param buyerAgreement 系统协议
     * @return 系统协议
     */
    @Override
    public List<BuyerAgreement> selectBuyerAgreementList(BuyerAgreement buyerAgreement)
    {
        return buyerAgreementMapper.selectBuyerAgreementList(buyerAgreement);
    }

    /**
     * 新增系统协议
     * 
     * @param buyerAgreement 系统协议
     * @return 结果
     */
    @Override
    public int insertBuyerAgreement(BuyerAgreement buyerAgreement)
    {
        buyerAgreement.setCreateTime(DateUtils.getNowDate());
        return buyerAgreementMapper.insertBuyerAgreement(buyerAgreement);
    }

    /**
     * 修改系统协议
     * 
     * @param buyerAgreement 系统协议
     * @return 结果
     */
    @Override
    public int updateBuyerAgreement(BuyerAgreement buyerAgreement)
    {
        buyerAgreement.setUpdateTime(DateUtils.getNowDate());
        return buyerAgreementMapper.updateBuyerAgreement(buyerAgreement);
    }

    /**
     * 批量删除系统协议
     * 
     * @param ids 需要删除的系统协议主键
     * @return 结果
     */
    @Override
    public int deleteBuyerAgreementByIds(String[] ids)
    {
        return buyerAgreementMapper.deleteBuyerAgreementByIds(ids);
    }

    /**
     * 删除系统协议信息
     * 
     * @param id 系统协议主键
     * @return 结果
     */
    @Override
    public int deleteBuyerAgreementById(String id)
    {
        return buyerAgreementMapper.deleteBuyerAgreementById(id);
    }
}
