标签:查询 prope bat menu col from property tis rom
<!--mybatis递归查询-->
<resultMap id="recursionMenuMap" type="AgentMenu" extends="BaseResultMap">
<collection property="children" ofType="AgentMenu" column="{agentMenuId=agent_menu_id,agentId=agent_id}" select="findMenuByParentId"/>
</resultMap>
<select id="getAgentMenuByAgentId" resultMap="recursionMenuMap">
select * from agent_menu am inner join (select id,agent_id,agent_menu_id from agent_has_menu where agent_id=#{0}) ahm on am.agent_menu_id=ahm.agent_menu_id and closed=0
and super_id is NULL order by agent_menu_level
</select>
<select id="findMenuByParentId" resultMap="recursionMenuMap">
SELECT * FROM (select * from agent_menu WHERE super_id = #{agentMenuId}) am inner join (select agent_menu_id,agent_id from agent_has_menu where agent_id=#{agentId}) ahm on am.agent_menu_id=ahm.agent_menu_id and closed=0
</select>
标签:查询 prope bat menu col from property tis rom
原文地址:https://www.cnblogs.com/Superb1995/p/9930087.html