package cn.com.qmth.stmms.biz.exam.dao;

import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;

import cn.com.qmth.stmms.biz.exam.model.ScoreRate;
import cn.com.qmth.stmms.biz.exam.model.ScoreRatePK;

public interface ScoreRateDao extends PagingAndSortingRepository<ScoreRate, ScoreRatePK>,
        JpaSpecificationExecutor<ScoreRate> {

//    @Query("select q from ExamQuestion q where q.pk.examId=?1 and q.pk.subjectCode=?2 and q.pk.objective=?3 order by q.pk.mainNumber, q.pk.subNumber")
//    public List<ExamQuestion> findByExamIdAndSubjectCodeAndObjective(int examId, String subjectCode, boolean objective);
//
//    @Query("select q from ExamQuestion q where q.pk.examId=?1 and q.pk.subjectCode=?2 and q.pk.objective=?3 and q.pk.mainNumber=?4 order by q.pk.subNumber")
//    public List<ExamQuestion> findByExamIdAndSubjectCodeAndObjectiveAndMainNumber(int examId, String subjectCode,
//            boolean objective, int mainNumber);
//
//    @Query("select count(q) from ExamQuestion q where q.pk.examId=?1 and q.pk.subjectCode=?2")
//    public long countByExamIdAndSubjectCode(int examId, String subjectCode);
//
//    @Query("select count(q) from ExamQuestion q where q.pk.examId=?1 and q.pk.subjectCode=?2 and q.pk.objective=?3")
//    public long countByExamIdAndSubjectCodeAndObjective(int examId, String subjectCode, boolean objective);
//
//    @Modifying
//    @Query("delete from ExamQuestion q where q.pk.examId=?1")
//    public void deleteByExamId(int examId);
//
//    @Modifying
//    @Query("delete from ExamQuestion q where q.pk.examId=?1 and q.pk.subjectCode=?2")
//    public void deleteByExamIdAndSubjectCode(int examId, String subjectCode);
//
//    @Modifying
//    @Query("delete from ExamQuestion q where q.pk.examId=?1 and q.pk.subjectCode=?2 and q.pk.objective=?3")
//    public void deleteByExamIdAndSubjectCodeAndObjective(int examId, String subjectCode, boolean objective);
}
