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

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.ss.softwareVersion.domain.SoftwareVersion;
import com.ruoyi.ss.softwareVersion.mapper.SoftwareVersionMapper;
import com.ruoyi.ss.softwareVersion.service.ISoftwareVersionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 软件版本Service业务层处理
 *
 * @author qiuzhenzhao
 * @date 2024-07-22
 */
@Service
public class SoftwareVersionServiceImpl implements ISoftwareVersionService
{
    @Autowired
    private SoftwareVersionMapper etSoftwareVersionMapper;

    /**
     * 查询软件版本
     *
     * @param id 软件版本主键
     * @return 软件版本
     */
    @Override
    public SoftwareVersion selectEtSoftwareVersionById(Long id)
    {
        return etSoftwareVersionMapper.selectEtSoftwareVersionById(id);
    }

    /**
     * 查询软件版本列表
     *
     * @param etSoftwareVersion 软件版本
     * @return 软件版本
     */
    @Override
    public List<SoftwareVersion> selectEtSoftwareVersionList(SoftwareVersion etSoftwareVersion)
    {
        return etSoftwareVersionMapper.selectEtSoftwareVersionList(etSoftwareVersion);
    }

    /**
     * 新增软件版本
     *
     * @param etSoftwareVersion 软件版本
     * @return 结果
     */
    @Override
    public int insertEtSoftwareVersion(SoftwareVersion etSoftwareVersion)
    {
        etSoftwareVersion.setCreateTime(DateUtils.getNowDate());
        return etSoftwareVersionMapper.insertEtSoftwareVersion(etSoftwareVersion);
    }

    /**
     * 修改软件版本
     *
     * @param etSoftwareVersion 软件版本
     * @return 结果
     */
    @Override
    public int updateEtSoftwareVersion(SoftwareVersion etSoftwareVersion)
    {
        etSoftwareVersion.setUpdateTime(DateUtils.getNowDate());
        return etSoftwareVersionMapper.updateEtSoftwareVersion(etSoftwareVersion);
    }

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

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