<?xml version="1.0" encoding="UTF-8"?>
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<mapper namespace="org.springblade.modules.exam.mapper.ExamSubjectChoicesMapper">
|
|
<!--选择题分页信息-->
|
<select id="selectExamSubjectChoicesPage" resultType="org.springblade.modules.exam.vo.ExamSubjectChoicesVO">
|
SELECT
|
esc.*
|
FROM
|
exam_subject_choices esc
|
WHERE
|
1=1
|
<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 choices_type = #{examSubjectChoices.choicesType}
|
</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">
|
<id property="id" column="id"/>
|
<id property="categoryId" column="category_id"/>
|
<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"/>
|
</collection>
|
</resultMap>
|
|
|
<!--选择题详情信息-->
|
<select id="selectExamSubjectChoicesInfo" resultMap="ExamSubjectChoicesInfoMap">
|
SELECT
|
esc.*,
|
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
|
exam_subject_choices esc
|
left join
|
exam_subject_option eso
|
on
|
esc.id = eso.subject_choices_id
|
WHERE
|
1=1
|
<if test="examSubjectChoices.id!=null">
|
and esc.id = #{examSubjectChoices.id}
|
</if>
|
</select>
|
|
<update id="updateChoicesValue">
|
update exam_subject_choices set score = #{value} where id = #{id}
|
</update>
|
</mapper>
|