智慧保安后台管理-外网
Administrator
2021-07-16 269031cf8e6d1e4643e1be2b822bbfebcf87ea4b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?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>