package com.hw.dms.service.impl;

import java.util.List;
import com.hw.common.core.utils.DateUtils;
import com.hw.dms.domain.DmsBaseMaintStation;
import com.hw.dms.mapper.DmsBaseMaintStationMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hw.dms.mapper.DmsKnowledgeMaintMapper;
import com.hw.dms.domain.DmsKnowledgeMaint;
import com.hw.dms.service.IDmsKnowledgeMaintService;

/**
 * 保养知识库Service业务层处理
 *
 * @author Open Platform
 * @date 2024-02-26
 */
@Service
public class DmsKnowledgeMaintServiceImpl implements IDmsKnowledgeMaintService
{
    @Autowired
    private DmsKnowledgeMaintMapper dmsKnowledgeMaintMapper;

    @Autowired
    private DmsBaseMaintStationMapper dmsBaseMaintStationMapper;
    /**
     * 查询保养知识库
     *
     * @param knowledgeMaintId 保养知识库主键
     * @return 保养知识库
     */
    @Override
    public DmsKnowledgeMaint selectDmsKnowledgeMaintByKnowledgeMaintId(Long knowledgeMaintId)
    {
        return dmsKnowledgeMaintMapper.selectDmsKnowledgeMaintByKnowledgeMaintId(knowledgeMaintId);
    }

    /**
     * 查询保养知识库列表
     *
     * @param dmsKnowledgeMaint 保养知识库
     * @return 保养知识库
     */
    @Override
    public List<DmsKnowledgeMaint> selectDmsKnowledgeMaintList(DmsKnowledgeMaint dmsKnowledgeMaint)
    {
        return dmsKnowledgeMaintMapper.selectDmsKnowledgeMaintList(dmsKnowledgeMaint);
    }

    /**
     * 新增保养知识库
     *
     * @param dmsKnowledgeMaint 保养知识库
     * @return 结果
     */
    @Override
    public int insertDmsKnowledgeMaint(DmsKnowledgeMaint dmsKnowledgeMaint)
    {

        dmsKnowledgeMaint.setCreateTime(DateUtils.getNowDate());
        dmsKnowledgeMaint.setIsFlag("1");
        return dmsKnowledgeMaintMapper.insertDmsKnowledgeMaint(dmsKnowledgeMaint);
    }

    /**
     * 修改保养知识库
     *
     * @param dmsKnowledgeMaint 保养知识库
     * @return 结果
     */
    @Override
    public int updateDmsKnowledgeMaint(DmsKnowledgeMaint dmsKnowledgeMaint)
    {
        dmsKnowledgeMaint.setUpdateTime(DateUtils.getNowDate());
        return dmsKnowledgeMaintMapper.updateDmsKnowledgeMaint(dmsKnowledgeMaint);
    }

    /**
     * 批量删除保养知识库
     *
     * @param knowledgeMaintIds 需要删除的保养知识库主键
     * @return 结果
     */
    @Override
    public int deleteDmsKnowledgeMaintByKnowledgeMaintIds(Long[] knowledgeMaintIds)
    {
        return dmsKnowledgeMaintMapper.deleteDmsKnowledgeMaintByKnowledgeMaintIds(knowledgeMaintIds);
    }

    /**
     * 删除保养知识库信息
     *
     * @param knowledgeMaintId 保养知识库主键
     * @return 结果
     */
    @Override
    public int deleteDmsKnowledgeMaintByKnowledgeMaintId(Long knowledgeMaintId)
    {
        return dmsKnowledgeMaintMapper.deleteDmsKnowledgeMaintByKnowledgeMaintId(knowledgeMaintId);
    }
}
