<?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.icon.mapper.IconQuestionMapper">

    <resultMap type="IconQuestion" id="IconQuestionResult">
        <result property="id"    column="id"    />
        <result property="iconId"    column="icon_id"    />
        <result property="ydtId"    column="ydt_id"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateTime"    column="update_time"    />
    </resultMap>

    <sql id="selectIconQuestionVo">
        select * from icon_question
    </sql>

    <select id="selectIconQuestionList" parameterType="IconQuestion" resultMap="IconQuestionResult">
        <include refid="selectIconQuestionVo"/>
        <where>
            <if test="iconId != null "> and icon_id = #{iconId}</if>
            <if test="ydtId != null "> and ydt_id = #{ydtId}</if>
        </where>
    </select>

    <select id="getImageUrl"  resultType="string">
       select hd_image_url from t_media t1 join t_question t2 on (t1.media_key=  t2.media_key) where t2.question_id =#{questionId}
    </select>

</mapper>
