Selaa lähdekoodia

权限菜单接口

guowei 2 vuotta sitten
vanhempi
commit
1d15ff722d

BIN
src/main/java/com/cbkj/platform/api/beans/user/AdminMenu.java


BIN
src/main/java/com/cbkj/platform/api/beans/user/AdminRule.java


BIN
src/main/java/com/cbkj/platform/api/config/utils/Constant.java


BIN
src/main/java/com/cbkj/platform/api/controller/user/AdminMenuController.java


BIN
src/main/java/com/cbkj/platform/api/mapper/user/AdminMenuMapper.java


BIN
src/main/java/com/cbkj/platform/api/beans/user/AdminInfoRule.java → src/main/java/com/cbkj/platform/api/mapper/user/AdminRuleMapper.java


BIN
src/main/java/com/cbkj/platform/api/service/dic/DicDataService.java


BIN
src/main/java/com/cbkj/platform/api/service/param/SysParamService.java


BIN
src/main/java/com/cbkj/platform/api/service/user/AdminMenuService.java


+ 52 - 0
src/main/resources/mappers/user/AdminMenuMapper.xml

@@ -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>

+ 19 - 0
src/main/resources/mappers/user/AdminRuleMapper.xml

@@ -0,0 +1,19 @@
+<?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.AdminRuleMapper">
+    <resultMap id="BaseResultMap" type="com.cbkj.platform.api.beans.user.AdminRule">
+        <id column="role_id" jdbcType="VARCHAR" property="roleId"/>
+        <result column="role_name" jdbcType="VARCHAR" property="roleName"/>
+        <result column="role_desc" jdbcType="VARCHAR" property="roleDesc"/>
+        <result column="rname_zh" jdbcType="VARCHAR" property="rnameZh"/>
+        <result column="index_url" jdbcType="VARCHAR" property="indexUrl"/>
+        <result column="obj_id" jdbcType="VARCHAR" property="objId"/>
+    </resultMap>
+
+    <select id="getRuleRelesCount" parameterType="String" resultType="Long">
+        select count(1) cun
+        from sys_admin_info_rule
+        where role_id = #{ids}
+    </select>
+
+</mapper>