Browse Source

资源库统计题目数量

yangfeng 1 year ago
parent
commit
5a4994540d

+ 13 - 10
web/src/main/java/com/ynfy/buss/exam/question/mapper/xml/QuestionMapper.xml

@@ -304,6 +304,7 @@
                     #{item}
                 </foreach>
             </if>
+            AND child = 0
         </where>
         GROUP BY
             repository_id
@@ -311,24 +312,25 @@
 
     <select id="countQuestionNumByType" resultType="com.ynfy.buss.exam.question.dto.QuestionDTO">
         SELECT
-        type,
-        COUNT(*) as num
+            type,
+            COUNT(*) as num
         FROM
-        question
+            question
         <where>
             repository_id = #{repositoryId}
+            AND child = 0
         </where>
         GROUP BY
-        type
+            type
     </select>
 
     <select id="countQuestionType" resultType="com.ynfy.buss.exam.question.dto.QuestionDTO">
         SELECT
-        repository_id as repositoryId,
-        type,
-        COUNT(*) as num
+            repository_id as repositoryId,
+            type,
+            COUNT(*) as num
         FROM
-        question
+            question
         <where>
             <if test="repositoryIds !=null and repositoryIds.size()>0">
                 AND repository_id IN
@@ -336,9 +338,10 @@
                     #{item}
                 </foreach>
             </if>
+            AND child = 0
         </where>
         GROUP BY
-        repository_id,
-        type
+            repository_id,
+            type
     </select>
 </mapper>