From 2e830efbe694a3d328251b41690dc685a6e080ea Mon Sep 17 00:00:00 2001
From: 龚焕茏 <2842157468@qq.com>
Date: 星期一, 27 五月 2024 09:51:30 +0800
Subject: [PATCH] feat:修改用户时返回密码
---
src/main/resources/mapper/QuestionSubjectMapper.xml | 95 +++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 94 insertions(+), 1 deletions(-)
diff --git a/src/main/resources/mapper/QuestionSubjectMapper.xml b/src/main/resources/mapper/QuestionSubjectMapper.xml
index 5811325..c5aa74d 100644
--- a/src/main/resources/mapper/QuestionSubjectMapper.xml
+++ b/src/main/resources/mapper/QuestionSubjectMapper.xml
@@ -55,4 +55,97 @@
where subject_id = #{id} and qs.deleted = 0 and s.deleted = 0
</select>
-</mapper>
\ No newline at end of file
+ <select id="countQuestionNum" resultType="integer">
+ SELECT
+ count(distinct tqs.question_id)
+ FROM
+ t_question_subject tqs
+ INNER JOIN t_question tq ON tq.id = tqs.question_id <if test="questionType != -99">AND tq.question_type = #{questionType}</if>
+ WHERE
+ tqs.subject_id IN <foreach collection="subjects" open="(" separator="," close=")" item="subjectId">#{subjectId}</foreach>
+
+ </select>
+
+ <select id="getRandomQuestionId" resultType="com.mindskip.xzs.domain.vo.QuestionVO">
+ SELECT
+ distinct
+ tq.id,
+ tq.question_type as questionType,
+ tq.difficult,
+ ttc.content as contentJson,
+ tq.correct
+ FROM
+ t_question_subject tqs
+ INNER JOIN t_question tq ON tqs.question_id = tq.id AND tq.deleted = 0
+ <if test="questionType != null and questionType != -99">
+ AND tq.question_type = #{questionType}
+ </if>
+ AND tqs.subject_id IN <foreach collection="subjectIds" open="(" separator="," close=")" item="subjectId">#{subjectId}</foreach>
+ INNER JOIN t_text_content ttc ON tq.info_text_content_id = ttc.id
+ ORDER BY
+ RAND() LIMIT #{questionNum}
+ </select>
+
+ <select id="questionsBySubjectIds" resultType="integer">
+ SELECT
+ question_id
+ FROM
+ t_question_subject
+ <where>
+ subject_id IN <foreach collection="subjectIds" open="(" separator="," close=")" item="subjectId">#{subjectId}</foreach>
+ </where>
+ ORDER BY
+ id DESC
+ </select>
+
+ <select id="questionsBySubjectId" resultType="integer">
+ SELECT
+ 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, 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