package com.djhk.uav.versioninfo.service.impl;


import com.djhk.common.utils.DateUtils;
import com.djhk.uav.versioninfo.domain.VersionInfo;
import com.djhk.uav.versioninfo.mapper.VersionInfoMapper;
import com.djhk.uav.versioninfo.service.IVersionInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 版本公告Service业务层处理
 * 
 * @author qpc
 * @date 2025-04-10
 */
@Service
public class VersionInfoServiceImpl implements IVersionInfoService
{
    @Autowired
    private VersionInfoMapper versionInfoMapper;

    /**
     * 查询版本公告
     * 
     * @param id 版本公告主键
     * @return 版本公告
     */
    @Override
    public VersionInfo selectVersionInfoById(Long id)
    {
        return versionInfoMapper.selectVersionInfoById(id);
    }

    /**
     * 查询版本公告列表
     * 
     * @param versionInfo 版本公告
     * @return 版本公告
     */
    @Override
    public List<VersionInfo> selectVersionInfoList(VersionInfo versionInfo)
    {
        return versionInfoMapper.selectVersionInfoList(versionInfo);
    }

    /**
     * 新增版本公告
     * 
     * @param versionInfo 版本公告
     * @return 结果
     */
    @Override
    public int insertVersionInfo(VersionInfo versionInfo)
    {
        versionInfo.setCreateTime(DateUtils.getNowDate());
        versionInfo.setVersiontime(DateUtils.getNowDate());
        return versionInfoMapper.insertVersionInfo(versionInfo);
    }

    /**
     * 修改版本公告
     * 
     * @param versionInfo 版本公告
     * @return 结果
     */
    @Override
    public int updateVersionInfo(VersionInfo versionInfo)
    {
        versionInfo.setUpdateTime(DateUtils.getNowDate());
        return versionInfoMapper.updateVersionInfo(versionInfo);
    }

    /**
     * 批量删除版本公告
     * 
     * @param ids 需要删除的版本公告主键
     * @return 结果
     */
    @Override
    public int deleteVersionInfoByIds(Long[] ids)
    {
        return versionInfoMapper.deleteVersionInfoByIds(ids);
    }

    /**
     * 删除版本公告信息
     * 
     * @param id 版本公告主键
     * @return 结果
     */
    @Override
    public int deleteVersionInfoById(Long id)
    {
        return versionInfoMapper.deleteVersionInfoById(id);
    }
}
