package com.yunfeiyun.agmp.fms.service.impl;

import java.util.List;

import com.yunfeiyun.agmp.fms.domain.MppMaterial;
import com.yunfeiyun.agmp.fms.mapper.MppMaterialMapper;
import com.yunfeiyun.agmp.fms.domain.reqvo.MppMaterialReqVo;
import com.yunfeiyun.agmp.fms.domain.resvo.MppMaterialResVo;
import com.yunfeiyun.agmp.fms.service.IMppMaterialService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 加工原材料Service业务层处理
 * 
 * @author 杨晓辉
 * @date 2023-07-03
 */
@Service
public class MppMaterialServiceImpl implements IMppMaterialService
{
    @Autowired
    private MppMaterialMapper mppMaterialMapper;

    /**
     * 查询加工原材料
     * 
     * @param materialId 加工原材料主键
     * @return 加工原材料
     */
    @Override
    public MppMaterial selectMppMaterialByMaterialId(String materialId)
    {
        return mppMaterialMapper.selectMppMaterialByMaterialId(materialId);
    }

    /**
     * 查询加工原材料列表
     * 
     * @param mppMaterial 加工原材料
     * @return 加工原材料
     */
    @Override
    public List<MppMaterialResVo> selectMppMaterialList(MppMaterialReqVo reqVo)
    {
        return mppMaterialMapper.selectMppMaterialList(reqVo);
    }

    /**
     * 新增加工原材料
     * 
     * @param mppMaterial 加工原材料
     * @return 结果
     */
    @Override
    public int insertMppMaterial(MppMaterial mppMaterial)
    {
        return mppMaterialMapper.insertMppMaterial(mppMaterial);
    }

    /**
     * 修改加工原材料
     * 
     * @param mppMaterial 加工原材料
     * @return 结果
     */
    @Override
    public int updateMppMaterial(MppMaterial mppMaterial)
    {
        return mppMaterialMapper.updateMppMaterial(mppMaterial);
    }

    /**
     * 批量删除加工原材料
     * 
     * @param materialIds 需要删除的加工原材料主键
     * @return 结果
     */
    @Override
    public int deleteMppMaterialByMaterialIds(String[] materialIds)
    {
        return mppMaterialMapper.deleteMppMaterialByMaterialIds(materialIds);
    }

    /**
     * 删除加工原材料信息
     * 
     * @param materialId 加工原材料主键
     * @return 结果
     */
    @Override
    public int deleteMppMaterialByMaterialId(String materialId)
    {
        return mppMaterialMapper.deleteMppMaterialByMaterialId(materialId);
    }
}
