From 6c12bcfde3b2d5c910ed1b11112442237021ac09 Mon Sep 17 00:00:00 2001
From: qirong <2032486488@qq.com>
Date: 星期日, 16 七月 2023 10:01:38 +0800
Subject: [PATCH] 随机试卷修改

---
 src/main/resources/mapper/QuestionMapper.xml |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/src/main/resources/mapper/QuestionMapper.xml b/src/main/resources/mapper/QuestionMapper.xml
index b11d77c..50d0a31 100644
--- a/src/main/resources/mapper/QuestionMapper.xml
+++ b/src/main/resources/mapper/QuestionMapper.xml
@@ -192,7 +192,11 @@
         and q.grade_level= #{level}
       </if>
       <if test="subjectId != null ">
-        and qs.subject_id= #{subjectId}
+        and qs.subject_id in
+        <foreach item="subjectId" collection="subjectId" open="(" separator=","
+                 close=")">
+          #{subjectId}
+        </foreach>
       </if>
       <if test="questionType != null ">
         and q.question_type= #{questionType}
@@ -201,6 +205,7 @@
         and q.info_text_content_id in (SELECT id FROM t_text_content WHERE content like concat('%',#{content},'%') )
       </if>
     </where>
+    group by q.id
   </select>
 
 
@@ -229,4 +234,8 @@
 		GROUP BY create_time
 	</select>
 
+  <select id="getAll"  resultMap="BaseResultMap">
+    SELECT <include refid="Base_Column_List"/>
+        from t_question where  deleted=0
+  </select>
 </mapper>

--
Gitblit v1.8.0