<?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.rongwei.bscommon.sys.dao.ExportSqlDao">
    <resultMap id="BaseResultMap" type="com.rongwei.bsentity.vo.Export8DRelevantDataVo"
               extends="com.rongwei.bscommon.sys.dao.SrmEightDListDao.BaseResultMap">
        <collection property="srmEightDAnalysislistDoList" ofType="com.rongwei.bsentity.domin.SrmEightDAnalysislistDo"
                    javaType="java.util.ArrayList"
                    resultMap="com.rongwei.bscommon.sys.dao.SrmEightDAnalysislistDao.BaseResultMap" columnPrefix="da_">

        </collection>
        <collection property="srmEightDCauselistDos" ofType="com.rongwei.bsentity.domin.SrmEightDCauselistDo"
                    javaType="java.util.ArrayList"
                    resultMap="com.rongwei.bscommon.sys.dao.SrmEightDCauselistDao.BaseResultMap" columnPrefix="dc_">

        </collection>
        <collection property="srmEightDPlanlistDos" ofType="com.rongwei.bsentity.domin.SrmEightDPlanlistDo"
                    javaType="java.util.ArrayList"
                    resultMap="com.rongwei.bscommon.sys.dao.SrmEightDPlanlistDao.BaseResultMap" columnPrefix="dp_">

        </collection>
    </resultMap>


    <select id="getExport8dRelevantData" resultMap="BaseResultMap">
        select
        <include refid="com.rongwei.bscommon.sys.dao.SrmEightDListDao.Base_Column_List">
            <property name="alias" value="t."/>
            <property name="prefix" value=""/>
        </include>
        ,
        <include refid="com.rongwei.bscommon.sys.dao.SrmEightDAnalysislistDao.Base_Column_List">
            <property name="alias" value="da."/>
            <property name="prefix" value="da_"/>
        </include>
        ,
        <include refid="com.rongwei.bscommon.sys.dao.SrmEightDCauselistDao.Base_Column_List">
            <property name="alias" value="dc."/>
            <property name="prefix" value="dc_"/>
        </include>
        ,
        <include refid="com.rongwei.bscommon.sys.dao.SrmEightDPlanlistDao.Base_Column_List">
            <property name="alias" value="dp."/>
            <property name="prefix" value="dp_"/>
        </include>
        from srm_eight_d_list t
        left join srm_eight_d_analysislist da on t.ID = da.edlistid and da.DELETED='0'
        left join srm_eight_d_causelist dc on t.ID = dc.edlistid and dc.DELETED='0'
        left join srm_eight_d_planlist dp on t.ID = dp.edlistid and dp.DELETED='0'
        <where>
            t.ID in
            <foreach collection="ids" item="id" open="(" close=")" separator=",">
                #{id,jdbcType=VARCHAR}
            </foreach>
            AND t.DELETED ='0'
        </where>
    </select>
    <select id="getMindMappingUrl" resultType="java.lang.String">
        select smm.MINDIMG from q_question_mind_mapping qqmm
        LEFT JOIN sys_mind_mapping smm on qqmm.ID =smm.BSID and smm.DELETED='0'
        <where>
            qqmm.DELETED ='0'
            AND qqmm.QID =#{qId}
        </where>
    </select>
</mapper>
