From bed3eee53f72f47f49b493772a4525e6c6b3e7be Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期三, 31 七月 2024 09:05:37 +0800
Subject: [PATCH] 修复bug
---
server/dmvisit_service/src/main/resources/mappers/SystemMenuMapper.xml | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 58 insertions(+), 0 deletions(-)
diff --git a/server/dmvisit_service/src/main/resources/mappers/SystemMenuMapper.xml b/server/dmvisit_service/src/main/resources/mappers/SystemMenuMapper.xml
new file mode 100644
index 0000000..0ec9ada
--- /dev/null
+++ b/server/dmvisit_service/src/main/resources/mappers/SystemMenuMapper.xml
@@ -0,0 +1,58 @@
+<?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.doumee.dao.system.SystemMenuMapper">
+
+ <!-- 鏌ヨ鑿滃崟鍒楄〃 -->
+ <resultMap id="SystemMenuListVO" type="com.doumee.dao.system.vo.SystemMenuListVO" autoMapping="true">
+ <id column="ID" property="id"/>
+ <association property="createUserInfo" javaType="com.doumee.dao.system.model.SystemUser">
+ <result column="CREATE_USER_ID" property="id"/>
+ <result column="CREATE_USER_NAME" property="username"/>
+ </association>
+ <association property="updateUserInfo" javaType="com.doumee.dao.system.model.SystemUser">
+ <result column="UPDATE_USER_ID" property="id"/>
+ <result column="UPDATE_USER_NAME" property="username"/>
+ </association>
+ </resultMap>
+ <select id="selectManageList" resultMap="SystemMenuListVO">
+ SELECT
+ menu.`ID`, menu.`PARENT_ID`, menu.`NAME`, menu.`PATH`, menu.`FIXED`, menu.`REMARK`, menu.`DISABLED`, menu.SORT, menu.`ICON`, menu.`CREATE_TIME`, menu.`UPDATE_TIME`, menu.`CREATE_USER`, menu.`UPDATE_USER`, menu.`DELETED`,
+ create_user.ID CREATE_USER_ID, create_user.`USERNAME` CREATE_USER_NAME,
+ update_user.ID UPDETE_USER_ID, update_user.`USERNAME` UPDATE_USER_NAME
+ FROM SYSTEM_MENU menu
+ LEFT JOIN `SYSTEM_USER` create_user ON create_user.ID = menu.CREATE_USER
+ LEFT JOIN `SYSTEM_USER` update_user ON update_user.ID = menu.UPDATE_USER
+ <where>
+ menu.DELETED = 0
+ </where>
+ ORDER BY menu.SORT
+ </select>
+
+ <!-- 鏌ヨ鑿滃崟鏍� -->
+ <select id="selectByUserId" parameterType="java.lang.Integer" resultType="com.doumee.dao.system.model.SystemMenu">
+ SELECT
+ DISTINCT menu.`ID`, menu.`PARENT_ID`, menu.`NAME`, menu.`PATH`, menu.`REMARK`, menu.`DISABLED`, menu.SORT, menu.`ICON`, menu.`CREATE_TIME`, menu.`UPDATE_TIME`, menu.`CREATE_USER`, menu.`UPDATE_USER`, menu.`DELETED`
+ FROM `SYSTEM_MENU` menu
+ INNER JOIN SYSTEM_ROLE_MENU role_menu ON role_menu.MENU_ID = menu.ID AND role_menu.DELETED = 0
+ INNER JOIN SYSTEM_USER_ROLE user_role ON user_role.ROLE_ID = role_menu.ROLE_ID AND user_role.DELETED = 0
+ <where>
+ AND menu.DELETED = 0
+ AND menu.DISABLED = 0
+ AND user_role.USER_ID = #{userId}
+ </where>
+ ORDER BY menu.SORT
+ </select>
+
+ <!-- 鏍规嵁瑙掕壊ID鏌ヨ鑿滃崟鍒楄〃 -->
+ <select id="selectByRoleId" parameterType="java.lang.Integer" resultType="com.doumee.dao.system.model.SystemMenu">
+ SELECT
+ menu.`ID`, menu.`PARENT_ID`, menu.`NAME`, menu.`PATH`, menu.`REMARK`, menu.`DISABLED`, menu.SORT, menu.`ICON`, menu.`CREATE_TIME`, menu.`UPDATE_TIME`, menu.`CREATE_USER`, menu.`UPDATE_USER`, menu.`DELETED`
+ FROM `SYSTEM_MENU` menu
+ INNER JOIN `SYSTEM_ROLE_MENU` role_menu ON role_menu.MENU_ID = menu.ID AND role_menu.DELETED = 0
+ <where>
+ menu.DELETED = 0
+ AND role_menu.ROLE_ID = #{roleId}
+ </where>
+ </select>
+
+</mapper>
--
Gitblit v1.9.3