|
@@ -7,6 +7,7 @@ import org.springframework.data.jpa.repository.Query;
|
|
import org.springframework.data.repository.PagingAndSortingRepository;
|
|
import org.springframework.data.repository.PagingAndSortingRepository;
|
|
|
|
|
|
import cn.com.qmth.stmms.biz.exam.model.SelectiveStudent;
|
|
import cn.com.qmth.stmms.biz.exam.model.SelectiveStudent;
|
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
public interface SelectiveStudentDao extends JpaRepository<SelectiveStudent, Integer>,
|
|
public interface SelectiveStudentDao extends JpaRepository<SelectiveStudent, Integer>,
|
|
PagingAndSortingRepository<SelectiveStudent, Integer>, JpaSpecificationExecutor<SelectiveStudent> {
|
|
PagingAndSortingRepository<SelectiveStudent, Integer>, JpaSpecificationExecutor<SelectiveStudent> {
|
|
@@ -16,6 +17,7 @@ public interface SelectiveStudentDao extends JpaRepository<SelectiveStudent, Int
|
|
void deleteByExamIdAndSubjectCode(Integer examId, String subjectCode);
|
|
void deleteByExamIdAndSubjectCode(Integer examId, String subjectCode);
|
|
|
|
|
|
@Modifying(clearAutomatically = true)
|
|
@Modifying(clearAutomatically = true)
|
|
|
|
+ @Transactional
|
|
@Query("delete SelectiveStudent s where s.studentId=?1")
|
|
@Query("delete SelectiveStudent s where s.studentId=?1")
|
|
void deleteByStudentId(Integer studentId);
|
|
void deleteByStudentId(Integer studentId);
|
|
@Query("select count(s) from SelectiveStudent s where s.examId=?1 and s.subjectCode=?2 and (s.lessSelective=?3 or s.notSelective=?4)")
|
|
@Query("select count(s) from SelectiveStudent s where s.examId=?1 and s.subjectCode=?2 and (s.lessSelective=?3 or s.notSelective=?4)")
|