package com.ruoyi.ss.hardwareVersion.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.ss.hardwareVersion.service.IHardwareVersionService;
import com.ruoyi.ss.hardwareVersion.domain.HardwareVersion;
import com.ruoyi.ss.hardwareVersion.mapper.HardwareVersionMapper;
import com.ruoyi.common.utils.poi.ExcelUtil;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 硬件版本Service业务层处理
 *
 * @author qiuzhenzhao
 * @date 2024-07-22
 */
@Service
public class HardwareVersionServiceImpl implements IHardwareVersionService
{
    @Resource
    private HardwareVersionMapper eHardwareVersionMapper;

    /**
     * 查询硬件版本
     *
     * @param id 硬件版本主键
     * @return 硬件版本
     */
    @Override
    public HardwareVersion selectEHardwareVersionById(Long id)
    {
        return eHardwareVersionMapper.selectEHardwareVersionById(id);
    }

    /**
     * 查询硬件版本列表
     *
     * @param EHardwareVersion 硬件版本
     * @return 硬件版本
     */
    @Override
    public List<HardwareVersion> selectEHardwareVersionList(HardwareVersion EHardwareVersion)
    {
        return eHardwareVersionMapper.selectEHardwareVersionList(EHardwareVersion);
    }

    /**
     * 新增硬件版本
     *
     * @param hardwareVersion 硬件版本
     * @return 结果
     */
    @Override
    public int insertEHardwareVersion(HardwareVersion hardwareVersion)
    {
        hardwareVersion.setCreateTime(DateUtils.getNowDate());
        return eHardwareVersionMapper.insertEHardwareVersion(hardwareVersion);
    }

    /**
     * 修改硬件版本
     *
     * @param EHardwareVersion 硬件版本
     * @return 结果
     */
    @Override
    public int updateEHardwareVersion(HardwareVersion EHardwareVersion)
    {
        return eHardwareVersionMapper.updateEHardwareVersion(EHardwareVersion);
    }

    /**
     * 批量删除硬件版本
     *
     * @param ids 需要删除的硬件版本主键
     * @return 结果
     */
    @Override
    public int deleteEHardwareVersionByIds(Long[] ids)
    {
        return eHardwareVersionMapper.deleteEHardwareVersionByIds(ids);
    }

    /**
     * 删除硬件版本信息
     *
     * @param id 硬件版本主键
     * @return 结果
     */
    @Override
    public int deleteEHardwareVersionById(Long id)
    {
        return eHardwareVersionMapper.deleteEHardwareVersionById(id);
    }
}
