<?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.qmth.sop.business.mapper.TDFormWidgetMetadataMapper">

    <select id="getFormWidgetMetadataResult" resultType="com.qmth.sop.business.bean.result.FormWidgetMetadataResult">
        SELECT
            t.*,tdfw.`options`
        FROM
            t_d_form_widget_metadata t
            left join t_d_form_widget tdfw on tdfw.code =  t.code and CONCAT(tdfw.form_id,'_',t.setup) = t.field_id and tdfw.flow_type = t.type
        <where> 1 = 1
            <if test="type != null and type != ''">
                and t.type = #{type}
            </if>
            <if test="version != null and version != ''">
                and t.version = #{version}
            </if>
        </where>
        ORDER BY setup ASC
    </select>
</mapper>
