From 468109c399d40c1a1f3c30bd443e09951aaf4a64 Mon Sep 17 00:00:00 2001
From: 龚焕茏 <2842157468@qq.com>
Date: 星期三, 15 五月 2024 18:19:03 +0800
Subject: [PATCH] fix:部门管理员角色设置
---
src/main/resources/mapper/QuestionSubjectMapper.xml | 35 ++++++++++++++++++++++++++++++++++-
1 files changed, 34 insertions(+), 1 deletions(-)
diff --git a/src/main/resources/mapper/QuestionSubjectMapper.xml b/src/main/resources/mapper/QuestionSubjectMapper.xml
index 90ac102..7f134aa 100644
--- a/src/main/resources/mapper/QuestionSubjectMapper.xml
+++ b/src/main/resources/mapper/QuestionSubjectMapper.xml
@@ -70,7 +70,8 @@
tq.id,
tq.question_type as questionType,
tq.difficult,
- ttc.content as contentJson
+ 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 AND tqs.subject_id IN <foreach collection="subjectIds" open="(" separator="," close=")" item="subjectId">#{subjectId}</foreach>
@@ -79,4 +80,36 @@
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
+ FROM
+ t_question_subject tqs
+ INNER JOIN t_question tq ON tqs.question_id = tq.id AND tqs.subject_id = #{subjectId}
+ ORDER BY
+ tqs.id DESC
+ </select>
+
+ <select id="questionsBySubjectIdAndQuestionType" resultType="integer">
+ SELECT
+ tqs.question_id
+ 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}
+ ORDER BY
+ tqs.id DESC
+ </select>
+
</mapper>
--
Gitblit v1.8.0