package com.sundot.airport.system.service.impl;

import java.util.List;

import com.sundot.airport.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.sundot.airport.system.mapper.SysWorkingDocumentMapper;
import com.sundot.airport.system.domain.SysWorkingDocument;
import com.sundot.airport.system.service.ISysWorkingDocumentService;

/**
 * 工作文档Service业务层处理
 *
 * @author ruoyi
 * @date 2025-11-18
 */
@Service
public class SysWorkingDocumentServiceImpl implements ISysWorkingDocumentService {
    @Autowired
    private SysWorkingDocumentMapper sysWorkingDocumentMapper;

    /**
     * 查询工作文档
     *
     * @param documentId 工作文档主键
     * @return 工作文档
     */
    @Override
    public SysWorkingDocument selectSysWorkingDocumentByDocumentId(Long documentId) {
        return sysWorkingDocumentMapper.selectSysWorkingDocumentByDocumentId(documentId);
    }

    /**
     * 查询工作文档列表
     *
     * @param sysWorkingDocument 工作文档
     * @return 工作文档
     */
    @Override
    public List<SysWorkingDocument> selectSysWorkingDocumentList(SysWorkingDocument sysWorkingDocument) {
        return sysWorkingDocumentMapper.selectSysWorkingDocumentList(sysWorkingDocument);
    }

    /**
     * 新增工作文档
     *
     * @param sysWorkingDocument 工作文档
     * @return 结果
     */
    @Override
    public int insertSysWorkingDocument(SysWorkingDocument sysWorkingDocument) {
        sysWorkingDocument.setCreateTime(DateUtils.getNowDate());
        return sysWorkingDocumentMapper.insertSysWorkingDocument(sysWorkingDocument);
    }

    /**
     * 修改工作文档
     *
     * @param sysWorkingDocument 工作文档
     * @return 结果
     */
    @Override
    public int updateSysWorkingDocument(SysWorkingDocument sysWorkingDocument) {
        sysWorkingDocument.setUpdateTime(DateUtils.getNowDate());
        return sysWorkingDocumentMapper.updateSysWorkingDocument(sysWorkingDocument);
    }

    /**
     * 批量删除工作文档
     *
     * @param documentIds 需要删除的工作文档主键
     * @return 结果
     */
    @Override
    public int deleteSysWorkingDocumentByDocumentIds(Long[] documentIds) {
        return sysWorkingDocumentMapper.deleteSysWorkingDocumentByDocumentIds(documentIds);
    }

    /**
     * 删除工作文档信息
     *
     * @param documentId 工作文档主键
     * @return 结果
     */
    @Override
    public int deleteSysWorkingDocumentByDocumentId(Long documentId) {
        return sysWorkingDocumentMapper.deleteSysWorkingDocumentByDocumentId(documentId);
    }
}
