|
@@ -1,42 +1,43 @@
|
|
|
-package cn.com.qmth.examcloud.core.examwork.dao;
|
|
|
-
|
|
|
-import java.util.List;
|
|
|
-
|
|
|
-import org.springframework.data.jpa.repository.JpaRepository;
|
|
|
-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.query.QueryByExampleExecutor;
|
|
|
-
|
|
|
-import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamStudentEntity;
|
|
|
-
|
|
|
-public interface ExamStudentRepo
|
|
|
- extends
|
|
|
- JpaRepository<ExamStudentEntity, Long>,
|
|
|
- QueryByExampleExecutor<ExamStudentEntity>,
|
|
|
- JpaSpecificationExecutor<ExamStudentEntity> {
|
|
|
-
|
|
|
- List<ExamStudentEntity> findByStudentId(Long examId);
|
|
|
-
|
|
|
- List<ExamStudentEntity> findByIdIn(List<Long> ids);
|
|
|
-
|
|
|
- @Modifying
|
|
|
- @Query("delete from ExamStudentEntity s where s.examId = ?1")
|
|
|
- void deleteByExamId(Long examId);
|
|
|
-
|
|
|
- ExamStudentEntity findByExamIdAndStudentIdAndCourseId(Long examId, Long studentId,
|
|
|
- Long courseId);
|
|
|
-
|
|
|
- @Modifying
|
|
|
- @Query("update ExamStudentEntity s set s.name = ?1, s.studentCode=?2 where s.studentId = ?3")
|
|
|
- void updateStudent(String name, String studentCode, Long studentId);
|
|
|
-
|
|
|
- @Modifying
|
|
|
- @Query("update ExamStudentEntity s set s.courseName = ?1, s.courseLevel = ?2 where s.courseId = ?3")
|
|
|
- void updateCourse(String courseName, String courseLevel, Long courseId);
|
|
|
-
|
|
|
- int countByExamIdAndCourseIdAndPaperType(Long examId, Long courseId, String paperType);
|
|
|
-
|
|
|
- int countByExamIdAndCourseId(Long examId, Long courseId);
|
|
|
-
|
|
|
-}
|
|
|
+package cn.com.qmth.examcloud.core.examwork.dao;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+import org.springframework.data.jpa.repository.JpaRepository;
|
|
|
+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.query.QueryByExampleExecutor;
|
|
|
+
|
|
|
+import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamStudentEntity;
|
|
|
+
|
|
|
+public interface ExamStudentRepo
|
|
|
+ extends
|
|
|
+ JpaRepository<ExamStudentEntity, Long>,
|
|
|
+ QueryByExampleExecutor<ExamStudentEntity>,
|
|
|
+ JpaSpecificationExecutor<ExamStudentEntity> {
|
|
|
+
|
|
|
+ List<ExamStudentEntity> findByStudentId(Long examId);
|
|
|
+
|
|
|
+ List<ExamStudentEntity> findByIdIn(List<Long> ids);
|
|
|
+
|
|
|
+ @Modifying
|
|
|
+ @Query("delete from ExamStudentEntity s where s.examId = ?1")
|
|
|
+ void deleteByExamId(Long examId);
|
|
|
+
|
|
|
+ ExamStudentEntity findByExamIdAndStudentIdAndCourseId(Long examId, Long studentId,
|
|
|
+ Long courseId);
|
|
|
+
|
|
|
+ @Modifying
|
|
|
+ @Query("update ExamStudentEntity s set s.name = ?1, s.studentCode=?2 where s.studentId = ?3")
|
|
|
+ void updateStudent(String name, String studentCode, Long studentId);
|
|
|
+
|
|
|
+ @Modifying
|
|
|
+ @Query("update ExamStudentEntity s set s.courseName = ?1, s.courseLevel = ?2 where s.courseId = ?3")
|
|
|
+ void updateCourse(String courseName, String courseLevel, Long courseId);
|
|
|
+
|
|
|
+ List<ExamStudentEntity> findTop2ByExamIdAndCourseIdAndPaperType(Long examId, Long courseId,
|
|
|
+ String paperType);
|
|
|
+
|
|
|
+ List<ExamStudentEntity> findTop2ByExamIdAndCourseId(Long examId, Long courseId);
|
|
|
+
|
|
|
+}
|