123456789101112131415161718192021222324252627282930 |
- <?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.diagbot.mapper.MenuMapper">
- <!-- 通用查询映射结果 -->
- <resultMap id="BaseResultMap" type="com.diagbot.entity.wrapper.MenuWrapper">
- <id column="id" property="id"/>
- <result column="is_deleted" property="isDeleted"/>
- <result column="gmt_create" property="gmtCreate"/>
- <result column="gmt_modified" property="gmtModified"/>
- <result column="creator" property="creator"/>
- <result column="name" property="name"/>
- <result column="parent_id" property="parentId"/>
- <result column="code" property="code"/>
- <result column="order_no" property="orderNo"/>
- <result column="remark" property="remark"/>
- </resultMap>
- <select id="getByRole" resultMap="BaseResultMap">
- select distinct a.* from sys_menu a, sys_role_menu b, sys_user_role c
- where a.id = b.menu_id and b.role_id and b.role_id = c.role_id and c.user_id = #{userId}
- and a.is_deleted = 'N' and b.is_deleted = 'N' and c.is_deleted = 'N'
- ORDER BY a.parent_id , a.order_no
- </select>
- <select id="getSubMenuById" resultMap="BaseResultMap">
- select a.* from sys_menu a where a.is_deleted = 'N' and parent_id = #{id} ORDER BY order_no
- </select>
- </mapper>
|