package cn.com.qmth.stmms.biz.mark.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.common.BaseQueryService;
import cn.com.qmth.stmms.biz.mark.dao.MarkTrackDao;
import cn.com.qmth.stmms.biz.mark.model.MarkTrack;
import cn.com.qmth.stmms.biz.mark.service.MarkTrackService;

@Service("markTrackService")
public class MarkTrackServiceImpl extends BaseQueryService<MarkTrack> implements MarkTrackService {

    @Autowired
    private MarkTrackDao markTrackDao;

    @Override
    public List<MarkTrack> findByStudentId(Integer studentId) {
        return markTrackDao.findByPkStudentId(studentId);
    }

    @Transactional
    @Override
    public MarkTrack save(MarkTrack track) {
        return markTrackDao.save(track);
    }

    @Transactional
    @Override
    public void deleteByStudentId(Integer studentId) {
        markTrackDao.deleteByStudentId(studentId);
    }

    @Transactional
    @Override
    public void deleteByStudentIdAndQuestionNumber(Integer studentId, String questionNumber) {
        markTrackDao.deleteByStudentIdAndQuestionNumber(studentId, questionNumber);
    }

    @Transactional
    @Override
    public void deleteByExamId(Integer examId) {
        markTrackDao.deleteByExamId(examId);
    }

    @Transactional
    @Override
    public void deleteByExamIdAndSubjectCode(Integer examId, String subjectCode) {
        markTrackDao.deleteByExamIdAndSubjectCode(examId, subjectCode);
    }

    @Transactional
    @Override
    public void deleteByMarkerId(Integer markerId) {
        markTrackDao.deleteByMarkerId(markerId);
    }
}
