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

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.bst.hardwareVersion.mapper.HardwareVersionMapper;
import com.ruoyi.bst.hardwareVersion.domain.HardwareVersion;
import com.ruoyi.bst.hardwareVersion.domain.HardwareVersionVO;
import com.ruoyi.bst.hardwareVersion.domain.HardwareVersionQuery;
import com.ruoyi.bst.hardwareVersion.service.HardwareVersionService;

/**
 * 硬件版本Service业务层处理
 *
 * @author ruoyi
 * @date 2025-04-07
 */
@Service
public class HardwareVersionServiceImpl implements HardwareVersionService
{
    @Autowired
    private HardwareVersionMapper hardwareVersionMapper;

    /**
     * 查询硬件版本
     *
     * @param id 硬件版本主键
     * @return 硬件版本
     */
    @Override
    public HardwareVersionVO selectHardwareVersionById(Long id)
    {
        return hardwareVersionMapper.selectHardwareVersionById(id);
    }

    /**
     * 查询硬件版本列表
     *
     * @param hardwareVersion 硬件版本
     * @return 硬件版本
     */
    @Override
    public List<HardwareVersionVO> selectHardwareVersionList(HardwareVersionQuery hardwareVersion)
    {
        return hardwareVersionMapper.selectHardwareVersionList(hardwareVersion);
    }

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

    /**
     * 修改硬件版本
     *
     * @param hardwareVersion 硬件版本
     * @return 结果
     */
    @Override
    public int updateHardwareVersion(HardwareVersion hardwareVersion)
    {
        return hardwareVersionMapper.updateHardwareVersion(hardwareVersion);
    }

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

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