|
@@ -8,7 +8,6 @@ import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
|
|
import org.springframework.data.jpa.repository.Query;
|
|
|
|
|
|
import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
* Created by zhengmin on 2016/9/23.
|
|
@@ -106,9 +105,9 @@ public interface MarkTaskRepo extends JpaRepository<MarkTask, Long>, JpaSpecific
|
|
|
* @param batchNo
|
|
|
* @return
|
|
|
*/
|
|
|
- @Query(value = "SELECT q.`id`,t.`marker_id` markerId,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 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.work_id = ? and t.subject = ? and t.stage = ? and p.is_missing = false and p.is_test = ? and p.batch_no = ? GROUP BY t.marker_id, t.`marker_name` ORDER BY q.`id`,t.marker_id", nativeQuery = true)
|
|
|
+ @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 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 = ? and t.subject = ? and t.stage = ? and p.is_missing = false and p.is_test = ? and p.batch_no = ? GROUP BY t.marker_id,mu.login_name, t.`marker_name` ORDER BY q.`id`,t.marker_id", nativeQuery = true)
|
|
|
List<Object[]> listGroupByQuestionAndMarkerAndBatchNo(Long workId, String name, Integer stageId, int test, Long batchNo);
|
|
|
|
|
|
/**
|
|
@@ -151,9 +150,9 @@ public interface MarkTaskRepo extends JpaRepository<MarkTask, Long>, JpaSpecific
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
- @Query(value = "SELECT q.`id`,t.`marker_id` markerId,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 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.work_id = ? and t.subject = ? and t.stage = ? and p.score_batch_no = ? and p.is_missing = false GROUP BY t.marker_id, t.`marker_name` ORDER BY q.`id`, t.`marker_id`", nativeQuery = true)
|
|
|
+ @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 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 = ? and t.subject = ? and t.stage = ? and p.score_batch_no = ? 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[]> listGroupByQuestionAndMarkerAndScoreBatchNo(Long workId, String name, Integer stageId, Long batchNo);
|
|
|
|
|
|
/**
|
|
@@ -211,4 +210,6 @@ public interface MarkTaskRepo extends JpaRepository<MarkTask, Long>, JpaSpecific
|
|
|
int countByQuestionIdAndMarkerIdAndStageAndIsRejectedTrueAndIsMissing(Long questionId, Long markerId, int ordinal,boolean isMissing);
|
|
|
|
|
|
List<MarkTask> findByWorkIdAndSubjectAndMarkerIdAndStage(Long workId, Subject subject, Long valueOf, MarkStage stage);
|
|
|
+
|
|
|
+ int countByWorkIdAndSubjectAndStage(Long workId, Subject subject, MarkStage stage);
|
|
|
}
|