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

import cn.com.qmth.stmms.biz.report.model.ReportSubjectRange;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

/**
 * 课程分段统计 Dao
 *
 * @author xuwenjin
 * @date 2019-04-19
 */
public interface ReportSubjectRangeDao
        extends PagingAndSortingRepository<ReportSubjectRange, Integer>, JpaSpecificationExecutor<ReportSubjectRange> {

    @Modifying
    @Query("delete from ReportSubjectRange r where r.examId=?1 ")
    void deleteByExamId(Integer exmaId);

    @Modifying
    @Query("delete from ReportSubjectRange r where r.examId=?1 and r.subjectCode=?2")
    void deleteByExamIdAndSubjectCode(Integer examId, String subjectCode);
}
