package com.ozs.pm.service.impl;

import java.util.List;
import com.ozs.common.utils.DateUtils;
import com.ozs.pm.doman.PmDemandServe;
import com.ozs.pm.mapper.PmDemandServeMapper;
import com.ozs.pm.service.IPmDemandServeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 采购需求服务类Service业务层处理
 *
 * @author ruoyi
 * @date 2023-01-16
 */
@Service
public class PmDemandServeServiceImpl implements IPmDemandServeService
{
    @Autowired
    private PmDemandServeMapper pmDemandServeMapper;

    /**
     * 查询采购需求服务类
     *
     * @param demandServeId 采购需求服务类主键
     * @return 采购需求服务类
     */
    @Override
    public PmDemandServe selectPmDemandServeByDemandServeId(Long demandServeId)
    {
        return pmDemandServeMapper.selectPmDemandServeByDemandServeId(demandServeId);
    }

    /**
     * 查询采购需求服务类列表
     *
     * @param pmDemandServe 采购需求服务类
     * @return 采购需求服务类
     */
    @Override
    public List<PmDemandServe> selectPmDemandServeList(PmDemandServe pmDemandServe)
    {
        return pmDemandServeMapper.selectPmDemandServeList(pmDemandServe);
    }

    /**
     * 新增采购需求服务类
     *
     * @param pmDemandServe 采购需求服务类
     * @return 结果
     */
    @Override
    public int insertPmDemandServe(PmDemandServe pmDemandServe)
    {
        pmDemandServe.setCreateTime(DateUtils.getNowDate());
        return pmDemandServeMapper.insertPmDemandServe(pmDemandServe);
    }

    /**
     * 修改采购需求服务类
     *
     * @param pmDemandServe 采购需求服务类
     * @return 结果
     */
    @Override
    public int updatePmDemandServe(PmDemandServe pmDemandServe)
    {
        pmDemandServe.setUpdateTime(DateUtils.getNowDate());
        return pmDemandServeMapper.updatePmDemandServe(pmDemandServe);
    }


}
