package com.ruoyi.abuwx.service.impl.exam;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.abuwx.mapper.exam.ExmQuestionTypeMapper;
import com.ruoyi.abuwx.domain.exam.ExmQuestionType;
import com.ruoyi.abuwx.service.exam.IExmQuestionTypeService;

/**
 * 题库Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-05-17
 */
@Service
public class ExmQuestionTypeServiceImpl implements IExmQuestionTypeService 
{
    @Autowired
    private ExmQuestionTypeMapper exmQuestionTypeMapper;

    /**
     * 查询题库
     * 
     * @param id 题库主键
     * @return 题库
     */
    @Override
    public ExmQuestionType selectExmQuestionTypeById(Long id)
    {
        return exmQuestionTypeMapper.selectExmQuestionTypeById(id);
    }

    /**
     * 查询题库列表
     * 
     * @param exmQuestionType 题库
     * @return 题库
     */
    @Override
    public List<ExmQuestionType> selectExmQuestionTypeList(ExmQuestionType exmQuestionType)
    {
        return exmQuestionTypeMapper.selectExmQuestionTypeList(exmQuestionType);
    }

    /**
     * 新增题库
     * 
     * @param exmQuestionType 题库
     * @return 结果
     */
    @Override
    public int insertExmQuestionType(ExmQuestionType exmQuestionType)
    {
        exmQuestionType.setCreateUserId(SecurityUtils.getUserId());
        return exmQuestionTypeMapper.insertExmQuestionType(exmQuestionType);
    }

    /**
     * 修改题库
     * 
     * @param exmQuestionType 题库
     * @return 结果
     */
    @Override
    public int updateExmQuestionType(ExmQuestionType exmQuestionType)
    {
        exmQuestionType.setUpdateTime(DateUtils.getNowDate());
        return exmQuestionTypeMapper.updateExmQuestionType(exmQuestionType);
    }

    /**
     * 批量删除题库
     * 
     * @param ids 需要删除的题库主键
     * @return 结果
     */
    @Override
    public int deleteExmQuestionTypeByIds(Long[] ids)
    {
        return exmQuestionTypeMapper.deleteExmQuestionTypeByIds(ids);
    }

    /**
     * 删除题库信息
     * 
     * @param id 题库主键
     * @return 结果
     */
    @Override
    public int deleteExmQuestionTypeById(Long id)
    {
        return exmQuestionTypeMapper.deleteExmQuestionTypeById(id);
    }
}
