|
@@ -65,26 +65,20 @@ public interface MarkLibraryDao extends JpaRepository<MarkLibrary, Integer>, Jpa
|
|
@Query("select count(*) from MarkLibrary f where f.studentId=?1 and f.markerId=?2 and f.id!=?3")
|
|
@Query("select count(*) from MarkLibrary f where f.studentId=?1 and f.markerId=?2 and f.id!=?3")
|
|
long countByStudentIdAndMarkerIdAndIdNotEqual(Integer studentId, Integer markerId, Integer id);
|
|
long countByStudentIdAndMarkerIdAndIdNotEqual(Integer studentId, Integer markerId, Integer id);
|
|
|
|
|
|
- @Query("select distinct l.campusId from MarkLibrary l where l.examId=?1 and l.tags is not null")
|
|
|
|
- List<Integer> findTagCampusId(Integer examId);
|
|
|
|
-
|
|
|
|
- @Query("select distinct l.subjectCode from MarkLibrary l where l.examId=?1 and l.tags is not null")
|
|
|
|
- List<String> findTagSubjectCode(Integer examId);
|
|
|
|
-
|
|
|
|
@Modifying(clearAutomatically = true)
|
|
@Modifying(clearAutomatically = true)
|
|
- @Query("update MarkLibrary m set m.status=?4, m.tags=null, m.markerId=null, m.markerTime=null, m.markerScore=null, m.markerScoreList=null, m.markerSpent=null, "
|
|
|
|
|
|
+ @Query("update MarkLibrary m set m.status=?4, m.markerId=null, m.markerTime=null, m.markerScore=null, m.markerScoreList=null, m.markerSpent=null, "
|
|
+ "m.headerId=null , m.headerTime=null , m.headerScore=null , m.headerScoreList=null where m.examId=?1 and m.subjectCode=?2 and m.groupNumber=?3")
|
|
+ "m.headerId=null , m.headerTime=null , m.headerScore=null , m.headerScoreList=null where m.examId=?1 and m.subjectCode=?2 and m.groupNumber=?3")
|
|
void resetByExamIdAndSubjectCodeAndGroupNumber(Integer examId, String subjectCode, Integer groupNumber,
|
|
void resetByExamIdAndSubjectCodeAndGroupNumber(Integer examId, String subjectCode, Integer groupNumber,
|
|
LibraryStatus status);
|
|
LibraryStatus status);
|
|
|
|
|
|
@Modifying(clearAutomatically = true)
|
|
@Modifying(clearAutomatically = true)
|
|
- @Query("update MarkLibrary m set m.status=?2, m.tags=null, m.markerId=null, m.markerTime=null, m.markerScore=null, m.markerScoreList=null, m.markerSpent=null, "
|
|
|
|
|
|
+ @Query("update MarkLibrary m set m.status=?2, m.markerId=null, m.markerTime=null, m.markerScore=null, m.markerScoreList=null, m.markerSpent=null, "
|
|
+ "m.headerId=null , m.headerTime=null , m.headerScore=null , m.headerScoreList=null where m.markerId=?1 and m.status!=?3 and m.status not in (?4) ")
|
|
+ "m.headerId=null , m.headerTime=null , m.headerScore=null , m.headerScoreList=null where m.markerId=?1 and m.status!=?3 and m.status not in (?4) ")
|
|
void resetByMarkerId(Integer markerId, LibraryStatus status, LibraryStatus libraryStatus1,
|
|
void resetByMarkerId(Integer markerId, LibraryStatus status, LibraryStatus libraryStatus1,
|
|
LibraryStatus... libraryStatus);
|
|
LibraryStatus... libraryStatus);
|
|
|
|
|
|
@Modifying(clearAutomatically = true)
|
|
@Modifying(clearAutomatically = true)
|
|
- @Query("update MarkLibrary m set m.status=?2, m.tags=null, m.markerId=null, m.markerTime=null, m.markerScore=null, m.markerScoreList=null, m.markerSpent=null, "
|
|
|
|
|
|
+ @Query("update MarkLibrary m set m.status=?2, m.markerId=null, m.markerTime=null, m.markerScore=null, m.markerScoreList=null, m.markerSpent=null, "
|
|
+ "m.headerId=null , m.headerTime=null , m.headerScore=null , m.headerScoreList=null where m.id=?1 and m.status in (?3)")
|
|
+ "m.headerId=null , m.headerTime=null , m.headerScore=null , m.headerScoreList=null where m.id=?1 and m.status in (?3)")
|
|
int resetById(Integer id, LibraryStatus newStatus, LibraryStatus... previousStatus);
|
|
int resetById(Integer id, LibraryStatus newStatus, LibraryStatus... previousStatus);
|
|
|
|
|
|
@@ -120,9 +114,9 @@ public interface MarkLibraryDao extends JpaRepository<MarkLibrary, Integer>, Jpa
|
|
|
|
|
|
@Modifying(clearAutomatically = true)
|
|
@Modifying(clearAutomatically = true)
|
|
@Query("update MarkLibrary l set l.status=?2, l.markerId=?3, l.markerScore=?4, l.markerScoreList=?5, l.markerTime=?6, "
|
|
@Query("update MarkLibrary l set l.status=?2, l.markerId=?3, l.markerScore=?4, l.markerScoreList=?5, l.markerTime=?6, "
|
|
- + "l.markerSpent=?7, l.tags=?8 where l.id=?1 and l.status in (?9) and (l.markerId=null or l.markerId=?3)")
|
|
|
|
|
|
+ + "l.markerSpent=?7 where l.id=?1 and l.status in (?8) and (l.markerId=null or l.markerId=?3)")
|
|
int updateMarkerResult(Integer id, LibraryStatus newStatus, Integer markerId, Double markerScore,
|
|
int updateMarkerResult(Integer id, LibraryStatus newStatus, Integer markerId, Double markerScore,
|
|
- String markerScoreList, Date markerTime, Integer spent, String tags, LibraryStatus... previousStatus);
|
|
|
|
|
|
+ String markerScoreList, Date markerTime, Integer spent, LibraryStatus... previousStatus);
|
|
|
|
|
|
@Query("select m.markerScore ,count(*) from MarkLibrary m where m.examId=?1 and m.subjectCode=?2 and m.groupNumber=?3 and m.markerId=?4 and m.status in (?5) group by m.markerScore ")
|
|
@Query("select m.markerScore ,count(*) from MarkLibrary m where m.examId=?1 and m.subjectCode=?2 and m.groupNumber=?3 and m.markerId=?4 and m.status in (?5) group by m.markerScore ")
|
|
List<Object[]> findScoreCount(int examId, String subjectCode, Integer groupNumber, Integer markerId,
|
|
List<Object[]> findScoreCount(int examId, String subjectCode, Integer groupNumber, Integer markerId,
|
|
@@ -136,4 +130,10 @@ public interface MarkLibraryDao extends JpaRepository<MarkLibrary, Integer>, Jpa
|
|
void deleteByExamIdAndSubjectCodeAndGroupNumberAndTaskNumber(Integer examId, String subjectCode,
|
|
void deleteByExamIdAndSubjectCodeAndGroupNumberAndTaskNumber(Integer examId, String subjectCode,
|
|
Integer groupNumber, Integer taskNumber);
|
|
Integer groupNumber, Integer taskNumber);
|
|
|
|
|
|
|
|
+ @Modifying(clearAutomatically = true)
|
|
|
|
+ @Query("update MarkLibrary l set l.status=?2, l.markerId=?3, l.markerTime=?4, "
|
|
|
|
+ + "l.markerSpent=?5 where l.id=?1 and l.status in (?6) and (l.markerId=null or l.markerId=?3)")
|
|
|
|
+ int updateProblemResult(Integer id, LibraryStatus newStatus, Integer markerId, Date markerTime, Integer spent,
|
|
|
|
+ LibraryStatus... previousStatus);
|
|
|
|
+
|
|
}
|
|
}
|