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>
<!--级联查询返回模型-->

 

上一篇:P2024 NOI2001 种类冰茶鸡


下一篇:matlab文件/文件夹操作