| | |
| | | <?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.lxzn.ucenter.dao.MenuMapper"> |
| | | <select id="findByUserId" parameterType="String" resultType="Menu"> |
| | | <select id="findByUserId" parameterType="String" resultType="com.lxzn.framework.domain.ucenter.Menu"> |
| | | select m.menu_id |
| | | , m.perm_code |
| | | , m.menu_name |
| | |
| | | 3、多级关联语句是分开查询的 数据量大的情况下性能低下 |
| | | 4、如果确定级树 可以使用级联查询一次查询 例子: |
| | | --> |
| | | <resultMap id="menuExtBaseResult" type="MenuExt"> |
| | | <resultMap id="menuExtBaseResult" type="com.lxzn.framework.domain.ucenter.ext.MenuExt"> |
| | | <id column="menu_id" property="menuId" /> |
| | | <collection column="menu_id" property="childList" select="findByParentId"> |
| | | </collection> |
| | | </resultMap> |
| | | |
| | | <resultMap id="menuExtSingleSelectResult" type="MenuExt"> |
| | | <resultMap id="menuExtSingleSelectResult" type="com.lxzn.framework.domain.ucenter.ext.MenuExt"> |
| | | <id column="menu_id_one" property="menuId" /> |
| | | <result column="perm_code_one" property="permCode" /> |
| | | <result column="menu_name_one" property="menuName" /> |
| | |
| | | <result column="icon_cls_one" property="iconCls" /> |
| | | <result column="priority_one" property="priority" /> |
| | | <result column="rank_level_one" property="rankLevel" /> |
| | | <collection property="childList" ofType="MenuExt"> |
| | | <collection property="childList" ofType="com.lxzn.framework.domain.ucenter.ext.MenuExt"> |
| | | <id column="menu_id_two" property="menuId" /> |
| | | <result column="perm_code_two" property="permCode" /> |
| | | <result column="menu_name_two" property="menuName" /> |
| | |
| | | <result column="icon_cls_two" property="iconCls" /> |
| | | <result column="priority_two" property="priority" /> |
| | | <result column="rank_level_two" property="rankLevel" /> |
| | | <collection property="childList" ofType="MenuExt"> |
| | | <collection property="childList" ofType="com.lxzn.framework.domain.ucenter.ext.MenuExt"> |
| | | <id column="menu_id_three" property="menuId" /> |
| | | <result column="perm_code_three" property="permCode" /> |
| | | <result column="menu_name_three" property="menuName" /> |
| | |
| | | on cm.parent_id = bm.menu_id |
| | | where am.rank_level=1 and am.delete_flag=0 |
| | | </select> |
| | | </mapper> |
| | | </mapper> |