關聯查詢之map的延伸用法,map延伸用法

來源:互聯網
上載者:User

關聯查詢之map的延伸用法,map延伸用法

<select id="front.sort.selectListall" parameterType="myshop.services.front.sort.bean.sort" resultMap="sortResultMap">    select one.*,tw.id sid,tw.catlevel slevel,tw.name sname,tw.code scode,thr.id    tid,thr.catlevel tlevel,thr.name as tname, thr.code as tcode     from tb_sort    one join tb_sort tw on tw.pid=one.id join tb_sort thr on thr.pid=tw.id    order by one.order1,tw.order1,thr.order1</select><resultMap id="sortResultMap" type="myshop.services.front.sort.bean.Sort">    <id property="id" column="id" />    <result property="catlevel" column="catlevel" />    <result property="code" column="code" />    <result property="name" column="name" />    <collection property="children" ofType="myshop.services.front.sort.bean.Sort">        <id property="id" column="sid" />        <id property="catlevel" column="slevel" />        <id property="code" column="scode" />        <id property="name" column="sname" />        <collection property="children" ofType="myshop.services.front.sort.bean.Sort">            <id property="id" column="tid" />            <id property="catlevel" column="tlevel" />            <id property="name" column="tname" />            <id property="code" column="tcode" />        </collection>    </collection></resultMap>


實體類接收資料:

private List<Sort> children;


相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.