package com.aucma.base.service.impl;

import java.util.List;

import com.aucma.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.aucma.base.mapper.BaseMaterialInfoMapper;
import com.aucma.base.domain.BaseMaterialInfo;
import com.aucma.base.service.IBaseMaterialInfoService;

/**
 * 物料信息Service业务层处理
 *
 * @author Yinq
 * @date 2023-09-19
 */
@Service
public class BaseMaterialInfoServiceImpl implements IBaseMaterialInfoService
{
    @Autowired
    private BaseMaterialInfoMapper baseMaterialInfoMapper;

    /**
     * 查询物料信息
     *
     * @param objId 物料信息主键
     * @return 物料信息
     */
    @Override
    public BaseMaterialInfo selectBaseMaterialInfoByObjId(Long objId)
    {
        return baseMaterialInfoMapper.selectBaseMaterialInfoByObjId(objId);
    }

    /**
     * 查询物料信息列表
     *
     * @param baseMaterialInfo 物料信息
     * @return 物料信息
     */
    @Override
    public List<BaseMaterialInfo> selectBaseMaterialInfoList(BaseMaterialInfo baseMaterialInfo)
    {
        return baseMaterialInfoMapper.selectBaseMaterialInfoList(baseMaterialInfo);
    }

    /**
     * 新增物料信息
     *
     * @param baseMaterialInfo 物料信息
     * @return 结果
     */
    @Override
    public int insertBaseMaterialInfo(BaseMaterialInfo baseMaterialInfo)
    {
        baseMaterialInfo.setCreatedTime(DateUtils.getNowDate());
        return baseMaterialInfoMapper.insertBaseMaterialInfo(baseMaterialInfo);
    }

    /**
     * 修改物料信息
     *
     * @param baseMaterialInfo 物料信息
     * @return 结果
     */
    @Override
    public int updateBaseMaterialInfo(BaseMaterialInfo baseMaterialInfo)
    {
        return baseMaterialInfoMapper.updateBaseMaterialInfo(baseMaterialInfo);
    }

    /**
     * 批量删除物料信息
     *
     * @param objIds 需要删除的物料信息主键
     * @return 结果
     */
    @Override
    public int deleteBaseMaterialInfoByObjIds(Long[] objIds)
    {
        return baseMaterialInfoMapper.deleteBaseMaterialInfoByObjIds(objIds);
    }

    /**
     * 删除物料信息信息
     *
     * @param objId 物料信息主键
     * @return 结果
     */
    @Override
    public int deleteBaseMaterialInfoByObjId(Long objId)
    {
        return baseMaterialInfoMapper.deleteBaseMaterialInfoByObjId(objId);
    }
}
