|
@@ -2,7 +2,6 @@ package cn.com.qmth.stmms.biz.exam.dao;
|
|
|
|
|
|
import cn.com.qmth.stmms.biz.exam.model.ExamStudent;
|
|
|
import cn.com.qmth.stmms.common.enums.SubjectiveStatus;
|
|
|
-
|
|
|
import org.springframework.data.domain.Pageable;
|
|
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
|
|
import org.springframework.data.jpa.repository.Modifying;
|
|
@@ -12,8 +11,8 @@ import org.springframework.data.repository.PagingAndSortingRepository;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
|
|
|
-public interface ExamStudentDao extends PagingAndSortingRepository<ExamStudent, Integer>,
|
|
|
- JpaSpecificationExecutor<ExamStudent> {
|
|
|
+public interface ExamStudentDao
|
|
|
+ extends PagingAndSortingRepository<ExamStudent, Integer>, JpaSpecificationExecutor<ExamStudent> {
|
|
|
|
|
|
public List<ExamStudent> findByExamId(int examId, Pageable pageable);
|
|
|
|
|
@@ -71,8 +70,8 @@ public interface ExamStudentDao extends PagingAndSortingRepository<ExamStudent,
|
|
|
|
|
|
@Modifying
|
|
|
@Query("update ExamStudent s set s.subjectiveStatus=?3, s.subjectiveScore=?4, s.subjectiveScoreList=?5,s.inspectTime=?6,s.inspectorId=?7 where s.examId=?1 and s.subjectCode=?2")
|
|
|
- public void updateSubjectiveStatusAndScore(Integer examId, String subjetCode, SubjectiveStatus status,
|
|
|
- double score, String scoreList, Date inspectTime, Integer inspectorId);
|
|
|
+ public void updateSubjectiveStatusAndScore(Integer examId, String subjetCode, SubjectiveStatus status, double score,
|
|
|
+ String scoreList, Date inspectTime, Integer inspectorId);
|
|
|
|
|
|
@Modifying
|
|
|
@Query("update ExamStudent s set s.subjectiveStatus=?3, s.subjectiveScore=?4, s.subjectiveScoreList=?5 "
|
|
@@ -144,7 +143,8 @@ public interface ExamStudentDao extends PagingAndSortingRepository<ExamStudent,
|
|
|
|
|
|
@Query("select s from ExamStudent s where s.examId=?1 and s.subjectCode=?2 and s.upload=true and s.absent=false and s.breach=false and s.uploadTime!=null "
|
|
|
+ "and not exists (select l.id from MarkLibrary l where l.studentId=s.id and l.groupNumber=?3)")
|
|
|
- public List<ExamStudent> findUnLibraryStudent(Integer examId, String subjectCode, Integer groupNumber, Pageable page);
|
|
|
+ public List<ExamStudent> findUnLibraryStudent(Integer examId, String subjectCode, Integer groupNumber,
|
|
|
+ Pageable page);
|
|
|
|
|
|
@Query("select s from ExamStudent s where s.examId=?1 and s.subjectCode=?2 and s.upload=true and s.absent=false and s.breach=false and s.uploadTime!=null and s.uploadTime>=?4 "
|
|
|
+ "and not exists (select l.id from MarkLibrary l where l.studentId=s.id and l.groupNumber=?3)")
|
|
@@ -171,17 +171,18 @@ public interface ExamStudentDao extends PagingAndSortingRepository<ExamStudent,
|
|
|
@Query("select s.className from ExamStudent s where s.examId=?1 and s.subjectCode=?2 group by s.className")
|
|
|
public List<String> findDistinctClassName(Integer examId, String subjectCode);
|
|
|
|
|
|
- @Query(value = "select cast(s.objective_score as decimal)+cast(s.subjective_score as decimal) from eb_exam_student s where s.exam_id=?1 and s.subject_code=?2 and s.is_upload =true and s.is_absent=false and s.is_breach=false order by s.objective_score+s.subjective_score desc limit ?3 ", nativeQuery = true)
|
|
|
- public List<Double> findHighCountTotalSocreByExamIdAndSubjectCode(Integer examId, String subjectCode, int highCount);
|
|
|
+ @Query(value = "select cast(s.objective_score as decimal)+cast(s.subjective_score as decimal) from eb_exam_student s where s.exam_id=?1 and s.subject_code=?2 and s.is_upload =true and s.is_absent=false and s.is_breach=false order by cast(s.objective_score as decimal)+cast(s.subjective_score as decimal) desc limit ?3 ", nativeQuery = true)
|
|
|
+ public List<Double> findHighCountTotalSocreByExamIdAndSubjectCode(Integer examId, String subjectCode,
|
|
|
+ int highCount);
|
|
|
|
|
|
- @Query(value = "select cast(s.objective_score as decimal)+cast(s.subjective_score as decimal) from eb_exam_student s where s.exam_id=?1 and s.subject_code=?2 and s.is_upload =true and s.is_absent=false and s.is_breach=false order by s.objective_score+s.subjective_score asc limit ?3 ", nativeQuery = true)
|
|
|
+ @Query(value = "select cast(s.objective_score as decimal)+cast(s.subjective_score as decimal) from eb_exam_student s where s.exam_id=?1 and s.subject_code=?2 and s.is_upload =true and s.is_absent=false and s.is_breach=false order by cast(s.objective_score as decimal)+cast(s.subjective_score as decimal) asc limit ?3 ", nativeQuery = true)
|
|
|
public List<Double> findLowCountTotalSocreByExamIdAndSubjectCode(Integer examId, String subjectCode, int lowCount);
|
|
|
|
|
|
- @Query(value = "select s.objective_score+s.subjective_score from eb_exam_student s where s.exam_id=?1 and s.subject_code=?2 and s.class_name=?3 and s.is_upload =true and s.is_absent=false and s.is_breach=false order by s.objective_score+s.subjective_score desc limit ?4 ", nativeQuery = true)
|
|
|
+ @Query(value = "select cast(s.objective_score as decimal)+cast(s.subjective_score as decimal) from eb_exam_student s where s.exam_id=?1 and s.subject_code=?2 and s.class_name=?3 and s.is_upload =true and s.is_absent=false and s.is_breach=false order by cast(s.objective_score as decimal)+cast(s.subjective_score as decimal) desc limit ?4 ", nativeQuery = true)
|
|
|
public List<Double> findHighCountTotalSocreByExamIdAndSubjectCodeAndClass(Integer examId, String subjectCode,
|
|
|
String className, int highCount);
|
|
|
|
|
|
- @Query(value = "select s.objective_score+s.subjective_score from eb_exam_student s where s.exam_id=?1 and s.subject_code=?2 and s.class_name=?3 and s.is_upload =true and s.is_absent=false and s.is_breach=false order by s.objective_score+s.subjective_score asc limit ?4 ", nativeQuery = true)
|
|
|
+ @Query(value = "select cast(s.objective_score as decimal)+cast(s.subjective_score as decimal) from eb_exam_student s where s.exam_id=?1 and s.subject_code=?2 and s.class_name=?3 and s.is_upload =true and s.is_absent=false and s.is_breach=false order by cast(s.objective_score as decimal)+cast(s.subjective_score as decimal) asc limit ?4 ", nativeQuery = true)
|
|
|
public List<Double> findLowCountTotalSocreByExamIdAndSubjectCodeAndClass(Integer examId, String subjectCode,
|
|
|
String className, int lowCount);
|
|
|
|
|
@@ -193,6 +194,7 @@ public interface ExamStudentDao extends PagingAndSortingRepository<ExamStudent,
|
|
|
public void updateSubjectiveStatusAndTimeAndInspectorId(Integer studentId, SubjectiveStatus status,
|
|
|
Date inspectTime, Integer inspectorId);
|
|
|
|
|
|
- public List<ExamStudent> findByExamIdAndStudentCodeAndSubjectCode(int examId, String studentCode, String subjectCode);
|
|
|
+ public List<ExamStudent> findByExamIdAndStudentCodeAndSubjectCode(int examId, String studentCode,
|
|
|
+ String subjectCode);
|
|
|
|
|
|
}
|