<?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="com.miaxis.question.mapper.QuestionInfoMapper">

    <resultMap type="QuestionInfo" id="QuestionInfoResult">
        <result property="id"    column="id"    />
        <result property="questionId"    column="question_id"    />
        <result property="mediaType"    column="media_type"    />
        <result property="chapterId"    column="chapter_id"    />
        <result property="label"    column="label"    />
        <result property="question"    column="question"    />
        <result property="mediaKey"    column="media_key"    />
        <result property="answer"    column="answer"    />
        <result property="optionA"    column="option_a"    />
        <result property="optionB"    column="option_b"    />
        <result property="optionC"    column="option_c"    />
        <result property="optionD"    column="option_d"    />
        <result property="optionE"    column="option_e"    />
        <result property="optionF"    column="option_f"    />
        <result property="optionG"    column="option_g"    />
        <result property="optionH"    column="option_h"    />
        <result property="explain1"    column="explain1"    />
        <result property="conciseExplain"    column="concise_explain"    />
        <result property="keywords"    column="keywords"    />
        <result property="assuredKeywords"    column="assured_keywords"    />
        <result property="illiteracyExplain"    column="illiteracy_explain"    />
        <result property="illiteracyKeywords"    column="illiteracy_keywords"    />
        <result property="difficulty"    column="difficulty"    />
        <result property="wrongRate"    column="wrong_rate"    />
        <result property="optionType"    column="option_type"    />
        <result property="knackKeyword"    column="knack_keyword"    />
        <result property="knackImgUrl"    column="knack_img_url"    />
        <result property="knackDetail"    column="knack_detail"    />
        <result property="knackVoiceTxt"    column="knack_voice_txt"    />
        <result property="m"    column="m"    />
    </resultMap>

    <sql id="selectQuestionInfoVo">
        select id, question_id, media_type, chapter_id, label, question, media_key, answer, option_a, option_b, option_c, option_d, option_e, option_f, option_g, option_h, explain1, concise_explain, keywords, assured_keywords, illiteracy_explain, illiteracy_keywords, difficulty, wrong_rate, option_type, knack_keyword, knack_img_url, knack_detail, knack_voice_txt, m from question_info
    </sql>

    <select id="selectQuestionInfoList" parameterType="QuestionInfo" resultMap="QuestionInfoResult">
        <include refid="selectQuestionInfoVo"/>
        <where>
            <if test="id != null "> and id = #{id}</if>
            <if test="questionId != null "> and question_id = #{questionId}</if>
            <if test="mediaType != null "> and media_type = #{mediaType}</if>
            <if test="chapterId != null "> and chapter_id = #{chapterId}</if>
            <if test="label != null  and label != ''"> and label = #{label}</if>
            <if test="question != null "> and question = #{question}</if>
            <if test="mediaKey != null  and mediaKey != ''"> and media_key = #{mediaKey}</if>
            <if test="answer != null "> and answer = #{answer}</if>
            <if test="optionA != null  and optionA != ''"> and option_a = #{optionA}</if>
            <if test="optionB != null  and optionB != ''"> and option_b = #{optionB}</if>
            <if test="optionC != null  and optionC != ''"> and option_c = #{optionC}</if>
            <if test="optionD != null  and optionD != ''"> and option_d = #{optionD}</if>
            <if test="optionE != null  and optionE != ''"> and option_e = #{optionE}</if>
            <if test="optionF != null  and optionF != ''"> and option_f = #{optionF}</if>
            <if test="optionG != null  and optionG != ''"> and option_g = #{optionG}</if>
            <if test="optionH != null  and optionH != ''"> and option_h = #{optionH}</if>
            <if test="explain1 != null "> and explain1 = #{explain1}</if>
            <if test="conciseExplain != null "> and concise_explain = #{conciseExplain}</if>
            <if test="keywords != null "> and keywords = #{keywords}</if>
            <if test="assuredKeywords != null "> and assured_keywords = #{assuredKeywords}</if>
            <if test="illiteracyExplain != null "> and illiteracy_explain = #{illiteracyExplain}</if>
            <if test="illiteracyKeywords != null "> and illiteracy_keywords = #{illiteracyKeywords}</if>
            <if test="difficulty != null "> and difficulty = #{difficulty}</if>
            <if test="wrongRate != null "> and wrong_rate = #{wrongRate}</if>
            <if test="optionType != null "> and option_type = #{optionType}</if>
            <if test="knackKeyword != null "> and knack_keyword = #{knackKeyword}</if>
            <if test="knackImgUrl != null "> and knack_img_url = #{knackImgUrl}</if>
            <if test="knackDetail != null "> and knack_detail = #{knackDetail}</if>
            <if test="knackVoiceTxt != null "> and knack_voice_txt = #{knackVoiceTxt}</if>
            <if test="m != null "> and m = #{m}</if>
        </where>
    </select>

</mapper>
