package com.ruoyi.generator.service;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.generator.domain.SourcePurchase;
import com.ruoyi.generator.mapper.SourcePurchaseMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class SourcePurchaseServiceImpl implements ISourcePurchaseService
{
    @Autowired
    private SourcePurchaseMapper sourcePurchaseMapper;

    @Override
    public SourcePurchase selectSourcePurchaseByPurchaseId(Long purchaseId)
    {
        return sourcePurchaseMapper.selectSourcePurchaseByPurchaseId(purchaseId);
    }

    @Override
    public List<SourcePurchase> selectSourcePurchaseList(SourcePurchase sourcePurchase)
    {
        return sourcePurchaseMapper.selectSourcePurchaseList(sourcePurchase);
    }

    @Override
    public int updateSourcePurchase(SourcePurchase sourcePurchase)
    {
        sourcePurchase.setUpdateTime(DateUtils.getNowDate());
        return sourcePurchaseMapper.updateSourcePurchase(sourcePurchase);
    }
}
