|
@@ -14,8 +14,6 @@ import java.util.List;
|
|
|
*/
|
|
|
public interface MarkTaskRepo extends JpaRepository<MarkTask, Long>, JpaSpecificationExecutor {
|
|
|
|
|
|
- int countByMarkerIdAndPaperIdAndWorkIdAndRandomSeqNew(Long markerId, Long paperId, Long randomSeqNew, Long workId);
|
|
|
-
|
|
|
/**
|
|
|
* 查询指定阶段试卷的评卷任务
|
|
|
*
|
|
@@ -33,29 +31,12 @@ public interface MarkTaskRepo extends JpaRepository<MarkTask, Long>, JpaSpecific
|
|
|
*/
|
|
|
long countByMarkerId(Long markerId);
|
|
|
|
|
|
- long countByMarkerIdAndQuestionId(Long markerId, Long questionId);
|
|
|
-
|
|
|
- long countByQuestionIdIn(List<Long> questionIds);
|
|
|
-
|
|
|
- @Query(value = "select count(1) from mark_task m left join paper p on m.paper_id = p.id and p.batch_no = ?2 where m.question_id = ?1 and m.marker_id = ?3", nativeQuery = true)
|
|
|
+ @Query(value = "select count(1) from mark_task m inner join paper p on m.paper_id = p.id and p.batch_no = ?2 where m.question_id = ?1 and m.marker_id = ?3", nativeQuery = true)
|
|
|
long countByQuestionId(Long questionId, Long batchNo, Long markerId);
|
|
|
|
|
|
- @Query(value = "select count(1) from mark_task m left join paper p on m.paper_id = p.id where m.question_id = ?1 and m.stage = ?2 and m.result = ?3 and p.batch_no = ?4", nativeQuery = true)
|
|
|
- int countByQuestionIdAndStageAndResult(Long questionId, int stage, String result,Long batchNo);
|
|
|
-
|
|
|
- int countByQuestionIdAndMarkerIdAndStageAndResultIsNull(Long questionId, Long markerId, MarkStage stage);
|
|
|
-
|
|
|
- @Query(value = "select count(1) from mark_task m left join paper p on m.paper_id = p.id where m.question_id = ?1 and m.marker_id = ?2 and m.stage = ?3 and m.result = ?4 and p.batch_no = ?5", nativeQuery = true)
|
|
|
+ @Query(value = "select count(1) from mark_task m inner join paper p on m.paper_id = p.id where m.question_id = ?1 and m.marker_id = ?2 and m.stage = ?3 and m.result = ?4 and p.batch_no = ?5", nativeQuery = true)
|
|
|
int countByQuestionIdAndMarkerIdAndStageAndResult(Long questionId, Long markerId, int stage, String result, Long batchNo);
|
|
|
|
|
|
- int countByWorkIdAndSubjectAndMarkerIdAndStageAndResult(Long workId, Subject subject, Long markerId, MarkStage stage, String result);
|
|
|
-
|
|
|
- int countByWorkIdAndSubjectAndMarkerIdAndStageAndQuestionIdAndResult(Long workId, Subject subject, Long markerId, MarkStage stage, Long questionId, String result);
|
|
|
-
|
|
|
- int countByWorkIdAndSubjectAndMarkerIdAndStage(Long workId, Subject subject, Long markerId, MarkStage stage);
|
|
|
-
|
|
|
- int countByWorkIdAndSubjectAndMarkerIdAndStageAndQuestionId(Long workId, Subject subject, Long markerId, MarkStage stage, Long questionId);
|
|
|
-
|
|
|
/**
|
|
|
* 查询评卷员的评卷任务
|
|
|
*
|
|
@@ -66,17 +47,6 @@ public interface MarkTaskRepo extends JpaRepository<MarkTask, Long>, JpaSpecific
|
|
|
@Query(value = "select mt from MarkTask mt left outer join fetch mt.paper where mt.markerId = ? and mt.stage = ?")
|
|
|
List<MarkTask> findByMarkerIdAndStage(Long markerId, MarkStage stage);
|
|
|
|
|
|
- /**
|
|
|
- * 查询评卷员的评卷任务
|
|
|
- *
|
|
|
- * @param markerId
|
|
|
- * @param stage
|
|
|
- * @param questionId
|
|
|
- * @return
|
|
|
- */
|
|
|
- @Query(value = "select mt from MarkTask mt left outer join fetch mt.paper where mt.markerId = ? and mt.stage = ? and mt.questionId = ? order by mt.updatedOn desc")
|
|
|
- List<MarkTask> findByMarkerIdAndStageAndQuestionId(Long markerId, MarkStage stage, Long questionId);
|
|
|
-
|
|
|
/**
|
|
|
* 删除评卷员所有任务
|
|
|
*
|
|
@@ -117,52 +87,6 @@ public interface MarkTaskRepo extends JpaRepository<MarkTask, Long>, JpaSpecific
|
|
|
"t.`marker_id` = ? and t.stage = ? and p.is_missing = false GROUP BY t.`question_id` ORDER BY q.`id`", nativeQuery = true)
|
|
|
List<Object[]> countGroupByQuestion(Long markerId, Integer stageId);
|
|
|
|
|
|
-
|
|
|
- /**
|
|
|
- * 统计评卷员指定试题的各档位数量
|
|
|
- *
|
|
|
- * @param questionIds
|
|
|
- * @param markerId
|
|
|
- * @return
|
|
|
- */
|
|
|
- @Query(value = "SELECT t.result,COUNT(*) FROM mark_task t " +
|
|
|
- "WHERE t.`question_id` = ? AND t.`marker_id` = ? and t.stage = 1 " +
|
|
|
- "GROUP BY t.`result` ORDER BY t.result", nativeQuery = true)
|
|
|
- List<Object[]> countGroupByQuestionIdAndLevel(Long questionId, Long markerId);
|
|
|
-
|
|
|
- //2019.10.16修改为所有试卷
|
|
|
- @Query(value = "SELECT t.result,COUNT(*) FROM mark_task t " +
|
|
|
- "WHERE t.`question_id` in (?) and t.stage = 1 " +
|
|
|
- "GROUP BY t.`result`,t.question_id ORDER BY t.result", nativeQuery = true)
|
|
|
- List<Object[]> countGroupByQuestionIdAndLevel(List<Long> questionId);
|
|
|
-
|
|
|
- @Query(value = "SELECT t.result,COUNT(*) FROM mark_task t " +
|
|
|
- "WHERE t.`marker_id` = ? and t.stage = 1 " +
|
|
|
- "GROUP BY t.`result` ORDER BY t.result", nativeQuery = true)
|
|
|
- List<Object[]> countGroupByLevel(Long markerId);
|
|
|
-
|
|
|
-
|
|
|
- @Query(value = "SELECT COUNT(*) FROM mark_task t " +
|
|
|
- "WHERE t.`marker_id` = ? and t.stage = 1 and t.result = ? ", nativeQuery = true)
|
|
|
- int countByLevelAndResult(Long markerId, String result);
|
|
|
- //2019.10.16修改为所有老师的评卷
|
|
|
-// @Query(value = "SELECT COUNT(*) FROM mark_task t " +
|
|
|
-// "WHERE t.`question_id` in (?) and t.stage = 1 and t.result = ? ", nativeQuery = true)
|
|
|
-// int countByLevelAndResult(Long questionId, String result);
|
|
|
-
|
|
|
- @Query(value = "SELECT COUNT(*) FROM mark_task t " +
|
|
|
- "WHERE t.`marker_id` = ? and t.stage = 1 and t.result is null", nativeQuery = true)
|
|
|
- int countByLevel(Long markerId);
|
|
|
- //2019.10.16修改为所有老师的评卷
|
|
|
-// @Query(value = "SELECT COUNT(*) FROM mark_task t " +
|
|
|
-// "WHERE t.`question_id` in (?) and t.stage = 1 and t.result is null", nativeQuery = true)
|
|
|
-// int countByLevel(Long questionId);
|
|
|
-
|
|
|
- int countByQuestionIdInAndStageAndResult(List<Long> questionIds, MarkStage stage, String result);
|
|
|
-
|
|
|
- int countByQuestionIdInAndStageAndResultIsNull(List<Long> questionIds, MarkStage stage);
|
|
|
-
|
|
|
-
|
|
|
/**
|
|
|
* 统计指定试卷的所有任务数量
|
|
|
*
|
|
@@ -171,32 +95,19 @@ public interface MarkTaskRepo extends JpaRepository<MarkTask, Long>, JpaSpecific
|
|
|
*/
|
|
|
Long countByPaperId(Long id);
|
|
|
|
|
|
- int countByWorkIdAndSubjectAndStageAndResult(Long workId, Subject markSubject, MarkStage level, String code);
|
|
|
-
|
|
|
- int countByWorkIdAndSubjectAndStage(Long workId, Subject markSubject, MarkStage level);
|
|
|
-
|
|
|
- int countByWorkIdAndSubjectAndStageAndQuestionIdAndResult(Long workId, Subject subject, MarkStage level, Long id, String code);
|
|
|
-
|
|
|
- int countByWorkIdAndSubjectAndStageAndQuestionId(Long workId, Subject subject, MarkStage level, Long id);
|
|
|
-
|
|
|
List<MarkTask> findByWorkIdAndSecretNumber(Long workId, String secretNumber);
|
|
|
|
|
|
@Query(value = "SELECT max(t.randomSeq) FROM MarkTask t " +
|
|
|
"WHERE t.workId = ?1 and t.subject = ?2 and t.markerId = ?3 and t.stage = ?4 and t.questionId = ?5 ")
|
|
|
Integer findRandomSeqByWorkIdAndSubjectAndMarkerIdAndStageAndQuestionId(Long workId, Subject subject, Long markerId, MarkStage stage, Long questionId);
|
|
|
|
|
|
- @Query(value = "SELECT count(1) from mark_task m left join paper p on m.paper_id = p.id and p.is_missing = ?4 and p.batch_no = ?5 where m.question_id = ?1 and m.marker_id = ?2 and m.stage = ?3 and m.result is null", nativeQuery = true)
|
|
|
+ @Query(value = "SELECT count(1) from mark_task m inner join paper p on m.paper_id = p.id and p.is_missing = ?4 and p.batch_no = ?5 where m.question_id = ?1 and m.marker_id = ?2 and m.stage = ?3 and m.result is null", nativeQuery = true)
|
|
|
int countByQuestionIdAndMarkerIdAndStageAndResultIsNullAndIsMissing(Long questionId, Long markerId, int stage, boolean isMissing, Long batchNo);
|
|
|
|
|
|
- @Query(value = "SELECT count(1) from mark_task m left join paper p on m.paper_id = p.id and p.is_missing = ?4 and p.batch_no = ?5 where m.question_id = ?1 and m.marker_id = ?6 and m.stage = ?2 and m.result =?3", nativeQuery = true)
|
|
|
+ @Query(value = "SELECT count(1) from mark_task m inner join paper p on m.paper_id = p.id and p.is_missing = ?4 and p.batch_no = ?5 where m.question_id = ?1 and m.marker_id = ?6 and m.stage = ?2 and m.result =?3", nativeQuery = true)
|
|
|
int countByQuestionIdAndStageAndResultAndIsMissing(Long questionId, int stage, String result, boolean isMissing,Long batchNo,Long markerId);
|
|
|
|
|
|
- MarkTask findByPaperIdAndSecretNumber(Long paperId, String secretNumber);
|
|
|
-
|
|
|
MarkTask findByPaperIdAndMarkerId(Long paperId, Long markId);
|
|
|
|
|
|
- @Query("select max(mt.batchNo) from MarkTask mt where mt.questionId = ?1")
|
|
|
- Long findByQuestionId(Long questionId);
|
|
|
-
|
|
|
List<MarkTask> findByWorkIdAndSubjectAndStage(Long workId, Subject subject, MarkStage markStage);
|
|
|
}
|