其他分享
首页 > 其他分享> > mybatis 父子关系递归查询,父子菜单

mybatis 父子关系递归查询,父子菜单

作者:互联网

<!--级联查询返回模型-->
    <resultMap type="Map" id="fatherMap">
        <id column="id" property="id"/>
        <collection property="list" ofType="com.jmxf.entity.zdbwManage.ZdbwIndoor" column="id" select="findMenuByPid"/>
    </resultMap>
 
    <!--级联查询父菜单-->
    <select id="selectAllMenu" resultMap="fatherMap" >
         select * from zdbw_indoor where fip = '0'
    </select>
 
    <!--级联查询子菜单-->
    <select id="findMenuByPid" resultMap="fatherMap" >
         select * from zdbw_indoor where fid = #{id} 
    </select>
<!--级联查询返回模型-->

 

标签:fip,菜单,zdbw,indoor,父子关系,fid,mybatis,where,select
来源: https://www.cnblogs.com/MisMe/p/12362102.html