|
@@ -1,64 +1,70 @@
|
|
|
-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);
|
|
|
-
|
|
|
- @Query(value = "select distinct org_id from ec_e_exam_student t where t.org_id>?2 and t.exam_id=?1 order by org_id limit 500", nativeQuery = true)
|
|
|
- List<Long> queryOrgIdList(Long examId, Long start);
|
|
|
-
|
|
|
- @Query(value = "select distinct exam_site from ec_e_exam_student t where t.exam_site>?2 and t.exam_id=?1 order by exam_site limit 500", nativeQuery = true)
|
|
|
- List<String> queryExamSiteList(Long examId, String start);
|
|
|
-
|
|
|
- @Query(value = "select distinct ext1 from ec_e_exam_student t where t.ext1>?2 and t.exam_id=?1 order by ext1 limit 500", nativeQuery = true)
|
|
|
- List<String> queryExt1List(Long examId, String start);
|
|
|
-
|
|
|
- @Query(value = "select distinct ext2 from ec_e_exam_student t where t.ext2>?2 and t.exam_id=?1 order by ext2 limit 500", nativeQuery = true)
|
|
|
- List<String> queryExt2List(Long examId, String start);
|
|
|
-
|
|
|
- @Query(value = "select distinct ext3 from ec_e_exam_student t where t.ext3>?2 and t.exam_id=?1 order by ext3 limit 500", nativeQuery = true)
|
|
|
- List<String> queryExt3List(Long examId, String start);
|
|
|
-
|
|
|
- @Query(value = "select distinct ext4 from ec_e_exam_student t where t.ext4>?2 and t.exam_id=?1 order by ext4 limit 500", nativeQuery = true)
|
|
|
- List<String> queryExt4List(Long examId, String start);
|
|
|
-
|
|
|
- @Query(value = "select distinct ext5 from ec_e_exam_student t where t.ext5>?2 and t.exam_id=?1 order by ext5 limit 500", nativeQuery = true)
|
|
|
- List<String> queryExt5List(Long examId, String start);
|
|
|
-
|
|
|
-}
|
|
|
+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);
|
|
|
+
|
|
|
+ @Query(value = "select distinct org_id from ec_e_exam_student t where t.org_id>?2 and t.exam_id=?1 order by org_id limit 500", nativeQuery = true)
|
|
|
+ List<Long> queryOrgIdList(Long examId, Long start);
|
|
|
+
|
|
|
+ @Query(value = "select distinct exam_site from ec_e_exam_student t where t.exam_site>?2 and t.exam_id=?1 order by exam_site limit 500", nativeQuery = true)
|
|
|
+ List<String> queryExamSiteList(Long examId, String start);
|
|
|
+
|
|
|
+ @Query(value = "select distinct ext1 from ec_e_exam_student t where t.ext1>?2 and t.exam_id=?1 order by ext1 limit 500", nativeQuery = true)
|
|
|
+ List<String> queryExt1List(Long examId, String start);
|
|
|
+
|
|
|
+ @Query(value = "select distinct ext2 from ec_e_exam_student t where t.ext2>?2 and t.exam_id=?1 order by ext2 limit 500", nativeQuery = true)
|
|
|
+ List<String> queryExt2List(Long examId, String start);
|
|
|
+
|
|
|
+ @Query(value = "select distinct ext3 from ec_e_exam_student t where t.ext3>?2 and t.exam_id=?1 order by ext3 limit 500", nativeQuery = true)
|
|
|
+ List<String> queryExt3List(Long examId, String start);
|
|
|
+
|
|
|
+ @Query(value = "select distinct ext4 from ec_e_exam_student t where t.ext4>?2 and t.exam_id=?1 order by ext4 limit 500", nativeQuery = true)
|
|
|
+ List<String> queryExt4List(Long examId, String start);
|
|
|
+
|
|
|
+ @Query(value = "select distinct ext5 from ec_e_exam_student t where t.ext5>?2 and t.exam_id=?1 order by ext5 limit 500", nativeQuery = true)
|
|
|
+ List<String> queryExt5List(Long examId, String start);
|
|
|
+
|
|
|
+ @Query(value = "select distinct specialty_name from ec_e_exam_student t where t.student_id=?1", nativeQuery = true)
|
|
|
+ List<String> querySpecialtyNameList(Long studentId);
|
|
|
+
|
|
|
+ @Query(value = "select distinct course_level from ec_e_exam_student t where t.student_id=?1", nativeQuery = true)
|
|
|
+ List<String> queryCourseLevelList(Long studentId);
|
|
|
+
|
|
|
+}
|