package com.ozs.pm.service.impl;

import java.util.List;
import com.ozs.common.utils.DateUtils;
import com.ozs.pm.doman.PmDemandEngineering;
import com.ozs.pm.mapper.PmDemandEngineeringMapper;
import com.ozs.pm.service.IPmDemandEngineeringService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 采购需求工程类Service业务层处理
 *
 * @author ruoyi
 * @date 2023-01-16
 */
@Service
public class PmDemandEngineeringServiceImpl implements IPmDemandEngineeringService
{
    @Autowired
    private PmDemandEngineeringMapper pmDemandEngineeringMapper;

    /**
     * 查询采购需求工程类
     *
     * @param demandEngineeringId 采购需求工程类主键
     * @return 采购需求工程类
     */
    @Override
    public PmDemandEngineering selectPmDemandEngineeringByDemandEngineeringId(Long demandEngineeringId)
    {
        return pmDemandEngineeringMapper.selectPmDemandEngineeringByDemandEngineeringId(demandEngineeringId);
    }

    /**
     * 查询采购需求工程类列表
     *
     * @param pmDemandEngineering 采购需求工程类
     * @return 采购需求工程类
     */
    @Override
    public List<PmDemandEngineering> selectPmDemandEngineeringList(PmDemandEngineering pmDemandEngineering)
    {
        return pmDemandEngineeringMapper.selectPmDemandEngineeringList(pmDemandEngineering);
    }

    /**
     * 新增采购需求工程类
     *
     * @param pmDemandEngineering 采购需求工程类
     * @return 结果
     */
    @Override
    public int insertPmDemandEngineering(PmDemandEngineering pmDemandEngineering)
    {
        pmDemandEngineering.setCreateTime(DateUtils.getNowDate());
        return pmDemandEngineeringMapper.insertPmDemandEngineering(pmDemandEngineering);
    }

    /**
     * 修改采购需求工程类
     *
     * @param pmDemandEngineering 采购需求工程类
     * @return 结果
     */
    @Override
    public int updatePmDemandEngineering(PmDemandEngineering pmDemandEngineering)
    {
        pmDemandEngineering.setUpdateTime(DateUtils.getNowDate());
        return pmDemandEngineeringMapper.updatePmDemandEngineering(pmDemandEngineering);
    }

}
