package com.bonus.sgzb.material.service.impl;

import java.util.List;

import com.bonus.sgzb.material.domain.PurchaseMacodeInfo;
import com.bonus.sgzb.material.mapper.PurchaseMacodeInfoMapper;
import com.bonus.sgzb.material.service.IPurchaseMacodeInfoService;
import com.bonus.sgzb.common.core.utils.DateUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 新购验收编号管理Service业务层处理
 * 
 * @author bonus
 * @date 2023-12-10
 */
@Service
public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService
{
    @Resource
    private PurchaseMacodeInfoMapper purchaseMacodeInfoMapper;

    /**
     * 查询新购验收编号管理
     * 
     * @param taskId 新购验收编号管理主键
     * @return 新购验收编号管理
     */
    @Override
    public PurchaseMacodeInfo selectPurchaseMacodeInfoByTaskId(Long taskId)
    {
        return purchaseMacodeInfoMapper.selectPurchaseMacodeInfoByTaskId(taskId);
    }

    /**
     * 查询新购验收编号管理列表
     * 
     * @param purchaseMacodeInfo 新购验收编号管理
     * @return 新购验收编号管理
     */
    @Override
    public List<PurchaseMacodeInfo> selectPurchaseMacodeInfoList(PurchaseMacodeInfo purchaseMacodeInfo)
    {
        return purchaseMacodeInfoMapper.selectPurchaseMacodeInfoList(purchaseMacodeInfo);
    }

    /**
     * 新增新购验收编号管理
     * 
     * @param purchaseMacodeInfo 新购验收编号管理
     * @return 结果
     */
    @Override
    public int insertPurchaseMacodeInfo(PurchaseMacodeInfo purchaseMacodeInfo)
    {
        purchaseMacodeInfo.setCreateTime(DateUtils.getNowDate());
        return purchaseMacodeInfoMapper.insertPurchaseMacodeInfo(purchaseMacodeInfo);
    }

    /**
     * 修改新购验收编号管理
     * 
     * @param purchaseMacodeInfo 新购验收编号管理
     * @return 结果
     */
    @Override
    public int updatePurchaseMacodeInfo(PurchaseMacodeInfo purchaseMacodeInfo)
    {
        purchaseMacodeInfo.setUpdateTime(DateUtils.getNowDate());
        return purchaseMacodeInfoMapper.updatePurchaseMacodeInfo(purchaseMacodeInfo);
    }

    /**
     * 批量删除新购验收编号管理
     * 
     * @param taskIds 需要删除的新购验收编号管理主键
     * @return 结果
     */
    @Override
    public int deletePurchaseMacodeInfoByTaskIds(Long[] taskIds)
    {
        return purchaseMacodeInfoMapper.deletePurchaseMacodeInfoByTaskIds(taskIds);
    }

    /**
     * 删除新购验收编号管理信息
     * 
     * @param taskId 新购验收编号管理主键
     * @return 结果
     */
    @Override
    public int deletePurchaseMacodeInfoByTaskId(Long taskId)
    {
        return purchaseMacodeInfoMapper.deletePurchaseMacodeInfoByTaskId(taskId);
    }
}
