|
@@ -14,8 +14,7 @@ import org.springframework.data.jpa.repository.Query;
|
|
|
import cn.com.qmth.stmms.biz.exam.model.ExamStudent;
|
|
|
import cn.com.qmth.stmms.common.enums.SubjectiveStatus;
|
|
|
|
|
|
-public interface ExamStudentDao
|
|
|
- extends JpaRepository<ExamStudent, Integer>,JpaSpecificationExecutor<ExamStudent> {
|
|
|
+public interface ExamStudentDao extends JpaRepository<ExamStudent, Integer>, JpaSpecificationExecutor<ExamStudent> {
|
|
|
|
|
|
public List<ExamStudent> findByExamId(int examId, Pageable pageable);
|
|
|
|
|
@@ -76,10 +75,12 @@ public interface ExamStudentDao
|
|
|
String scoreList);
|
|
|
|
|
|
// @Modifying
|
|
|
- // @Query("update ExamStudent s set s.subjectiveStatus=?3, s.subjectiveScore=?4,
|
|
|
+ // @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 and s.subjectiveStatus not in (?8)")
|
|
|
+ // " where s.examId=?1 and s.subjectCode=?2 and s.subjectiveStatus not in
|
|
|
+ // (?8)")
|
|
|
// public void updateSubjectiveStatusAndScoreWithoutStatus(Integer examId,
|
|
|
// String subjetCode, SubjectiveStatus status,
|
|
|
// double score, String scoreList, Date inspectTime, Integer inspectorId,
|
|
@@ -219,25 +220,25 @@ public interface ExamStudentDao
|
|
|
|
|
|
@Query("select sum(s.sheetCount) from ExamStudent s where s.examId=?1 ")
|
|
|
public Long sumSheetCountByExamId(Integer examId);
|
|
|
-
|
|
|
+
|
|
|
@Query("select sum(s.objectivePageCount) from ExamStudent s where s.examId=?1 ")
|
|
|
public Long sumObjectivePageCountByExamId(Integer examId);
|
|
|
-
|
|
|
+
|
|
|
@Query("select count(*) from ExamStudent s where s.examId=?1 and s.objectivePageCount>0")
|
|
|
public Long sumObjectiveByExamId(Integer examId);
|
|
|
-
|
|
|
- @Query("select count(*) from ExamStudent s where s.examId=?1 and s.sheetCount>0")
|
|
|
+
|
|
|
+ @Query("select count(*) from ExamStudent s where s.examId=?1 and s.sheetCount-s.objectivePageCount>0")
|
|
|
public Long sumSubjectiveByExamId(Integer examId);
|
|
|
-
|
|
|
+
|
|
|
@Query("select count(*) from ExamStudent s where s.examId=?1 and (s.sheetCount>0 or s.objectivePageCount>0)")
|
|
|
public Long sumAllUploadByExamId(Integer examId);
|
|
|
-
|
|
|
+
|
|
|
@Query("select sum(s.sheetCount) from ExamStudent s where s.examId=?1 and s.subjectCode=?2 ")
|
|
|
public Long sumSheetCountByExamIdAndSubjectCode(int examId, String subjectCode);
|
|
|
|
|
|
@Query("select distinct m.subjectCode from ExamStudent m where m.examId=?1 and m.inspected=false and m.upload=true and m.absent=false and m.breach=false ")
|
|
|
Set<String> findSubjectUnInspectedByExamId(int examId);
|
|
|
-
|
|
|
+
|
|
|
@Query("select distinct m.subjectCode from ExamStudent m where m.examId=?1 and m.subjectiveStatus='MARKED' and m.upload=true and m.absent=false and m.breach=false ")
|
|
|
Set<String> findSubjectHasTaskByExamId(int examId);
|
|
|
|
|
@@ -299,23 +300,25 @@ public interface ExamStudentDao
|
|
|
|
|
|
@Modifying
|
|
|
@Query("update ExamStudent s set s.inspectCount=0,s.inspected=0, s.inspectTime=null ,s.inspectorId=null where s.id=?1 ")
|
|
|
- public int clearInspect(Integer studentId);
|
|
|
+ public int clearInspect(Integer studentId);
|
|
|
|
|
|
@Modifying
|
|
|
@Query("update ExamStudent s set s.inspectCount=?2 where s.id=?1 ")
|
|
|
- public void updateInspectCount(Integer studentId, Integer inspectCount);
|
|
|
-
|
|
|
+ public void updateInspectCount(Integer studentId, Integer inspectCount);
|
|
|
+
|
|
|
@Modifying
|
|
|
@Query("update ExamStudent s set s.subjectCode=?2,s.subjectName=?3 where s.id=?1 ")
|
|
|
- public void updateSubject(Integer studentId, String subjectCode,String subjectName);
|
|
|
+ public void updateSubject(Integer studentId, String subjectCode, String subjectName);
|
|
|
|
|
|
@Query("select s from ExamStudent s where s.schoolId=?1 and s.examId=?2 and s.subjectCode=?3 and s.studentCode=?4 ")
|
|
|
- public ExamStudent findBySchoolIdAndExamIdAndSubjectCodeAndStudentCode( Integer schoolId,Integer examId,
|
|
|
- String subjectCode, String studentCode);
|
|
|
+ public ExamStudent findBySchoolIdAndExamIdAndSubjectCodeAndStudentCode(Integer schoolId, Integer examId,
|
|
|
+ String subjectCode, String studentCode);
|
|
|
|
|
|
@Modifying
|
|
|
@Query("update ExamStudent s set s.objectivePageCount=?2 where s.id=?1")
|
|
|
- public int updateObjectivePageCount(Integer id, Integer objectivePageCount);
|
|
|
+ public int updateObjectivePageCount(Integer id, Integer objectivePageCount);
|
|
|
+
|
|
|
@Query("select s.id from ExamStudent s where s.examId=?1 and s.subjectCode=?2 and s.subjectiveStatus =?3 and s.upload=?4 and s.absent=?5 and s.breach=?6 ")
|
|
|
- List<Integer> findIdByExamIdAndSubjectCodeAndSubjectiveStatusAndUploadAndAbsentAndBreach(Integer examId, String subjectCode, SubjectiveStatus status, boolean uplaod, boolean absent, boolean breach);
|
|
|
+ List<Integer> findIdByExamIdAndSubjectCodeAndSubjectiveStatusAndUploadAndAbsentAndBreach(Integer examId,
|
|
|
+ String subjectCode, SubjectiveStatus status, boolean uplaod, boolean absent, boolean breach);
|
|
|
}
|