package com.ozs.pm.service.impl;

import java.util.List;
import com.ozs.common.utils.DateUtils;
import com.ozs.pm.doman.PmFlowChart;
import com.ozs.pm.mapper.PmFlowChartMapper;
import com.ozs.pm.service.IPmFlowChartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 流程图Service业务层处理
 *
 * @author ruoyi
 * @date 2023-01-25
 */
@Service
public class PmFlowChartServiceImpl implements IPmFlowChartService
{
    @Autowired
    private PmFlowChartMapper pmFlowChartMapper;

    /**
     * 查询流程图
     *
     * @param flowChartId 流程图主键
     * @return 流程图
     */
    @Override
    public PmFlowChart selectPmFlowChartByFlowChartId(Long flowChartId)
    {
        return pmFlowChartMapper.selectPmFlowChartByFlowChartId(flowChartId);
    }

    /**
     * 查询流程图列表
     *
     * @param pmFlowChart 流程图
     * @return 流程图
     */
    @Override
    public List<PmFlowChart> selectPmFlowChartList(PmFlowChart pmFlowChart)
    {
        return pmFlowChartMapper.selectPmFlowChartList(pmFlowChart);
    }

    /**
     * 新增流程图
     *
     * @param pmFlowChart 流程图
     * @return 结果
     */
    @Override
    public int insertPmFlowChart(PmFlowChart pmFlowChart)
    {
        pmFlowChart.setCreateTime(DateUtils.getNowDate());
        return pmFlowChartMapper.insertPmFlowChart(pmFlowChart);
    }

    /**
     * 修改流程图
     *
     * @param pmFlowChart 流程图
     * @return 结果
     */
    @Override
    public int updatePmFlowChart(PmFlowChart pmFlowChart)
    {
        pmFlowChart.setUpdateTime(DateUtils.getNowDate());
        return pmFlowChartMapper.updatePmFlowChart(pmFlowChart);
    }

    /**
     * 批量删除流程图
     *
     * @param flowChartIds 需要删除的流程图主键
     * @return 结果
     */
    @Override
    public int deletePmFlowChartByFlowChartIds(Long[] flowChartIds)
    {
        return pmFlowChartMapper.deletePmFlowChartByFlowChartIds(flowChartIds);
    }

    /**
     * 删除流程图信息
     *
     * @param flowChartId 流程图主键
     * @return 结果
     */
    @Override
    public int deletePmFlowChartByFlowChartId(Long flowChartId)
    {
        return pmFlowChartMapper.deletePmFlowChartByFlowChartId(flowChartId);
    }
}
