<?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.yida.data.school.index.mapper.EduSchoolHomeMicroIndexMapper">
    <resultMap id="indexMap" type="com.yida.data.school.vo.index.SchoolIndexVO">
        <id column="id" property="id"/>
        <result column="descrip" property="descrip"/>
        <result column="address" property="address"/>
        <result column="mobile" property="mobile"/>
        <result column="email" property="email"/>
        <result column="wx_public" property="wxPublic"/>
        <result column="env_name" property="envName"/>
        <collection property="envList" ofType="com.yida.data.school.vo.index.ColPicVO">
            <result column="p_title" property="title"/>
            <result column="p_url" property="url"/>
            <result column="p_descrip" property="descrip"/>
        </collection>
    </resultMap>
    <select id="getInfo"
            resultMap="indexMap">
        select a.id,a.descrip,a.address,a.mobile,a.email,a.env_name,
        b.title p_title,b.descrip p_descrip,b.url p_url,a.wx_public
        from edu_school_home_micro_index a
        left join (select * from edu_school_home_micro_pic where del_flag=0) b on a.col_id=b.col_id
        where a.del_flag=0
        and a.col_id=#{colId}
        order by b.sort
    </select>
</mapper>