package com.benyun.project.third.material.service.impl;


import com.benyun.common.utils.text.Convert;
import com.benyun.project.third.material.domain.ByMaterialOut;
import com.benyun.project.third.material.mapper.ByMaterialOutMapper;
import com.benyun.project.third.material.service.IByMaterialOutService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 犇云物料内外对应Service业务层处理
 *
 * @author benyun
 * @date 2023-12-04
 */
@Service
public class ByMaterialOutServiceImpl implements IByMaterialOutService
{
    @Autowired
    private ByMaterialOutMapper byMaterialOutMapper;

    /**
     * 查询犇云物料内外对应
     *
     * @param id 犇云物料内外对应主键
     * @return 犇云物料内外对应
     */
    @Override
    public ByMaterialOut selectByMaterialOutById(Long id)
    {
        return byMaterialOutMapper.selectByMaterialOutById(id);
    }

    /**
     * 查询犇云物料内外对应列表
     *
     * @param byMaterialOut 犇云物料内外对应
     * @return 犇云物料内外对应
     */
    @Override
    public List<ByMaterialOut> selectByMaterialOutList(ByMaterialOut byMaterialOut)
    {
        return byMaterialOutMapper.selectByMaterialOutList(byMaterialOut);
    }

    /**
     * 新增犇云物料内外对应
     *
     * @param byMaterialOut 犇云物料内外对应
     * @return 结果
     */
    @Override
    public int insertByMaterialOut(ByMaterialOut byMaterialOut)
    {
        return byMaterialOutMapper.insertByMaterialOut(byMaterialOut);
    }

    /**
     * 修改犇云物料内外对应
     *
     * @param byMaterialOut 犇云物料内外对应
     * @return 结果
     */
    @Override
    public int updateByMaterialOut(ByMaterialOut byMaterialOut)
    {
        return byMaterialOutMapper.updateByMaterialOut(byMaterialOut);
    }

    /**
     * 批量删除犇云物料内外对应
     *
     * @param ids 需要删除的犇云物料内外对应主键
     * @return 结果
     */
    @Override
    public int deleteByMaterialOutByIds(String ids)
    {
        return byMaterialOutMapper.deleteByMaterialOutByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除犇云物料内外对应信息
     *
     * @param id 犇云物料内外对应主键
     * @return 结果
     */
    @Override
    public int deleteByMaterialOutById(Long id)
    {
        return byMaterialOutMapper.deleteByMaterialOutById(id);
    }

    @Override
    public int batchSaveMaterialList(List<ByMaterialOut> materialList) {
        return byMaterialOutMapper.batchSaveMaterialList(materialList);
    }
}
