package com.hw.dms.service.impl;

import java.util.List;
import com.hw.common.core.utils.DateUtils;
import com.hw.dms.domain.DmsBaseLubeStation;
import com.hw.dms.mapper.DmsBaseLubeStationMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hw.dms.mapper.DmsKnowledgeLubeMapper;
import com.hw.dms.domain.DmsKnowledgeLube;
import com.hw.dms.service.IDmsKnowledgeLubeService;

/**
 * 润滑知识库Service业务层处理
 *
 * @author caoql
 * @date 2024-02-26
 */
@Service
public class DmsKnowledgeLubeServiceImpl implements IDmsKnowledgeLubeService
{
    @Autowired
    private DmsKnowledgeLubeMapper dmsKnowledgeLubeMapper;
    @Autowired
    private DmsBaseLubeStationMapper dmsBaseLubeStationMapper;

    /**
     * 查询润滑知识库
     *
     * @param knowledgeLubeId 润滑知识库主键
     * @return 润滑知识库
     */
    @Override
    public DmsKnowledgeLube selectDmsKnowledgeLubeByKnowledgeLubeId(Long knowledgeLubeId)
    {
        return dmsKnowledgeLubeMapper.selectDmsKnowledgeLubeByKnowledgeLubeId(knowledgeLubeId);
    }

    /**
     * 查询润滑知识库列表
     *
     * @param dmsKnowledgeLube 润滑知识库
     * @return 润滑知识库
     */
    @Override
    public List<DmsKnowledgeLube> selectDmsKnowledgeLubeList(DmsKnowledgeLube dmsKnowledgeLube)
    {
        return dmsKnowledgeLubeMapper.selectDmsKnowledgeLubeList(dmsKnowledgeLube);
    }

    /**
     * 新增润滑知识库
     *
     * @param dmsKnowledgeLube 润滑知识库
     * @return 结果
     */
    @Override
    public int insertDmsKnowledgeLube(DmsKnowledgeLube dmsKnowledgeLube)
    {
        dmsKnowledgeLube.setCreateTime(DateUtils.getNowDate());

        dmsKnowledgeLube.setIsFlag("1");
        return dmsKnowledgeLubeMapper.insertDmsKnowledgeLube(dmsKnowledgeLube);
    }

    /**
     * 修改润滑知识库
     *
     * @param dmsKnowledgeLube 润滑知识库
     * @return 结果
     */
    @Override
    public int updateDmsKnowledgeLube(DmsKnowledgeLube dmsKnowledgeLube)
    {
        dmsKnowledgeLube.setUpdateTime(DateUtils.getNowDate());
        return dmsKnowledgeLubeMapper.updateDmsKnowledgeLube(dmsKnowledgeLube);
    }

    /**
     * 批量删除润滑知识库
     *
     * @param knowledgeLubeIds 需要删除的润滑知识库主键
     * @return 结果
     */
    @Override
    public int deleteDmsKnowledgeLubeByKnowledgeLubeIds(Long[] knowledgeLubeIds)
    {
        return dmsKnowledgeLubeMapper.deleteDmsKnowledgeLubeByKnowledgeLubeIds(knowledgeLubeIds);
    }

    /**
     * 删除润滑知识库信息
     *
     * @param knowledgeLubeId 润滑知识库主键
     * @return 结果
     */
    @Override
    public int deleteDmsKnowledgeLubeByKnowledgeLubeId(Long knowledgeLubeId)
    {
        return dmsKnowledgeLubeMapper.deleteDmsKnowledgeLubeByKnowledgeLubeId(knowledgeLubeId);
    }
}
