From 1c89a9d39893c18aac63aa5763b4787b65de3624 Mon Sep 17 00:00:00 2001
From: 龚焕茏 <2842157468@qq.com>
Date: 星期四, 30 五月 2024 11:28:37 +0800
Subject: [PATCH] fix:在线练习排序

---
 src/main/resources/mapper/ExamTemplatesSubjectMapper.xml |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/main/resources/mapper/ExamTemplatesSubjectMapper.xml b/src/main/resources/mapper/ExamTemplatesSubjectMapper.xml
index 8e6374d..b748650 100644
--- a/src/main/resources/mapper/ExamTemplatesSubjectMapper.xml
+++ b/src/main/resources/mapper/ExamTemplatesSubjectMapper.xml
@@ -4,6 +4,7 @@
     <resultMap id="BaseResultMap" type="com.mindskip.xzs.domain.ExamTemplatesSubject">
         <id column="id" jdbcType="INTEGER" property="id"/>
         <result column="subject_id" jdbcType="INTEGER" property="subjectId"/>
+        <result column="subjectName" property="subjectName"/>
         <result column="templates_id" jdbcType="INTEGER" property="templatesId"/>
     </resultMap>
 
@@ -18,9 +19,10 @@
 
     <select id="getTemplatesId" resultMap="BaseResultMap">
         select
-        <include refid="Base_Column_List"/>
-        from t_exam_templates_subject
-        where templates_id = #{templatesId}
+            ets.id, ets.subject_id, ets.templates_id, ts.name as subjectName
+        from t_exam_templates_subject ets
+            INNER JOIN t_subject ts ON ts.id = ets.subject_id
+        where ets.templates_id = #{templatesId}
     </select>
 
     <insert id="saves" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
@@ -42,4 +44,4 @@
         from t_exam_templates_subject where templates_id = #{templatesId}
     </select>
 
-</mapper>
\ No newline at end of file
+</mapper>

--
Gitblit v1.8.0