|
@@ -1,9 +1,8 @@
|
|
package cn.com.qmth.stmms.ms.core.repository;
|
|
package cn.com.qmth.stmms.ms.core.repository;
|
|
|
|
|
|
import cn.com.qmth.stmms.ms.core.domain.MarkStage;
|
|
import cn.com.qmth.stmms.ms.core.domain.MarkStage;
|
|
-import cn.com.qmth.stmms.ms.core.domain.Paper;
|
|
|
|
-import cn.com.qmth.stmms.ms.core.domain.task.MarkTaskRoughLevel;
|
|
|
|
import cn.com.qmth.stmms.ms.core.domain.task.MarkTaskLevel;
|
|
import cn.com.qmth.stmms.ms.core.domain.task.MarkTaskLevel;
|
|
|
|
+import cn.com.qmth.stmms.ms.core.domain.task.MarkTaskRoughLevel;
|
|
import cn.com.qmth.stmms.ms.core.vo.Subject;
|
|
import cn.com.qmth.stmms.ms.core.vo.Subject;
|
|
import org.springframework.data.jpa.repository.JpaRepository;
|
|
import org.springframework.data.jpa.repository.JpaRepository;
|
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
|
@@ -20,18 +19,8 @@ public interface MarkTaskRoughLevelRepo extends JpaRepository<MarkTaskRoughLevel
|
|
|
|
|
|
int countByMarkerIdAndPaperIdAndWorkIdAndRandomSeqNew(Long markerId, Long paperId, Long randomSeqNew, Long workId);
|
|
int countByMarkerIdAndPaperIdAndWorkIdAndRandomSeqNew(Long markerId, Long paperId, Long randomSeqNew, Long workId);
|
|
|
|
|
|
- List<MarkTaskLevel> findByWorkIdAndStageAndPaperId(Long workId, MarkStage stage, Long paperId);
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 查询指定阶段试卷的评卷任务
|
|
|
|
- *
|
|
|
|
- * @param paperId 试卷id
|
|
|
|
- * @param stage 评卷阶段
|
|
|
|
- */
|
|
|
|
- List<MarkTaskRoughLevel> findByPaperIdAndStage(Long paperId, MarkStage stage);
|
|
|
|
-
|
|
|
|
@Query(value = "select new MarkTaskRoughLevel(m.id, m.markerId , m.markerName, m.result, m.secretNumber, m.stage) from MarkTaskRoughLevel m where m.paper.id = ?1 and m.stage = ?2")
|
|
@Query(value = "select new MarkTaskRoughLevel(m.id, m.markerId , m.markerName, m.result, m.secretNumber, m.stage) from MarkTaskRoughLevel m where m.paper.id = ?1 and m.stage = ?2")
|
|
- List<MarkTaskRoughLevel> findByPaperIdAndStageNative(Long id, MarkStage level);
|
|
|
|
|
|
+ List<MarkTaskRoughLevel> findByPaperIdAndStageNative(Long id, MarkStage stage);
|
|
|
|
|
|
/**
|
|
/**
|
|
* 评卷员任务数量
|
|
* 评卷员任务数量
|
|
@@ -43,47 +32,12 @@ public interface MarkTaskRoughLevelRepo extends JpaRepository<MarkTaskRoughLevel
|
|
@Query(value = "select count(1) from mark_task_rough_level m where m.question_id = ?1 and m.marker_id = ?3 and m.batch_no = ?2", nativeQuery = true)
|
|
@Query(value = "select count(1) from mark_task_rough_level m where m.question_id = ?1 and m.marker_id = ?3 and m.batch_no = ?2", nativeQuery = true)
|
|
long countByQuestionIdAndBatchNo(Long questionId, Long batchNo, Long markerId);
|
|
long countByQuestionIdAndBatchNo(Long questionId, Long batchNo, Long markerId);
|
|
|
|
|
|
- @Query(value = "select count(1) from mark_task_rough_level m inner join paper p on m.paper_id = p.id and p.rough_batch_no = ?5 where m.question_id = ?1 and m.marker_id = ?2 and m.stage = ?3 and m.result = ?4 and m.is_rejected = false", nativeQuery = true)
|
|
|
|
|
|
+ @Query(value = "select count(1) from mark_task_rough_level m where m.question_id = ?1 and m.marker_id = ?2 and m.stage = ?3 and m.result = ?4 and m.batch_no = ?5 and m.is_rejected = false", nativeQuery = true)
|
|
int countByQuestionIdAndMarkerIdAndStageAndResult(Long questionId, Long markerId, int stage, String result, Long batchNo);
|
|
int countByQuestionIdAndMarkerIdAndStageAndResult(Long questionId, Long markerId, int stage, String result, Long batchNo);
|
|
|
|
|
|
- @Query(value = "select count(1) from mark_task_rough_level m inner join paper p on m.paper_id = p.id and p.rough_batch_no is not null where m.question_id = ?1 and m.marker_id = ?2 and m.stage = ?3 and m.result = ?4 and m.is_rejected = false", nativeQuery = true)
|
|
|
|
|
|
+ @Query(value = "select count(1) from mark_task_rough_level m where m.question_id = ?1 and m.marker_id = ?2 and m.stage = ?3 and m.result = ?4 and m.is_rejected = false", nativeQuery = true)
|
|
int countByQuestionIdAndMarkerIdAndStageAndResultAll(Long questionId, Long markerId, int stage, String result);
|
|
int countByQuestionIdAndMarkerIdAndStageAndResultAll(Long questionId, Long markerId, int stage, String result);
|
|
|
|
|
|
- @Query(value = "select count(1) from mark_task_rough_level m inner join paper p on m.paper_id = p.id and p.score_batch_no = ?5 and p.level = ?4 where m.question_id = ?1 and m.marker_id = ?2 and m.stage = ?3 and m.result is not null", nativeQuery = true)
|
|
|
|
- int countScoreByQuestionIdAndMarkerIdAndStageAndResult(Long questionId, Long markerId, int stage, String result, Long batchNo);
|
|
|
|
-
|
|
|
|
- @Query(value = "select count(1) from mark_task_rough_level m inner join paper p on m.paper_id = p.id and p.level = ?4 and p.score_batch_no is not null where m.question_id = ?1 and m.marker_id = ?2 and m.stage = ?3 and m.result is not null", nativeQuery = true)
|
|
|
|
- int countScoreByQuestionIdAndMarkerIdAndStageAndResultAll(Long questionId, Long markerId, int stage, String result);
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 查询评卷员的评卷任务
|
|
|
|
- *
|
|
|
|
- * @param markerId 评卷员ID
|
|
|
|
- * @param stage 阶段
|
|
|
|
- */
|
|
|
|
- @Query(value = "select mt from MarkTaskRoughLevel mt left outer join fetch mt.paper where mt.markerId = ? and mt.stage = ?")
|
|
|
|
- List<MarkTaskLevel> findByMarkerIdAndStage(Long markerId, MarkStage stage);
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 删除评卷员所有任务
|
|
|
|
- *
|
|
|
|
- * @param subject 科目
|
|
|
|
- * @param stage 阶段
|
|
|
|
- */
|
|
|
|
- Long deleteByWorkIdAndSubjectAndStage(Long workId, Subject subject, MarkStage stage);
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 统计评卷员各试题已评数及总数(分档阶段)
|
|
|
|
- *
|
|
|
|
- * @param markerId 评卷员ID
|
|
|
|
- * @param stageId 阶段
|
|
|
|
- * @param test 试评状态
|
|
|
|
- */
|
|
|
|
- @Query(value = "SELECT q.`id`,q.`name`,SUM(IF(t.`result` IS NULL,1,0)),COUNT(t.question_id), q.area_code \n" +
|
|
|
|
- "FROM mark_task_rough_level t LEFT OUTER JOIN exam_question q ON t.`question_id` = q.`id` LEFT JOIN paper p ON t.paper_id = p.id WHERE " +
|
|
|
|
- "t.`marker_id` = ? and t.stage = ? and p.is_missing = false and p.is_test = ? GROUP BY t.`question_id` ORDER BY q.`id`", nativeQuery = true)
|
|
|
|
- List<Object[]> countGroupByQuestion(Long markerId, Integer stageId, int test);
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* 统计各评卷员各试题已评数及总数(分档阶段)
|
|
* 统计各评卷员各试题已评数及总数(分档阶段)
|
|
*
|
|
*
|
|
@@ -99,17 +53,6 @@ public interface MarkTaskRoughLevelRepo extends JpaRepository<MarkTaskRoughLevel
|
|
"t.work_id = :workId and t.subject = :subject and t.stage = :stageId and p.is_missing = false and p.is_test = :test and p.rough_batch_no = :batchNo and t.marker_id in (:markers) GROUP BY t.marker_id,mu.login_name, t.`marker_name` ORDER BY q.`id`,t.marker_id", nativeQuery = true)
|
|
"t.work_id = :workId and t.subject = :subject and t.stage = :stageId and p.is_missing = false and p.is_test = :test and p.rough_batch_no = :batchNo and t.marker_id in (:markers) GROUP BY t.marker_id,mu.login_name, t.`marker_name` ORDER BY q.`id`,t.marker_id", nativeQuery = true)
|
|
List<Object[]> listGroupByQuestionAndMarkerAndBatchNoAndMarkerId(@Param("workId") Long workId, @Param("subject") String subject, @Param("stageId") Integer stageId, @Param("test") int test, @Param("batchNo") Long batchNo, @Param("markers") List<Long> markers);
|
|
List<Object[]> listGroupByQuestionAndMarkerAndBatchNoAndMarkerId(@Param("workId") Long workId, @Param("subject") String subject, @Param("stageId") Integer stageId, @Param("test") int test, @Param("batchNo") Long batchNo, @Param("markers") List<Long> markers);
|
|
|
|
|
|
- /**
|
|
|
|
- * 考区已评数及总数(分档阶段)
|
|
|
|
- *
|
|
|
|
- * @param workId 工作ID
|
|
|
|
- * @param name 科目
|
|
|
|
- */
|
|
|
|
- @Query(value = "SELECT q.area_code areaCode, q.area_name areaName, q.`name`,SUM(IF(p.`score` IS NULL,1,0)) leftCount,COUNT(p.question_id) totalCount " +
|
|
|
|
- "FROM exam_question q LEFT JOIN paper p ON q.id = p.question_id AND q.subject = p.subject WHERE " +
|
|
|
|
- "p.work_id = ? and p.subject = ? and p.is_missing = false GROUP BY q.area_code, q.area_name ORDER BY q.area_code", nativeQuery = true)
|
|
|
|
- List<Object[]> listGroupByAreaName(Long workId, String name);
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* 考区已评数及总数(分档阶段)
|
|
* 考区已评数及总数(分档阶段)
|
|
*
|
|
*
|
|
@@ -122,31 +65,6 @@ public interface MarkTaskRoughLevelRepo extends JpaRepository<MarkTaskRoughLevel
|
|
"p.work_id = ? and p.subject = ? and p.is_missing = false and p.is_test = ? GROUP BY q.area_code, q.area_name ORDER BY q.area_code", nativeQuery = true)
|
|
"p.work_id = ? and p.subject = ? and p.is_missing = false and p.is_test = ? GROUP BY q.area_code, q.area_name ORDER BY q.area_code", nativeQuery = true)
|
|
List<Object[]> listGroupByAreaName(Long workId, String name, int test);
|
|
List<Object[]> listGroupByAreaName(Long workId, String name, int test);
|
|
|
|
|
|
- /**
|
|
|
|
- * 统计评卷员各试题已评数及总数(分档阶段)
|
|
|
|
- *
|
|
|
|
- * @param markerId 评卷员ID
|
|
|
|
- * @param stageId 阶段
|
|
|
|
- */
|
|
|
|
- @Query(value = "SELECT q.`id`,q.`name`,SUM(IF(t.`result` IS NULL,1,0)),COUNT(t.question_id), q.area_code \n" +
|
|
|
|
- "FROM mark_task_rough_level t LEFT OUTER JOIN exam_question q ON t.`question_id` = q.`id` LEFT JOIN paper p ON t.paper_id = p.id WHERE " +
|
|
|
|
- "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 workId 工作ID
|
|
|
|
- * @param subject 科目
|
|
|
|
- * @param stageId 阶段
|
|
|
|
- * @param batchNo 批次号
|
|
|
|
- * @param markers 评卷员ID集合
|
|
|
|
- */
|
|
|
|
- @Query(value = "SELECT q.`id`,t.`marker_id` markerId,mu.login_name loginName,t.`marker_name` markerName,q.`name`,SUM(IF(t.`result` IS NULL,1,0)) leftCount,COUNT(t.question_id) totalCount,SUM(t.is_rejected) rejectedCount, q.area_code areaCode " +
|
|
|
|
- "FROM mark_task_rough_level t LEFT JOIN mark_user mu on t.marker_id = mu.id LEFT OUTER JOIN exam_question q ON t.`question_id` = q.`id` LEFT JOIN paper p ON t.paper_id = p.id WHERE " +
|
|
|
|
- "t.work_id = :workId and t.subject = :subject and t.stage = :stageId and p.score_batch_no = :batchNo and t.`marker_id` in (:markers) and p.is_missing = false GROUP BY t.marker_id,mu.login_name, t.`marker_name` ORDER BY q.`id`, t.`marker_id`", nativeQuery = true)
|
|
|
|
- List<Object[]> listGroupByQuestionAndMarkerAndScoreBatchNoAndMakerId(@Param("workId") Long workId, @Param("subject") String subject, @Param("stageId") Integer stageId, @Param("batchNo") Long batchNo, @Param("markers") List<Long> markers);
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* 统计指定试卷的所有任务数量
|
|
* 统计指定试卷的所有任务数量
|
|
*
|
|
*
|
|
@@ -156,26 +74,15 @@ public interface MarkTaskRoughLevelRepo extends JpaRepository<MarkTaskRoughLevel
|
|
|
|
|
|
List<MarkTaskRoughLevel> findByWorkIdAndSecretNumber(Long workId, String secretNumber);
|
|
List<MarkTaskRoughLevel> findByWorkIdAndSecretNumber(Long workId, String secretNumber);
|
|
|
|
|
|
- @Query(value = "SELECT max(t.randomSeq) FROM MarkTaskLevel 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_rough_level m where m.question_id = ?1 and m.marker_id = ?2 and m.stage = ?3 and m.result is null and m.batch_no = ?4 and m.is_rejected = false", nativeQuery = true)
|
|
@Query(value = "SELECT count(1) from mark_task_rough_level m where m.question_id = ?1 and m.marker_id = ?2 and m.stage = ?3 and m.result is null and m.batch_no = ?4 and m.is_rejected = false", nativeQuery = true)
|
|
int countByQuestionIdAndMarkerIdAndStageAndResultNull(Long questionId, Long markerId, int stage, Long batchNo);
|
|
int countByQuestionIdAndMarkerIdAndStageAndResultNull(Long questionId, Long markerId, int stage, Long batchNo);
|
|
|
|
|
|
- @Query(value = "SELECT count(1) from mark_task_rough_level m inner join paper p on m.paper_id = p.id and p.is_shift = 0 and p.is_shift_score = 0 and p.score_batch_no = ?4 where m.question_id = ?1 and m.marker_id = ?2 and m.stage = ?3 and m.result is null", nativeQuery = true)
|
|
|
|
- int countScoreByQuestionIdAndMarkerIdAndStageAndResultIsNull(Long questionId, Long markerId, int stage, Long batchNo);
|
|
|
|
-
|
|
|
|
- MarkTaskLevel findByPaperIdAndMarkerId(Long paperId, Long markId);
|
|
|
|
-
|
|
|
|
List<MarkTaskLevel> findByWorkId(Long workId);
|
|
List<MarkTaskLevel> findByWorkId(Long workId);
|
|
|
|
|
|
@Query(value = "SELECT count(1) from mark_task_rough_level m inner join paper p on m.paper_id = p.id and p.is_missing = ?4 and p.is_shift = 1 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_rough_level m inner join paper p on m.paper_id = p.id and p.is_missing = ?4 and p.is_shift = 1 where m.question_id = ?1 and m.marker_id = ?2 and m.stage = ?3 and m.result is null", nativeQuery = true)
|
|
int countShiftByQuestionIdAndMarkerIdAndStageAndResultIsNullAndIsMissing(Long questionId, Long id, int ordinal, boolean b);
|
|
int countShiftByQuestionIdAndMarkerIdAndStageAndResultIsNullAndIsMissing(Long questionId, Long id, int ordinal, boolean b);
|
|
|
|
|
|
- @Query(value = "SELECT count(1) from mark_task_rough_level m inner join paper p on m.paper_id = p.id and p.is_shift = 0 and p.is_shift_score = 1 where m.question_id = ?1 and m.marker_id = ?2 and m.stage = ?3 and m.result is null", nativeQuery = true)
|
|
|
|
- int countShiftScoreByQuestionIdAndMarkerIdAndStageAndResultIsNull(Long questionId, Long id, int ordinal);
|
|
|
|
-
|
|
|
|
@Query(value = "select count(1) from mark_task_rough_level m inner join paper p on m.paper_id = p.id and p.batch_no is not null where m.question_id = ?1 and m.marker_id = ?2", nativeQuery = true)
|
|
@Query(value = "select count(1) from mark_task_rough_level m inner join paper p on m.paper_id = p.id and p.batch_no is not null where m.question_id = ?1 and m.marker_id = ?2", nativeQuery = true)
|
|
long countByQuestionIdAll(Long questionId, Long markId);
|
|
long countByQuestionIdAll(Long questionId, Long markId);
|
|
|
|
|
|
@@ -190,14 +97,9 @@ public interface MarkTaskRoughLevelRepo extends JpaRepository<MarkTaskRoughLevel
|
|
|
|
|
|
int countByWorkIdAndSubjectAndStage(Long workId, Subject subject, MarkStage stage);
|
|
int countByWorkIdAndSubjectAndStage(Long workId, Subject subject, MarkStage stage);
|
|
|
|
|
|
- int countByWorkIdAndStageAndResultNotNull(Long id, MarkStage level);
|
|
|
|
-
|
|
|
|
@Query(value = "select count(1) from mark_task_rough_level m inner join paper p on m.paper_id = p.id where m.work_id = ?1 and m.subject = ?2 and m.marker_id = ?3 and m.stage = ?4 and m.result is null and p.is_shift = true", nativeQuery = true)
|
|
@Query(value = "select count(1) from mark_task_rough_level m inner join paper p on m.paper_id = p.id where m.work_id = ?1 and m.subject = ?2 and m.marker_id = ?3 and m.stage = ?4 and m.result is null and p.is_shift = true", nativeQuery = true)
|
|
int countByWorkIdAndSubjectAndMarkerIdAndStageAndShiftAndResult(Long workId, String subject, Long valueOf, int stage);
|
|
int countByWorkIdAndSubjectAndMarkerIdAndStageAndShiftAndResult(Long workId, String subject, Long valueOf, int stage);
|
|
|
|
|
|
- @Query(value = "select count(1) from mark_task_rough_level m inner join paper p on m.paper_id = p.id where m.work_id = ?1 and m.subject = ?2 and m.marker_id = ?3 and m.stage = ?4 and m.result is null and p.is_shift_score = 1", nativeQuery = true)
|
|
|
|
- int countByWorkIdAndSubjectAndMarkerIdAndStageAndShiftScoreAndResult(Long workId, String subject, Long valueOf, int stage);
|
|
|
|
-
|
|
|
|
@Query(value = "select count(1) from mark_task_rough_level m where m.work_id = ?1 and m.subject = ?2 and m.marker_id = ?3 and m.stage = ?4 and m.is_rejected = 1", nativeQuery = true)
|
|
@Query(value = "select count(1) from mark_task_rough_level m where m.work_id = ?1 and m.subject = ?2 and m.marker_id = ?3 and m.stage = ?4 and m.is_rejected = 1", nativeQuery = true)
|
|
int findByWorkIdAndSubjectAndMarkerIdAndStageReject(Long workId, String subject, Long valueOf, int stage);
|
|
int findByWorkIdAndSubjectAndMarkerIdAndStageReject(Long workId, String subject, Long valueOf, int stage);
|
|
|
|
|
|
@@ -211,9 +113,6 @@ public interface MarkTaskRoughLevelRepo extends JpaRepository<MarkTaskRoughLevel
|
|
@Query(value = "update mark_task_rough_level m set m.level = ?1 where m.paper_id = ?2", nativeQuery = true)
|
|
@Query(value = "update mark_task_rough_level m set m.level = ?1 where m.paper_id = ?2", nativeQuery = true)
|
|
void updateLevelByPaperId(String level, Long id);
|
|
void updateLevelByPaperId(String level, Long id);
|
|
|
|
|
|
- @Query("select s.paper from MarkTaskRoughLevel s where s.workId = :workId and s.subject = :subject and s.stage = :stage and s.markerId in (:markers)")
|
|
|
|
- List<Paper> findByWorkIdAndSubjectAndStageAndMarkerIdIn(@Param("workId") Long workId, @Param("subject") Subject subject, @Param("stage") MarkStage stage, @Param("markers") List<Long> markers);
|
|
|
|
-
|
|
|
|
@Query(value = "select s.paper_id, s.marker_id from mark_task_rough_level s where s.work_id = :workId and s.subject = :subject and s.stage = :stage", nativeQuery = true)
|
|
@Query(value = "select s.paper_id, s.marker_id from mark_task_rough_level s where s.work_id = :workId and s.subject = :subject and s.stage = :stage", nativeQuery = true)
|
|
List<Object[]> findByWorkIdAndSubjectAndStage(@Param("workId") Long workId, @Param("subject") String subject, @Param("stage") int stage);
|
|
List<Object[]> findByWorkIdAndSubjectAndStage(@Param("workId") Long workId, @Param("subject") String subject, @Param("stage") int stage);
|
|
|
|
|