<?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="number"    column="number"    />
        <result property="answer"    column="answer"    />
        <result property="answerkeyword"    column="answerkeyword"    />
        <result property="explainGif"    column="explain_gif"    />
        <result property="explainJq"    column="explain_jq"    />
        <result property="explainJs"    column="explain_js"    />
        <result property="explainMp3"    column="explain_mp3"    />
        <result property="image"    column="image"    />
        <result property="imageYdt"    column="image_ydt"    />
        <result property="issue"    column="issue"    />
        <result property="opts"    column="opts"    />
        <result property="skillkeyword"    column="skillkeyword"    />
        <result property="titlekeyword"    column="titlekeyword"    />
        <result property="issuemp3"    column="issuemp3"    />
        <result property="answermp3"    column="answermp3"    />
        <result property="explainjsmp3"    column="explainjsmp3"    />
        <result property="subject1"    column="subject_1"    />
        <result property="subject2"    column="subject_2"    />
        <result property="subject3"    column="subject_3"    />
        <result property="subject4"    column="subject_4"    />
        <result property="liceCar"    column="lice_car"    />
        <result property="liceBus"    column="lice_bus"    />
        <result property="liceTruck"    column="lice_truck"    />
        <result property="liceMoto"    column="lice_moto"    />
        <result property="sequeIssue"    column="seque_issue"    />
        <result property="classIssue"    column="class_issue"    />
        <result property="placeIssue"    column="place_issue"    />
        <result property="excellIssue"    column="excell_issue"    />
        <result property="copyIssue"    column="copy_issue"    />
        <result property="mockIssue"    column="mock_issue"    />
        <result property="sequeIssueName"    column="seque_issue_name"    />
        <result property="placeIssueName"    column="place_issue_name"    />
        <result property="excellIssueName"    column="excell_issue_name"    />
        <result property="classIssueName"    column="class_issue_name"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateTime"    column="update_time"    />
    </resultMap>

    <sql id="selectQuestionInfoVo">
        select * from question_info
    </sql>

    <select id="selectQuestionInfoList" parameterType="QuestionInfo" resultMap="QuestionInfoResult">
        <include refid="selectQuestionInfoVo"/>
        <where>
            <if test="number != null "> and number = #{number}</if>
            <if test="answer != null  and answer != ''"> and answer = #{answer}</if>
            <if test="answerkeyword != null  and answerkeyword != ''"> and answerkeyword = #{answerkeyword}</if>
            <if test="explainGif != null  and explainGif != ''"> and explain_gif = #{explainGif}</if>
            <if test="explainJq != null  and explainJq != ''"> and explain_jq = #{explainJq}</if>
            <if test="explainJs != null  and explainJs != ''"> and explain_js = #{explainJs}</if>
            <if test="explainMp3 != null  and explainMp3 != ''"> and explain_mp3 = #{explainMp3}</if>
            <if test="image != null  and image != ''"> and image = #{image}</if>
            <if test="imageYdt != null  and imageYdt != ''"> and image_ydt = #{imageYdt}</if>
            <if test="issue != null  and issue != ''"> and issue = #{issue}</if>
            <if test="opts != null  and opts != ''"> and opts = #{opts}</if>
            <if test="skillkeyword != null  and skillkeyword != ''"> and skillkeyword = #{skillkeyword}</if>
            <if test="titlekeyword != null  and titlekeyword != ''"> and titlekeyword = #{titlekeyword}</if>
            <if test="issuemp3 != null  and issuemp3 != ''"> and issuemp3 = #{issuemp3}</if>
            <if test="answermp3 != null  and answermp3 != ''"> and answermp3 = #{answermp3}</if>
            <if test="explainjsmp3 != null  and explainjsmp3 != ''"> and explainjsmp3 = #{explainjsmp3}</if>
            <if test="subject1 != null  and subject1 != ''"> and subject_1 = #{subject1}</if>
            <if test="subject2 != null  and subject2 != ''"> and subject_2 = #{subject2}</if>
            <if test="subject3 != null  and subject3 != ''"> and subject_3 = #{subject3}</if>
            <if test="subject4 != null  and subject4 != ''"> and subject_4 = #{subject4}</if>
            <if test="liceCar != null  and liceCar != ''"> and lice_car = #{liceCar}</if>
            <if test="liceBus != null  and liceBus != ''"> and lice_bus = #{liceBus}</if>
            <if test="liceTruck != null  and liceTruck != ''"> and lice_truck = #{liceTruck}</if>
            <if test="liceMoto != null  and liceMoto != ''"> and lice_moto = #{liceMoto}</if>
            <if test="sequeIssue != null  and sequeIssue != ''"> and seque_issue = #{sequeIssue}</if>
            <if test="classIssue != null  and classIssue != ''"> and class_issue = #{classIssue}</if>
            <if test="placeIssue != null  and placeIssue != ''"> and place_issue = #{placeIssue}</if>
            <if test="excellIssue != null  and excellIssue != ''"> and excell_issue = #{excellIssue}</if>
            <if test="copyIssue != null  and copyIssue != ''"> and copy_issue = #{copyIssue}</if>
            <if test="mockIssue != null  and mockIssue != ''"> and mock_issue = #{mockIssue}</if>
            <if test="sequeIssueName != null  and sequeIssueName != ''"> and seque_issue_name like concat('%', #{sequeIssueName}, '%')</if>
            <if test="placeIssueName != null  and placeIssueName != ''"> and place_issue_name like concat('%', #{placeIssueName}, '%')</if>
            <if test="excellIssueName != null  and excellIssueName != ''"> and excell_issue_name like concat('%', #{excellIssueName}, '%')</if>
            <if test="classIssueName != null  and classIssueName != ''"> and class_issue_name like concat('%', #{classIssueName}, '%')</if>
        </where>
    </select>

</mapper>
