From 8d43111bd0e598bc0b2014cbfa69a32e74959dff Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Wed, 15 Dec 2021 19:24:05 +0800
Subject: [PATCH] ftp sql 同步封装
---
src/main/java/org/springblade/modules/exam/mapper/ExamSubjectChoicesMapper.xml | 41 +++++++++++++++++++++++++++++++----------
1 files changed, 31 insertions(+), 10 deletions(-)
diff --git a/src/main/java/org/springblade/modules/exam/mapper/ExamSubjectChoicesMapper.xml b/src/main/java/org/springblade/modules/exam/mapper/ExamSubjectChoicesMapper.xml
index 949e72c..b126c16 100644
--- a/src/main/java/org/springblade/modules/exam/mapper/ExamSubjectChoicesMapper.xml
+++ b/src/main/java/org/springblade/modules/exam/mapper/ExamSubjectChoicesMapper.xml
@@ -18,6 +18,26 @@
</if>
</select>
+ <!--查询试卷绑定的题目-->
+ <select id="getEexPaperChoices" resultType="org.springblade.modules.exam.vo.ExamSubjectChoicesVO">
+ SELECT
+ esc.*
+ FROM
+ exam_subject_choices esc
+ LEFT JOIN exam_examination_subject exa ON esc.id = exa.subject_id
+ WHERE
+ 1=1
+ <if test="examSubjectChoices.id!=null and examSubjectChoices.id!=''">
+ and exa.examination_id = #{examSubjectChoices.id}
+ </if>
+ <if test="examSubjectChoices.subjectName!=null and examSubjectChoices.subjectName!=''">
+ and esc.subject_name like concat('%', #{examSubjectChoices.subjectName},'%')
+ </if>
+ <if test="examSubjectChoices.choicesType!=null and examSubjectChoices.choicesType!=''">
+ and esc.choices_type = #{examSubjectChoices.choices_type}
+ </if>
+ </select>
+
<!--ExamSubjectChoicesInfoMap 多表联查 一对多查询 -->
<resultMap id="ExamSubjectChoicesInfoMap" type="org.springblade.modules.exam.vo.ExamSubjectChoicesVO">
@@ -26,15 +46,7 @@
<id property="subjectName" column="subject_name"/>
<id property="choicesType" column="choices_type"/>
<id property="score" column="score"/>
- <id property="analysis" column="analysis"/>
<id property="level" column="level"/>
- <id property="creator" column="creator"/>
- <id property="createDate" column="create_date"/>
- <id property="modifier" column="modifier"/>
- <id property="modifyDate" column="modify_date"/>
- <id property="delFlag" column="del_flag"/>
- <id property="applicationCode" column="application_code"/>
- <id property="tenantCode" column="tenant_code"/>
<result column="id" property="id"/>
<collection property="examSubjectOptions" javaType="java.util.List" ofType="org.springblade.modules.exam.entity.ExamSubjectOption" autoMapping="true">
<id property="id" column="eso_id"/>
@@ -42,10 +54,10 @@
</resultMap>
- <!--选择题详情信息-->
+ <!--题目详情信息-->
<select id="selectExamSubjectChoicesInfo" resultMap="ExamSubjectChoicesInfoMap">
SELECT
- esc.*,
+ esc.id,esc.category_id,esc.subject_name,esc.choices_type,esc.score,esc.level,
eso.id eso_id,eso.subject_choices_id,eso.option_name,eso.option_content,eso.creator,
eso.create_date,eso.modifier,eso.modify_date,eso.del_flag,eso.application_code,eso.tenant_code
FROM
@@ -60,4 +72,13 @@
and esc.id = #{examSubjectChoices.id}
</if>
</select>
+
+ <update id="updateChoicesValue">
+ update exam_subject_choices set score = #{value} where id = #{id}
+ </update>
+
+ <!--根据 题目id 删除选项-->
+ <delete id="removeBySubjectId">
+ delete from exam_subject_option where subject_choices_id = #{id}
+ </delete>
</mapper>
--
Gitblit v1.9.3