<?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>
|
|
|
<!--ExamSubjectChoicesInfoMap 多表联查 一对多查询 -->
|
<resultMap id="ExamSubjectChoicesInfoMap" type="org.springblade.modules.exam.vo.ExamSubjectChoicesVO" autoMapping="true">
|
<id property="id" column="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>
|
</mapper>
|