瀏覽代碼

资源库统计题目数量

yangfeng 1 年之前
父節點
當前提交
5a4994540d
共有 1 個文件被更改,包括 13 次插入10 次删除
  1. 13 10
      web/src/main/java/com/ynfy/buss/exam/question/mapper/xml/QuestionMapper.xml

+ 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>