package cn.com.qmth.stmms.biz.exam.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.com.qmth.stmms.biz.exam.dao.ExamStudentPaperDao;
import cn.com.qmth.stmms.biz.exam.model.ExamStudentPaper;
import cn.com.qmth.stmms.biz.exam.service.ExamStudentPaperService;

@Service
public class ExamStudentPaperServiceImpl implements ExamStudentPaperService {

    @Autowired
    private ExamStudentPaperDao examStudentPaperDao;

    @Transactional
    @Override
    public ExamStudentPaper save(ExamStudentPaper paper) {
        return examStudentPaperDao.save(paper);
    }

    @Transactional
    @Override
    public int save(List<ExamStudentPaper> paperList) {
        examStudentPaperDao.save(paperList);
        return paperList.size();
    }

    @Override
    public ExamStudentPaper find(int examId, String examNumber, boolean objective) {
        return examStudentPaperDao.findByPkExamIdAndPkExamNumberAndPkObjective(examId, examNumber, objective);
    }
}
