<?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.EduSchoolHomeMicroMapper">
    <resultMap id="baseMap" type="com.yida.data.common.core.entity.school.EduSchoolHomeMicro">
        <id property="id" column="id"/>
        <result property="name" column="name"/>
        <collection property="colList" ofType="com.yida.data.common.core.entity.school.EduSchoolHomeMicroCol">
            <id column="c_id" property="id"/>
            <result column="c_name" property="name"/>
            <result column="c_cover_url" property="coverUrl"/>
            <result column="c_sort" property="sort"/>
            <result column="c_is_show" property="isShow"/>
            <result column="c_function_id" property="yidaAppFunctionId"/>
            <result column="c_type" property="type"/>
        </collection>
    </resultMap>

    <select id="getInfo" resultMap="baseMap">
        select a.id,a.name,b.id c_id,b.name c_name,b.cover_url c_cover_url,b.sort c_sort,b.is_show
        c_is_show,b.yida_app_function_id c_function_id,b.type c_type
        from edu_school_home_micro a left join edu_school_home_micro_col b on a.school_id=b.school_id
        where a.del_flag=0 and b.del_flag=0 and a.school_id=#{schoolId}
    </select>
</mapper>
