|
@@ -10,7 +10,6 @@ import org.springframework.data.repository.PagingAndSortingRepository;
|
|
|
|
|
|
import cn.com.qmth.stmms.biz.exam.model.MarkGroup;
|
|
|
import cn.com.qmth.stmms.biz.exam.model.MarkGroupPK;
|
|
|
-import cn.com.qmth.stmms.common.enums.LibraryStatus;
|
|
|
import cn.com.qmth.stmms.common.enums.ScorePolicy;
|
|
|
|
|
|
public interface MarkGroupDao
|
|
@@ -50,38 +49,8 @@ public interface MarkGroupDao
|
|
|
Integer sumMarkedCount(Integer examId);
|
|
|
|
|
|
@Modifying
|
|
|
- @Query("update MarkGroup g set g.libraryCount=(select count(l) from MarkLibrary l "
|
|
|
- + "where l.examId=?1 and l.subjectCode=?2 and l.groupNumber=g.pk.number) "
|
|
|
- + "where g.pk.examId=?1 and g.pk.subjectCode=?2")
|
|
|
- void updateLibraryCount(int examId, String subjectCode);
|
|
|
-
|
|
|
- @Modifying
|
|
|
- @Query("update MarkGroup g set g.markedCount=(select count(l) from MarkLibrary l "
|
|
|
- + "where l.examId=?1 and l.subjectCode=?2 and l.groupNumber=g.pk.number and l.status in (?3)) "
|
|
|
- + "where g.pk.examId=?1 and g.pk.subjectCode=?2")
|
|
|
- void updateMarkedCount(int examId, String subjectCode, LibraryStatus... status);
|
|
|
-
|
|
|
- @Modifying
|
|
|
- @Query("update MarkGroup g set g.leftCount = g.libraryCount - g.markedCount "
|
|
|
- + "where g.pk.examId=?1 and g.pk.subjectCode=?2")
|
|
|
- void updateLeftCount(int examId, String subjectCode);
|
|
|
-
|
|
|
- @Modifying
|
|
|
- @Query("update MarkGroup g set g.libraryCount=(select count(l) from MarkLibrary l "
|
|
|
- + "where l.examId=?1 and l.subjectCode=?2 and l.groupNumber=?3) "
|
|
|
- + "where g.pk.examId=?1 and g.pk.subjectCode=?2 and g.pk.number=?3")
|
|
|
- void updateLibraryCount(int examId, String subjectCode, int number);
|
|
|
-
|
|
|
- @Modifying
|
|
|
- @Query("update MarkGroup g set g.markedCount=(select count(l) from MarkLibrary l "
|
|
|
- + "where l.examId=?1 and l.subjectCode=?2 and l.groupNumber=?3 and l.status in (?4) ) "
|
|
|
- + "where g.pk.examId=?1 and g.pk.subjectCode=?2 and g.pk.number=?3")
|
|
|
- void updateMarkedCount(int examId, String subjectCode, int number, LibraryStatus... status);
|
|
|
-
|
|
|
- @Modifying
|
|
|
- @Query("update MarkGroup g set g.leftCount = g.libraryCount - g.markedCount "
|
|
|
- + "where g.pk.examId=?1 and g.pk.subjectCode=?2 and g.pk.number=?3")
|
|
|
- void updateLeftCount(int examId, String subjectCode, int number);
|
|
|
+ @Query("update MarkGroup g set g.libraryCount=?4, g.markedCount=?5, g.leftCount=(?4-?5) where g.pk.examId=?1 and g.pk.subjectCode=?2 and g.pk.number=?3")
|
|
|
+ void updateLibraryCount(int examId, String subjectCode, int number, int totalCount, int markedCount);
|
|
|
|
|
|
@Modifying
|
|
|
@Query("update MarkGroup g set g.leftCount = g.libraryCount, g.markedCount = 0 "
|