<?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.willalp.yiqing.mapper.HsYiqingQuestionMapper">

    <resultMap type="com.willalp.yiqing.domain.HsYiqingQuestion" id="HsYiqingQuestionResult">
        <result property="queId" column="que_id"/>
        <result property="queGroupId" column="que_group_id"/>
        <result property="queTextOrPid" column="que_text_or_pid"/>
        <result property="queResultNo" column="que_result_no"/>
        <result property="queResultText" column="que_result_text"/>
        <result property="queLevel" column="que_level"/>
        <result property="enableOrDisable" column="enable_or_disable"/>
        <result property="isDelete" column="is_delete"/>
        <result property="createBy" column="create_by"/>
        <result property="createTime" column="create_time"/>
        <result property="updateBy" column="update_by"/>
        <result property="updateTime" column="update_time"/>
        <result property="remark" column="remark"/>
    </resultMap>

    <sql id="selectHsYiqingQuestionVo">
        select que_id,
               que_group_id,
               que_text_or_pid,
               que_result_no,
               que_result_text,
               que_level,
               enable_or_disable,
               is_delete,
               create_by,
               create_time,
               update_by,
               update_time,
               remark
        from hs_yiqing_question
    </sql>

    <select id="selectHsYiqingQuestionList" parameterType="HsYiqingQuestion" resultMap="HsYiqingQuestionResult">
        <include refid="selectHsYiqingQuestionVo"/>
        <where>
            is_delete = 0
            <if test="queGroupId != null  and queGroupId != ''">
                  and que_group_id = #{queGroupId}
            </if>
            <if test="queTextOrPid != null  and queTextOrPid != ''">
                  and que_text_or_pid = #{queTextOrPid}
            </if>
            <if test="queResultNo != null ">
                  and que_result_no = #{queResultNo}
            </if>
            <if test="queResultText != null  and queResultText != ''">
                  and que_result_text = #{queResultText}
            </if>
            <if test="queLevel != null ">
                  and que_level = #{queLevel}
            </if>
        </where>
    </select>
</mapper>
