|
@@ -0,0 +1,52 @@
|
|
|
+<?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.cbkj.platform.api.mapper.user.AdminMenuMapper">
|
|
|
+ <resultMap id="BaseResultMap" type="com.cbkj.platform.api.beans.user.AdminMenu">
|
|
|
+ <id column="menu_id" jdbcType="VARCHAR" property="menuId"/>
|
|
|
+ <result column="menu_name" jdbcType="VARCHAR" property="menuName"/>
|
|
|
+ <result column="menu_path" jdbcType="VARCHAR" property="menuPath"/>
|
|
|
+ <result column="menu_class" jdbcType="VARCHAR" property="menuClass"/>
|
|
|
+ <result column="parent_menu_id" jdbcType="VARCHAR" property="parentMenuId"/>
|
|
|
+ <result column="menu_type" jdbcType="VARCHAR" property="menuType"/>
|
|
|
+ <result column="btn_class" jdbcType="VARCHAR" property="btnClass"/>
|
|
|
+ <result column="btn_type" jdbcType="VARCHAR" property="btnType"/>
|
|
|
+ <result column="btn_weight" jdbcType="INTEGER" property="btnWeight"/>
|
|
|
+ <result column="open_type" jdbcType="INTEGER" property="openType"/>
|
|
|
+ <result column="modual_code" jdbcType="INTEGER" property="modualCode"/>
|
|
|
+ <result column="menu_level" jdbcType="INTEGER" property="menuLevel"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+
|
|
|
+ <select id="getMenuByUserId" parameterType="com.cbkj.platform.api.beans.user.AdminMenu" resultMap="BaseResultMap">
|
|
|
+ select m.menu_id, m.menu_type, m.menu_name, m.menu_path, m.parent_menu_id, m.open_type, m.menu_level
|
|
|
+ from sys_admin_menu m
|
|
|
+ join sys_admin_rule_menu rm on m.menu_id = rm.menu_id
|
|
|
+ join sys_admin_info_rule ur on rm.role_id = ur.role_id
|
|
|
+ where ur.user_id = #{userId}
|
|
|
+ and m.status = '1'
|
|
|
+ and m.modual_code = #{modualCode}
|
|
|
+ <if test="menuType != null and menuType != ''">
|
|
|
+ and menu_type in
|
|
|
+ <foreach collection="menuType.split(',')" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ group by m.menu_id
|
|
|
+ order by m.menu_level, m.sort
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+ <select id="getAllMenu" parameterType="com.cbkj.platform.api.beans.user.AdminMenu" resultMap="BaseResultMap">
|
|
|
+ select menu_id, menu_name, menu_path, menu_class, parent_menu_id
|
|
|
+ from sys_admin_menu
|
|
|
+ where status = '1'
|
|
|
+ and modual_code = #{modualCode}
|
|
|
+ <if test="menuType != null and menuType != ''">
|
|
|
+ and menu_type in
|
|
|
+ <foreach collection="menuType.split(',')" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ ORDER by sort
|
|
|
+ </select>
|
|
|
+</mapper>
|