package com.ruoyi.learn.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.learn.mapper.LearnExamineeMapper;
import com.ruoyi.learn.domain.LearnExaminee;
import com.ruoyi.learn.service.ILearnExamineeService;

/**
 * 答卷Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-09-25
 */
@Service
public class LearnExamineeServiceImpl implements ILearnExamineeService 
{
    @Autowired
    private LearnExamineeMapper learnExamineeMapper;

    /**
     * 查询答卷
     * 
     * @param examineeId 答卷主键
     * @return 答卷
     */
    @Override
    public LearnExaminee selectLearnExamineeByExamineeId(Long examineeId)
    {
        return learnExamineeMapper.selectLearnExamineeByExamineeId(examineeId);
    }

    /**
     * 查询答卷列表
     * 
     * @param learnExaminee 答卷
     * @return 答卷
     */
    @Override
    public List<LearnExaminee> selectLearnExamineeList(LearnExaminee learnExaminee)
    {
        return learnExamineeMapper.selectLearnExamineeList(learnExaminee);
    }

    /**
     * 新增答卷
     * 
     * @param learnExaminee 答卷
     * @return 结果
     */
    @Override
    public int insertLearnExaminee(LearnExaminee learnExaminee)
    {
        learnExaminee.setCreateTime(DateUtils.getNowDate());
        return learnExamineeMapper.insertLearnExaminee(learnExaminee);
    }

    /**
     * 修改答卷
     * 
     * @param learnExaminee 答卷
     * @return 结果
     */
    @Override
    public int updateLearnExaminee(LearnExaminee learnExaminee)
    {
        learnExaminee.setUpdateTime(DateUtils.getNowDate());
        return learnExamineeMapper.updateLearnExaminee(learnExaminee);
    }

    /**
     * 批量删除答卷
     * 
     * @param examineeIds 需要删除的答卷主键
     * @return 结果
     */
    @Override
    public int deleteLearnExamineeByExamineeIds(Long[] examineeIds)
    {
        return learnExamineeMapper.deleteLearnExamineeByExamineeIds(examineeIds);
    }

    /**
     * 删除答卷信息
     * 
     * @param examineeId 答卷主键
     * @return 结果
     */
    @Override
    public int deleteLearnExamineeByExamineeId(Long examineeId)
    {
        return learnExamineeMapper.deleteLearnExamineeByExamineeId(examineeId);
    }
}
