|
@@ -91,6 +91,30 @@ public interface PaperRepo extends JpaRepository<Paper, Long>, JpaSpecificationE
|
|
|
"GROUP BY p.`level` ORDER BY p.`level`", nativeQuery = true)
|
|
|
List<Object[]> countGroupByLevelAll(Long questionId);
|
|
|
|
|
|
+ /**
|
|
|
+ * 统计科目指定试题的各档位数量
|
|
|
+ *
|
|
|
+ * @param questionId
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Query(value = "select * from (SELECT p.`level`,COUNT(*)," +
|
|
|
+ "SUM(IF(p.`is_rejected` = 1, 1, 0))," +
|
|
|
+ "SUM(IF(p.`is_arbitrated` = 1, 1, 0))" +
|
|
|
+ "FROM paper p " +
|
|
|
+ "WHERE p.`question_id` = ? and p.is_missing = false " +
|
|
|
+ "AND p.batch_no = (select max(batch_no) from paper where question_id = ?) " +
|
|
|
+ " AND p.level is null " +
|
|
|
+ " GROUP BY p.`level` union "+
|
|
|
+ "SELECT p.`level`,COUNT(*)," +
|
|
|
+ "SUM(IF(p.`is_rejected` = 1, 1, 0))," +
|
|
|
+ "SUM(IF(p.`is_arbitrated` = 1, 1, 0))" +
|
|
|
+ "FROM paper p " +
|
|
|
+ "WHERE p.`question_id` = ? and p.is_missing = false " +
|
|
|
+ " AND p.level is not null " +
|
|
|
+ " GROUP BY p.`level`) t ORDER BY t.`level`"
|
|
|
+ , nativeQuery = true)
|
|
|
+ List<Object[]> countGroupByLevelAllOther(Long questionId, Long questionId1, Long questionId2);
|
|
|
+
|
|
|
/**
|
|
|
* 统计workId各档位数量
|
|
|
*
|