package com.ozs.pm.service.impl;

import java.util.List;
import com.ozs.common.utils.DateUtils;
import com.ozs.pm.doman.PmDemandMaterials;
import com.ozs.pm.mapper.PmDemandMaterialsMapper;
import com.ozs.pm.service.IPmDemandMaterialsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 采购需求物资类Service业务层处理
 *
 * @author ruoyi
 * @date 2023-01-16
 */
@Service
public class PmDemandMaterialsServiceImpl implements IPmDemandMaterialsService
{
    @Autowired
    private PmDemandMaterialsMapper pmDemandMaterialsMapper;

    /**
     * 查询采购需求物资类
     *
     * @param demandMaterialsId 采购需求物资类主键
     * @return 采购需求物资类
     */
    @Override
    public PmDemandMaterials selectPmDemandMaterialsByDemandMaterialsId(Long demandMaterialsId)
    {
        return pmDemandMaterialsMapper.selectPmDemandMaterialsByDemandMaterialsId(demandMaterialsId);
    }

    /**
     * 查询采购需求物资类列表
     *
     * @param pmDemandMaterials 采购需求物资类
     * @return 采购需求物资类
     */
    @Override
    public List<PmDemandMaterials> selectPmDemandMaterialsList(PmDemandMaterials pmDemandMaterials)
    {
        return pmDemandMaterialsMapper.selectPmDemandMaterialsList(pmDemandMaterials);
    }

    /**
     * 新增采购需求物资类
     *
     * @param pmDemandMaterials 采购需求物资类
     * @return 结果
     */
    @Override
    public int insertPmDemandMaterials(PmDemandMaterials pmDemandMaterials)
    {
        pmDemandMaterials.setCreateTime(DateUtils.getNowDate());
        return pmDemandMaterialsMapper.insertPmDemandMaterials(pmDemandMaterials);
    }

    /**
     * 修改采购需求物资类
     *
     * @param pmDemandMaterials 采购需求物资类
     * @return 结果
     */
    @Override
    public int updatePmDemandMaterials(PmDemandMaterials pmDemandMaterials)
    {
        pmDemandMaterials.setUpdateTime(DateUtils.getNowDate());
        return pmDemandMaterialsMapper.updatePmDemandMaterials(pmDemandMaterials);
    }

}
