|
@@ -1,15 +1,14 @@
|
|
package cn.com.qmth.stmms.biz.exam.dao;
|
|
package cn.com.qmth.stmms.biz.exam.dao;
|
|
|
|
|
|
-import java.util.Date;
|
|
|
|
-import java.util.List;
|
|
|
|
-
|
|
|
|
|
|
+import cn.com.qmth.stmms.biz.exam.model.ExamStudent;
|
|
import org.springframework.data.domain.Pageable;
|
|
import org.springframework.data.domain.Pageable;
|
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
|
import org.springframework.data.jpa.repository.Modifying;
|
|
import org.springframework.data.jpa.repository.Modifying;
|
|
import org.springframework.data.jpa.repository.Query;
|
|
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.ExamStudent;
|
|
|
|
|
|
+import java.util.Date;
|
|
|
|
+import java.util.List;
|
|
|
|
|
|
public interface ExamStudentDao
|
|
public interface ExamStudentDao
|
|
extends PagingAndSortingRepository<ExamStudent, Integer>, JpaSpecificationExecutor<ExamStudent> {
|
|
extends PagingAndSortingRepository<ExamStudent, Integer>, JpaSpecificationExecutor<ExamStudent> {
|
|
@@ -17,7 +16,7 @@ public interface ExamStudentDao
|
|
public List<ExamStudent> findByExamId(int examId, Pageable pageable);
|
|
public List<ExamStudent> findByExamId(int examId, Pageable pageable);
|
|
|
|
|
|
public List<ExamStudent> findByExamIdAndUploadAndAbsent(int examId, boolean upload, boolean absent,
|
|
public List<ExamStudent> findByExamIdAndUploadAndAbsent(int examId, boolean upload, boolean absent,
|
|
- Pageable pageable);
|
|
|
|
|
|
+ Pageable pageable);
|
|
|
|
|
|
public List<ExamStudent> findByExamIdAndCampusName(int examId, String campusName, Pageable pageable);
|
|
public List<ExamStudent> findByExamIdAndCampusName(int examId, String campusName, Pageable pageable);
|
|
|
|
|
|
@@ -63,7 +62,7 @@ public interface ExamStudentDao
|
|
@Modifying
|
|
@Modifying
|
|
@Query("update ExamStudent s set s.subjectName=?3, s.subjectLevel=?4, s.subjectCategory=?5 where s.examId=?1 and s.subjectCode=?2")
|
|
@Query("update ExamStudent s set s.subjectName=?3, s.subjectLevel=?4, s.subjectCategory=?5 where s.examId=?1 and s.subjectCode=?2")
|
|
public void updateSubjectInfo(int examId, String subjectCode, String subjectName, String subjectLevel,
|
|
public void updateSubjectInfo(int examId, String subjectCode, String subjectName, String subjectLevel,
|
|
- String subjectCategory);
|
|
|
|
|
|
+ String subjectCategory);
|
|
|
|
|
|
@Modifying
|
|
@Modifying
|
|
@Query("update ExamStudent s set s.exception=?2 where s.id=?1")
|
|
@Query("update ExamStudent s set s.exception=?2 where s.id=?1")
|
|
@@ -81,7 +80,7 @@ public interface ExamStudentDao
|
|
@Query("update ExamStudent s set s.sheetCount=?2, s.sliceCount=?3, s.answers=?4, s.batchCode=?5, s.paperType=?6,"
|
|
@Query("update ExamStudent s set s.sheetCount=?2, s.sliceCount=?3, s.answers=?4, s.batchCode=?5, s.paperType=?6,"
|
|
+ " s.absent=?7, s.upload=true, s.uploadTime=?8, s.objectiveScore=?9, s.objectiveScoreList=?10 where s.id=?1")
|
|
+ " s.absent=?7, s.upload=true, s.uploadTime=?8, s.objectiveScore=?9, s.objectiveScoreList=?10 where s.id=?1")
|
|
public int updateScanInfo(Integer id, Integer sheetCount, Integer sliceCount, String answers, String batchCode,
|
|
public int updateScanInfo(Integer id, Integer sheetCount, Integer sliceCount, String answers, String batchCode,
|
|
- String paperType, boolean absent, Date uploadTime, Double objectiveScore, String objectiveScoreList);
|
|
|
|
|
|
+ String paperType, boolean absent, Date uploadTime, Double objectiveScore, String objectiveScoreList);
|
|
|
|
|
|
@Modifying
|
|
@Modifying
|
|
@Query("update ExamStudent s set s.manualAbsent=0 where s.examId=?1")
|
|
@Query("update ExamStudent s set s.manualAbsent=0 where s.examId=?1")
|
|
@@ -98,34 +97,37 @@ public interface ExamStudentDao
|
|
public ExamStudent findByExamIdAndSubjectCodeAndStudentCode(Integer id, String subjectCode, String studentCode);
|
|
public ExamStudent findByExamIdAndSubjectCodeAndStudentCode(Integer id, String subjectCode, String studentCode);
|
|
|
|
|
|
public ExamStudent findBySchoolIdAndSubjectCodeAndStudentCodeAndRemark(Integer schoolId, String subjectCode,
|
|
public ExamStudent findBySchoolIdAndSubjectCodeAndStudentCodeAndRemark(Integer schoolId, String subjectCode,
|
|
- String studentCode, String examSeqCode);
|
|
|
|
|
|
+ String studentCode, String examSeqCode);
|
|
|
|
|
|
public List<ExamStudent> findByExamIdAndUploadTimeAfter(int examId, Date date);
|
|
public List<ExamStudent> findByExamIdAndUploadTimeAfter(int examId, Date date);
|
|
|
|
|
|
public List<ExamStudent> findByExamIdAndSubjectCodeAndUploadTimeAfter(int examId, String code, Date date,
|
|
public List<ExamStudent> findByExamIdAndSubjectCodeAndUploadTimeAfter(int examId, String code, Date date,
|
|
- Pageable page);
|
|
|
|
|
|
+ Pageable page);
|
|
|
|
|
|
@Query("select count(s) from ExamStudent s where s.examId=?1 and s.subjectiveScoreList != null ")
|
|
@Query("select count(s) from ExamStudent s where s.examId=?1 and s.subjectiveScoreList != null ")
|
|
public long countByExamIdAndSubjectiveScoreListNotNull(Integer examId);
|
|
public long countByExamIdAndSubjectiveScoreListNotNull(Integer examId);
|
|
|
|
|
|
public List<ExamStudent> findByExamIdAndSubjectCodeAndUploadTimeNotNull(int examId, String code);
|
|
public List<ExamStudent> findByExamIdAndSubjectCodeAndUploadTimeNotNull(int examId, String code);
|
|
|
|
|
|
|
|
+ public List<ExamStudent> findByExamIdAndSubjectCodeAndUploadTimeNotNullAndAbsent(int examId, String code, Boolean absent);
|
|
|
|
+
|
|
|
|
+
|
|
@Query("select s from ExamStudent s where s.examId=?1 and s.subjectCode=?2 and s.absent=false and s.breach=false and s.uploadTime!=null "
|
|
@Query("select s from ExamStudent s where s.examId=?1 and s.subjectCode=?2 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)")
|
|
+ "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,
|
|
public List<ExamStudent> findUnLibraryStudent(Integer examId, String subjectCode, Integer groupNumber,
|
|
- Pageable page);
|
|
|
|
|
|
+ Pageable page);
|
|
|
|
|
|
@Query("select s from ExamStudent s where s.examId=?1 and s.subjectCode=?2 and s.absent=false and s.breach=false and s.uploadTime!=null and s.uploadTime>=?4 "
|
|
@Query("select s from ExamStudent s where s.examId=?1 and s.subjectCode=?2 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)")
|
|
+ "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,
|
|
public List<ExamStudent> findUnLibraryStudent(Integer examId, String subjectCode, Integer groupNumber,
|
|
- Date minUploadTime, Pageable page);
|
|
|
|
|
|
+ Date minUploadTime, 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 "
|
|
@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 not exists (select l.id from TrialLibrary l where l.studentId=s.id and l.groupNumber=?3)")
|
|
+ "and not exists (select l.id from TrialLibrary l where l.studentId=s.id and l.groupNumber=?3)")
|
|
public List<ExamStudent> findUnTrialStudent(Integer examId, String subjectCode, Integer groupNumber, Pageable page);
|
|
public List<ExamStudent> findUnTrialStudent(Integer examId, String subjectCode, Integer groupNumber, Pageable page);
|
|
|
|
|
|
@Query("select s from ExamStudent s where s.examId=?1 and s.subjectCode=?2 and (s.absent=true or s.breach=true) and "
|
|
@Query("select s from ExamStudent s where s.examId=?1 and s.subjectCode=?2 and (s.absent=true or s.breach=true) and "
|
|
- + " (exists (select l.id from MarkLibrary l where l.studentId=s.id) or exists (select t.id from TrialLibrary t where t.studentId=s.id)) ")
|
|
|
|
|
|
+ + "exists (select l.id from MarkLibrary l where l.studentId=s.id)")
|
|
public List<ExamStudent> findAbsentOrBreachLibraryStudent(Integer examId, String subjectCode);
|
|
public List<ExamStudent> findAbsentOrBreachLibraryStudent(Integer examId, String subjectCode);
|
|
|
|
|
|
@Query("select sum(case when ((case when s.objectiveScore is null then 0 else s.objectiveScore end) + (case when s.subjectiveScore is null then 0 else s.subjectiveScore end)) between 0 and 49.9 then 1 else 0 end),"
|
|
@Query("select sum(case when ((case when s.objectiveScore is null then 0 else s.objectiveScore end) + (case when s.subjectiveScore is null then 0 else s.subjectiveScore end)) between 0 and 49.9 then 1 else 0 end),"
|
|
@@ -160,7 +162,7 @@ public interface ExamStudentDao
|
|
+ "sum(case when ((case when s.objectiveScore is null then 0 else s.objectiveScore end) + (case when s.subjectiveScore is null then 0 else s.subjectiveScore end)) between 60 and 100 then 1 else 0 end) "
|
|
+ "sum(case when ((case when s.objectiveScore is null then 0 else s.objectiveScore end) + (case when s.subjectiveScore is null then 0 else s.subjectiveScore end)) between 60 and 100 then 1 else 0 end) "
|
|
+ " from ExamStudent s where s.examId=?1 and s.subjectCode=?2 and s.upload=?3 and s.absent=?4 and s.breach = ?5")
|
|
+ " from ExamStudent s where s.examId=?1 and s.subjectCode=?2 and s.upload=?3 and s.absent=?4 and s.breach = ?5")
|
|
public List<Object[]> statisticsByAbsentAndBreach(Integer examId, String code, Boolean upload, boolean absent,
|
|
public List<Object[]> statisticsByAbsentAndBreach(Integer examId, String code, Boolean upload, boolean absent,
|
|
- boolean breach);
|
|
|
|
|
|
+ boolean breach);
|
|
|
|
|
|
@Query(value = "select s.id from eb_exam_student s where 1=1 and s.id in (select m.student_id from m_library m where 1=1 and m.marker_id in (select m.id from eb_marker m where 1=1 and m.login_name = ?1 ))", nativeQuery = true)
|
|
@Query(value = "select s.id from eb_exam_student s where 1=1 and s.id in (select m.student_id from m_library m where 1=1 and m.marker_id in (select m.id from eb_marker m where 1=1 and m.login_name = ?1 ))", nativeQuery = true)
|
|
public List<String[]> findIdsByMarkLogin(String markLogin);
|
|
public List<String[]> findIdsByMarkLogin(String markLogin);
|