package com.ruoyi.model.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.model.vo.ExaminationVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.model.mapper.ExaminationMapper;
import com.ruoyi.model.domain.Examination;
import com.ruoyi.model.service.IExaminationService;

/**
 * 考核Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-05
 */
@Service
public class ExaminationServiceImpl implements IExaminationService 
{
    @Autowired
    private ExaminationMapper examinationMapper;

    /**
     * 查询考核
     * 
     * @param examinationId 考核主键
     * @return 考核
     */
    @Override
    public Examination selectExaminationByExaminationId(Long examinationId)
    {
        return examinationMapper.selectExaminationByExaminationId(examinationId);
    }

    /**
     * 查询考核列表
     * 
     * @param examination 考核
     * @return 考核
     */
    @Override
    public List<Examination> selectExaminationList(Examination examination)
    {
        return examinationMapper.selectExaminationList(examination);
    }

    /**
     * 新增考核
     * 
     * @param examination 考核
     * @return 结果
     */
    @Override
    public int insertExamination(Examination examination)
    {
        examination.setCreateTime(DateUtils.getNowDate());
        return examinationMapper.insertExamination(examination);
    }

    /**
     * 修改考核
     * 
     * @param examination 考核
     * @return 结果
     */
    @Override
    public int updateExamination(Examination examination)
    {
        examination.setUpdateTime(DateUtils.getNowDate());
        return examinationMapper.updateExamination(examination);
    }

    /**
     * 批量删除考核
     * 
     * @param examinationIds 需要删除的考核主键
     * @return 结果
     */
    @Override
    public int deleteExaminationByExaminationIds(Long[] examinationIds)
    {
        return examinationMapper.deleteExaminationByExaminationIds(examinationIds);
    }

    /**
     * 删除考核信息
     * 
     * @param examinationId 考核主键
     * @return 结果
     */
    @Override
    public int deleteExaminationByExaminationId(Long examinationId)
    {
        return examinationMapper.deleteExaminationByExaminationId(examinationId);
    }

    /**
     * 根据考题类型查询考题列表
     *
     * @param examinationTypeId 考题类型
     * @return 考核集合
     */
    @Override
    public List<ExaminationVo> getExaminationType(Long examinationTypeId) {
        return examinationMapper.getExaminationType(examinationTypeId);
    }
}
