package com.ruoyi.system.service.document.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.document.ExplainDocument;
import com.ruoyi.system.service.document.IExplainDocumentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ExplainDocumentMapper;

/**
 * 说明文档Service业务层处理
 * 
 * @author boman
 * @date 2024-04-29
 */
@Service
public class ExplainDocumentServiceImpl implements IExplainDocumentService
{
    @Autowired
    private ExplainDocumentMapper explainDocumentMapper;

    /**
     * 查询说明文档
     * 
     * @param explainId 说明文档主键
     * @return 说明文档
     */
    @Override
    public ExplainDocument selectExplainDocumentByExplainId(Integer explainId)
    {
        return explainDocumentMapper.selectExplainDocumentByExplainId(explainId);
    }

    /**
     * 查询说明文档列表
     * 
     * @param explainDocument 说明文档
     * @return 说明文档
     */
    @Override
    public List<ExplainDocument> selectExplainDocumentList(ExplainDocument explainDocument)
    {
        return explainDocumentMapper.selectExplainDocumentList(explainDocument);
    }

    /**
     * 新增说明文档
     * 
     * @param explainDocument 说明文档
     * @return 结果
     */
    @Override
    public int insertExplainDocument(ExplainDocument explainDocument)
    {
        explainDocument.setCreateTime(DateUtils.getNowDate());
        return explainDocumentMapper.insertExplainDocument(explainDocument);
    }

    /**
     * 修改说明文档
     * 
     * @param explainDocument 说明文档
     * @return 结果
     */
    @Override
    public int updateExplainDocument(ExplainDocument explainDocument)
    {
        explainDocument.setUpdateTime(DateUtils.getNowDate());
        return explainDocumentMapper.updateExplainDocument(explainDocument);
    }

    /**
     * 批量删除说明文档
     * 
     * @param explainIds 需要删除的说明文档主键
     * @return 结果
     */
    @Override
    public int deleteExplainDocumentByExplainIds(Integer[] explainIds)
    {
        return explainDocumentMapper.deleteExplainDocumentByExplainIds(explainIds);
    }

    /**
     * 删除说明文档信息
     * 
     * @param explainId 说明文档主键
     * @return 结果
     */
    @Override
    public int deleteExplainDocumentByExplainId(Integer explainId)
    {
        return explainDocumentMapper.deleteExplainDocumentByExplainId(explainId);
    }
}
