package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.ExamineConfig;
import com.ruoyi.system.mapper.ExamineConfigMapper;
import com.ruoyi.system.service.IExamineConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 审核角色配置Service业务层处理
 *
 * @author boman
 * @date 2022-01-24
 */
@Service
public class ExamineConfigServiceImpl implements IExamineConfigService {
    @Autowired
    private ExamineConfigMapper examineConfigMapper;

    /**
     * 查询审核角色配置
     *
     * @param id 审核角色配置主键
     * @return 审核角色配置
     */
    @Override
    public ExamineConfig selectExamineConfigById(Long id) {
        return examineConfigMapper.selectExamineConfigById(id);
    }

    /**
     * 查询审核角色配置列表
     *
     * @param examineConfig 审核角色配置
     * @return 审核角色配置
     */
    @Override
    public List<ExamineConfig> selectExamineConfigList(ExamineConfig examineConfig) {
        return examineConfigMapper.selectExamineConfigList(examineConfig);
    }

    /**
     * 新增审核角色配置
     *
     * @param examineConfig 审核角色配置
     * @return 结果
     */
    @Override
    public int insertExamineConfig(ExamineConfig examineConfig) {
        examineConfig.setCreateTime(DateUtils.getNowDate());
        return examineConfigMapper.insertExamineConfig(examineConfig);
    }

    /**
     * 修改审核角色配置
     *
     * @param examineConfig 审核角色配置
     * @return 结果
     */
    @Override
    public int updateExamineConfig(ExamineConfig examineConfig) {
        examineConfig.setUpdateTime(DateUtils.getNowDate());
        return examineConfigMapper.updateExamineConfig(examineConfig);
    }

    /**
     * 批量删除审核角色配置
     *
     * @param ids 需要删除的审核角色配置主键
     * @return 结果
     */
    @Override
    public int deleteExamineConfigByIds(Long[] ids) {
        return examineConfigMapper.deleteExamineConfigByIds(ids);
    }

    /**
     * 删除审核角色配置信息
     *
     * @param id 审核角色配置主键
     * @return 结果
     */
    @Override
    public int deleteExamineConfigById(Long id) {
        return examineConfigMapper.deleteExamineConfigById(id);
    }

    /**
     * 根据审批等级查看角色列表
     *
     * @param level
     * @return
     */
    @Override
    public List<ExamineConfig> selectExamineConfigByLevel(String level) {
        return examineConfigMapper.selectExamineConfigByLevel(level);
    }
}
