From 9a1c378ec5566a727efcb85120cdafd52c3ee9f1 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期四, 23 五月 2024 16:21:37 +0800
Subject: [PATCH] 在线练习增加练习模式、融合在线练题

---
 src/main/resources/mapper/QuestionSubjectMapper.xml |   36 +++++++++++++++++++++++++++++++++---
 1 files changed, 33 insertions(+), 3 deletions(-)

diff --git a/src/main/resources/mapper/QuestionSubjectMapper.xml b/src/main/resources/mapper/QuestionSubjectMapper.xml
index 69f5979..c5aa74d 100644
--- a/src/main/resources/mapper/QuestionSubjectMapper.xml
+++ b/src/main/resources/mapper/QuestionSubjectMapper.xml
@@ -98,24 +98,54 @@
             id DESC
     </select>
 
-    <select id="questionsBySubjectId"  resultType="integer">
+    <select id="questionsBySubjectId" resultType="integer">
         SELECT
-            tqs.question_id
+            tqs.question_id, ttc.content
         FROM
             t_question_subject tqs
                 INNER JOIN t_question tq ON tqs.question_id = tq.id AND tqs.subject_id = #{subjectId}
+                INNER JOIN t_text_content ttc tct.id = tq.info_text_content_id
         ORDER BY
             tqs.id DESC
     </select>
 
     <select id="questionsBySubjectIdAndQuestionType" resultType="integer">
         SELECT
-            tqs.question_id
+            tqs.question_id, ttc.content
         FROM
             t_question_subject tqs
                 INNER JOIN t_question tq ON tqs.question_id = tq.id AND tqs.subject_id = #{subjectId} AND tq.question_type = #{questionType}
+                INNER JOIN t_text_content ttc ttc.id = tq.info_text_content_id
         ORDER BY
             tqs.id DESC
     </select>
 
+    <select id="bySubjectId" resultType="com.mindskip.xzs.domain.vo.QuestionVO">
+        SELECT
+           tq.id,
+           tq.question_type,
+           tq.correct,
+           ttc.content as contentJson
+        FROM
+            t_question_subject tqs
+                INNER JOIN t_question tq ON tqs.question_id = tq.id AND tqs.subject_id = #{subjectId}
+                INNER JOIN t_text_content ttc ON ttc.id = tq.info_text_content_id
+        ORDER BY
+            tq.id DESC
+    </select>
+
+    <select id="bySubjectIdAndQuestionType" resultType="com.mindskip.xzs.domain.vo.QuestionVO">
+        SELECT
+            tq.id,
+            tq.question_type,
+            tq.correct,
+            ttc.content as contentJson
+        FROM
+            t_question_subject tqs
+                INNER JOIN t_question tq ON tqs.question_id = tq.id AND tqs.subject_id = #{subjectId} AND tq.question_type = #{questionType}
+                INNER JOIN t_text_content ttc ON tct.id = tq.info_text_content_id
+        ORDER BY
+            tq.id DESC
+    </select>
+
 </mapper>

--
Gitblit v1.8.0