package com.hw.dms.service.impl;

import java.util.List;
import com.hw.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hw.dms.mapper.DmsBaseDevicePurchaseMapper;
import com.hw.dms.domain.DmsBaseDevicePurchase;
import com.hw.dms.service.IDmsBaseDevicePurchaseService;

/**
 * 设备采购信息Service业务层处理
 * 
 * @author xins
 * @date 2024-01-09
 */
@Service
public class DmsBaseDevicePurchaseServiceImpl implements IDmsBaseDevicePurchaseService 
{
    @Autowired
    private DmsBaseDevicePurchaseMapper dmsBaseDevicePurchaseMapper;

    /**
     * 查询设备采购信息
     * 
     * @param devicePurchaseId 设备采购信息主键
     * @return 设备采购信息
     */
    @Override
    public DmsBaseDevicePurchase selectDmsBaseDevicePurchaseByDevicePurchaseId(Long devicePurchaseId)
    {
        return dmsBaseDevicePurchaseMapper.selectDmsBaseDevicePurchaseByDevicePurchaseId(devicePurchaseId);
    }

    /**
     * 查询设备采购信息列表
     * 
     * @param dmsBaseDevicePurchase 设备采购信息
     * @return 设备采购信息
     */
    @Override
    public List<DmsBaseDevicePurchase> selectDmsBaseDevicePurchaseList(DmsBaseDevicePurchase dmsBaseDevicePurchase)
    {
        return dmsBaseDevicePurchaseMapper.selectDmsBaseDevicePurchaseList(dmsBaseDevicePurchase);
    }

    /**
     * 新增设备采购信息
     * 
     * @param dmsBaseDevicePurchase 设备采购信息
     * @return 结果
     */
    @Override
    public int insertDmsBaseDevicePurchase(DmsBaseDevicePurchase dmsBaseDevicePurchase)
    {
        dmsBaseDevicePurchase.setCreateTime(DateUtils.getNowDate());
        return dmsBaseDevicePurchaseMapper.insertDmsBaseDevicePurchase(dmsBaseDevicePurchase);
    }

    /**
     * 修改设备采购信息
     * 
     * @param dmsBaseDevicePurchase 设备采购信息
     * @return 结果
     */
    @Override
    public int updateDmsBaseDevicePurchase(DmsBaseDevicePurchase dmsBaseDevicePurchase)
    {
        dmsBaseDevicePurchase.setUpdateTime(DateUtils.getNowDate());
        return dmsBaseDevicePurchaseMapper.updateDmsBaseDevicePurchase(dmsBaseDevicePurchase);
    }

    /**
     * 批量删除设备采购信息
     * 
     * @param devicePurchaseIds 需要删除的设备采购信息主键
     * @return 结果
     */
    @Override
    public int deleteDmsBaseDevicePurchaseByDevicePurchaseIds(Long[] devicePurchaseIds)
    {
        return dmsBaseDevicePurchaseMapper.deleteDmsBaseDevicePurchaseByDevicePurchaseIds(devicePurchaseIds);
    }

    /**
     * 删除设备采购信息信息
     * 
     * @param devicePurchaseId 设备采购信息主键
     * @return 结果
     */
    @Override
    public int deleteDmsBaseDevicePurchaseByDevicePurchaseId(Long devicePurchaseId)
    {
        return dmsBaseDevicePurchaseMapper.deleteDmsBaseDevicePurchaseByDevicePurchaseId(devicePurchaseId);
    }
}
