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 cn.com.qmth.stmms.biz.common.BaseQueryService;
import cn.com.qmth.stmms.biz.mark.dao.TagInfoDao;
import cn.com.qmth.stmms.biz.mark.model.TagInfo;
import cn.com.qmth.stmms.biz.mark.service.TagInfoService;
import cn.com.qmth.stmms.common.enums.TagType;

@Service
public class TagInfoServiceImpl extends BaseQueryService<TagInfo> implements TagInfoService {

    @Autowired
    private TagInfoDao tagInfoDao;

    @Override
    public List<TagInfo> findByLibraryId(Integer libraryId) {
        return tagInfoDao.findByLibraryId(libraryId);
    }

    @Override
    public TagInfo findByStudentIdAndType(Integer studentId, TagType type) {
        return tagInfoDao.findByStudentIdAndType(studentId, type);
    }

    @Override
    public void deleteByLibraryId(Integer libraryId) {
        tagInfoDao.deleteByLibraryId(libraryId);
    }

    @Override
    public TagInfo save(TagInfo tagInfo) {
        return tagInfoDao.save(tagInfo);
    }

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

    @Override
    public void deleteByExamId(int examId) {
        tagInfoDao.deleteByExam(examId);
    }

    @Override
    public void deleteByExamAndSubject(Integer examId, String subjectCode) {
        tagInfoDao.deleteByExamAndSubject(examId, subjectCode);        
    }

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

}
