Explorar el Código

优化查询题目dao

xuwenjin hace 6 años
padre
commit
3988c4a5af

+ 1 - 1
stmms-biz/src/main/java/cn/com/qmth/stmms/biz/exam/dao/ExamQuestionDao.java

@@ -14,7 +14,7 @@ public interface ExamQuestionDao extends JpaRepository<ExamQuestion, Integer>, J
     @Query("select sum(q.totalScore) as totalScore from ExamQuestion q where q.examId=?1 and q.subjectCode=?2 and q.mainNumber=?3")
     public Double queryFullScoreByExamIdAndSubjectCodeAndMainNumber(Integer examId, String subjectCode, Integer mainNumber);
 
-    @Query("select q from ExamQuestion q where q.examId=?1 and q.subjectCode=?2 and q.objective=?3 "
+    @Query("select q from ExamQuestion q where q.examId=?1 and q.subjectCode=?2 and q.objective=?3 and q.paperType is not null "
             + "order by q.mainNumber, q.subNumber")
     public List<ExamQuestion> findByExamIdAndSubjectCodeAndObjective(Integer examId, String subjectCode,
                                                                      boolean objective);