From b899d344b2004ad6593111699ea96b50c2c1597d Mon Sep 17 00:00:00 2001
From: 龚焕茏 <2842157468@qq.com>
Date: 星期三, 08 五月 2024 09:10:32 +0800
Subject: [PATCH] feat:反馈保存、展示、处理、删除

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

diff --git a/src/main/resources/mapper/QuestionMapper.xml b/src/main/resources/mapper/QuestionMapper.xml
index 50d0a31..fe253d0 100644
--- a/src/main/resources/mapper/QuestionMapper.xml
+++ b/src/main/resources/mapper/QuestionMapper.xml
@@ -183,6 +183,7 @@
     q.*
     FROM t_question q
     LEFT JOIN t_question_subject qs on q.id = qs.question_id
+    LEFT JOIN t_text_content t on q.info_text_content_id = t.id
     <where>
         and q.deleted=0 and qs.deleted = 0
       <if test="id != null ">
@@ -200,6 +201,9 @@
       </if>
       <if test="questionType != null ">
         and q.question_type= #{questionType}
+      </if>
+      <if test="questionName != null and questionName != ''">
+        and t.content->'$."titleContent"' LIKE concat('%',#{questionName},'%')
       </if>
       <if test="content != null">
         and q.info_text_content_id in (SELECT id FROM t_text_content WHERE content like concat('%',#{content},'%') )
@@ -238,4 +242,41 @@
     SELECT <include refid="Base_Column_List"/>
         from t_question where  deleted=0
   </select>
+
+  <select id="export" resultMap="exportMap">
+    SELECT
+           q.*, ttc.content
+    FROM
+         t_question q
+             INNER JOIN t_text_content ttc on q.info_text_content_id = ttc.id AND q.deleted = 0
+    <where>
+      <if test="query.questionType != null">
+        q.question_type = #{query.questionType}
+      </if>
+      <if test="query.start != null and query.end != null">
+        q.create_time between #{query.start} and #{query.end}
+      </if>
+    </where>
+  </select>
+
+  <resultMap id="exportMap" type="com.mindskip.xzs.vo.QuestionImportVO">
+    <result column="question_type" property="questionType" />
+    <result column="title" property="title" />
+    <result column="analyze" property="analyze" />
+    <result column="score" property="score" />
+    <result column="difficult" property="difficult" />
+    <result column="content" property="questionContent" />
+    <result column="score" property="score" />
+    <result column="correct" property="correct" />
+    <collection property="subjectList" column="id" ofType="string" select="selectSubjects"/>
+  </resultMap>
+
+  <select id="selectSubjects" resultType="string">
+    SELECT
+           ts.name
+    FROM
+        t_question_subject tqs
+             INNER JOIN t_subject ts ON tqs.subject_id = ts.id AND tqs.question_id = #{id} AND tqs.deleted = 0 AND ts.deleted = 0
+  </select>
+
 </mapper>

--
Gitblit v1.8.0