|
@@ -7,6 +7,7 @@
|
|
|
<resultMap type="SysMenu" id="SysMenuResult">
|
|
|
<id property="menuId" column="menu_id" />
|
|
|
<result property="menuName" column="menu_name" />
|
|
|
+ <result property="menuNameEn" column="menu_name_en" />
|
|
|
<result property="parentName" column="parent_name" />
|
|
|
<result property="parentId" column="parent_id" />
|
|
|
<result property="orderNum" column="order_num" />
|
|
@@ -29,7 +30,7 @@
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectMenuVo">
|
|
|
- select menu_id, menu_name, parent_id, order_num, path, component, `query`, is_frame, is_cache, menu_type, visible, status, ifnull(perms,'') as perms, icon, create_time
|
|
|
+ select menu_id, menu_name,menu_name_en, parent_id, order_num, path, component, `query`, is_frame, is_cache, menu_type, visible, status, ifnull(perms,'') as perms, icon, create_time
|
|
|
from sys_menu
|
|
|
</sql>
|
|
|
|
|
@@ -37,6 +38,7 @@
|
|
|
SELECT
|
|
|
m.menu_id,
|
|
|
m.menu_name,
|
|
|
+ m.menu_name_en,
|
|
|
m.parent_id,
|
|
|
m.order_num,
|
|
|
m.path,
|
|
@@ -60,6 +62,9 @@
|
|
|
<if test="menuName != null and menuName != ''">
|
|
|
AND m.menu_name like concat('%', #{menuName}, '%')
|
|
|
</if>
|
|
|
+ <if test="menuNameEn != null and menuNameEn != ''">
|
|
|
+ AND m.menu_name_en like concat('%', #{menuNameEn}, '%')
|
|
|
+ </if>
|
|
|
<if test="visible != null and visible != ''">
|
|
|
AND m.visible = #{visible}
|
|
|
</if>
|
|
@@ -73,7 +78,7 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="selectTenantMenuList" resultMap="SysMenuResult">
|
|
|
- select m.menu_id, menu_name, parent_id, order_num, path, component, `query`, is_frame, is_cache, menu_type, visible, status, ifnull(perms,'') as perms, icon, create_time, tm.`tenant_id`
|
|
|
+ select m.menu_id, menu_name,menu_name_en, parent_id, order_num, path, component, `query`, is_frame, is_cache, menu_type, visible, status, ifnull(perms,'') as perms, icon, create_time, tm.`tenant_id`
|
|
|
from sys_menu m
|
|
|
left join sys_tenant_menu tm on tm.menu_id = m.menu_id
|
|
|
where tm.tenant_id = #{tenantId}
|
|
@@ -82,6 +87,9 @@
|
|
|
<if test="menu.menuName != null and menu.menuName != ''">
|
|
|
AND m.menu_name like concat('%', #{menu.menuName}, '%')
|
|
|
</if>
|
|
|
+ <if test="menu.menuNameEn != null and menu.menuNameEn != ''">
|
|
|
+ AND m.menu_name_en like concat('%', #{menu.menuNameEn}, '%')
|
|
|
+ </if>
|
|
|
<if test="menu.status != null and menu.status != ''">
|
|
|
AND m.status = #{menu.status}
|
|
|
</if>
|
|
@@ -89,14 +97,14 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="selectMenuTreeAll" resultMap="SysMenuResult">
|
|
|
- select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
|
|
|
+ select distinct m.menu_id, m.parent_id, m.menu_name,m.menu_name_en, m.path, m.component, m.`query`, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
|
|
|
from sys_menu m where m.menu_type in ('M', 'C') and m.status = 0
|
|
|
and m.menu_id not in (select DISTINCT menu_id from sys_tenant_menu)
|
|
|
order by m.parent_id, m.order_num
|
|
|
</select>
|
|
|
|
|
|
<select id="selectTenantMenuTreeAll" parameterType="Long" resultMap="SysMenuResult">
|
|
|
- select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
|
|
|
+ select distinct m.menu_id, m.parent_id, m.menu_name,m.menu_name_en, m.path, m.component, m.`query`, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
|
|
|
from sys_tenant_menu tm
|
|
|
left join sys_menu m on tm.menu_id = m.menu_id
|
|
|
where m.menu_type in ('M', 'C') and m.status = 0 and tm.tenant_id = #{tenantId}
|
|
@@ -106,7 +114,7 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="selectMenuListByUserId" parameterType="SysMenu" resultMap="SysMenuResult">
|
|
|
- select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time,t.tenant_name
|
|
|
+ select distinct m.menu_id, m.parent_id, m.menu_name,m.menu_name_en, m.path, m.component, m.`query`, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time,t.tenant_name
|
|
|
from sys_menu m
|
|
|
left join sys_role_menu rm on m.menu_id = rm.menu_id
|
|
|
left join sys_user_role ur on rm.role_id = ur.role_id
|
|
@@ -130,7 +138,7 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="selectMenuTreeByUserId" parameterType="Long" resultMap="SysMenuResult">
|
|
|
- select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
|
|
|
+ select distinct m.menu_id, m.parent_id, m.menu_name,m.menu_name_en, m.path, m.component, m.`query`, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
|
|
|
from sys_menu m
|
|
|
left join sys_role_menu rm on m.menu_id = rm.menu_id
|
|
|
left join sys_user_role ur on rm.role_id = ur.role_id
|
|
@@ -195,6 +203,7 @@
|
|
|
<select id="checkMenuNameUnique" parameterType="SysMenu" resultMap="SysMenuResult">
|
|
|
SELECT sys.menu_id,
|
|
|
sys.menu_name,
|
|
|
+ sys.menu_name_en,
|
|
|
sys.parent_id,
|
|
|
sys.order_num,
|
|
|
sys.path,
|
|
@@ -217,11 +226,48 @@
|
|
|
</if>
|
|
|
LIMIT 1
|
|
|
</select>
|
|
|
+ <select id="checkMenuNameUniqueMuti" parameterType="SysMenu" resultMap="SysMenuResult">
|
|
|
+ SELECT sys.menu_id,
|
|
|
+ sys.menu_name,
|
|
|
+ sys.menu_name_en,
|
|
|
+ sys.parent_id,
|
|
|
+ sys.order_num,
|
|
|
+ sys.path,
|
|
|
+ sys.component,
|
|
|
+ sys.`query`,
|
|
|
+ sys.is_frame,
|
|
|
+ sys.is_cache,
|
|
|
+ sys.menu_type,
|
|
|
+ sys.visible,
|
|
|
+ sys.STATUS,
|
|
|
+ ifnull(sys.perms, '') AS perms,
|
|
|
+ sys.icon,
|
|
|
+ sys.create_time
|
|
|
+ FROM sys_menu AS sys
|
|
|
+ LEFT JOIN sys_tenant_menu AS tenant ON sys.menu_id = tenant.menu_id
|
|
|
+ WHERE sys.parent_id = #{parentId} and sys.menu_id != #{menuId}
|
|
|
+ <if test="tenantId != null and tenantId != ''">
|
|
|
+ AND tenant.tenant_id = #{tenantId}
|
|
|
+ </if>
|
|
|
+ AND (
|
|
|
+ <if test="menuName != null and menuName != ''">
|
|
|
+ sys.menu_name = #{menuName}
|
|
|
+ </if>
|
|
|
+ <if test="menuNameEn != null and menuNameEn != '' and menuName != null and menuName != ''">
|
|
|
+ or
|
|
|
+ </if>
|
|
|
+ <if test="menuNameEn != null and menuNameEn != ''">
|
|
|
+ sys.menu_name_en = #{menuNameEn}
|
|
|
+ </if>
|
|
|
+ )
|
|
|
+ LIMIT 1
|
|
|
+ </select>
|
|
|
|
|
|
<update id="updateMenu" parameterType="SysMenu">
|
|
|
update sys_menu
|
|
|
<set>
|
|
|
<if test="menuName != null and menuName != ''">menu_name = #{menuName},</if>
|
|
|
+ <if test="menuNameEn != null and menuNameEn != ''">menu_name_en = #{menuNameEn},</if>
|
|
|
<if test="parentId != null">parent_id = #{parentId},</if>
|
|
|
<if test="orderNum != null">order_num = #{orderNum},</if>
|
|
|
<if test="path != null and path != ''">path = #{path},</if>
|
|
@@ -246,6 +292,7 @@
|
|
|
<if test="menuId != null and menuId != 0">menu_id,</if>
|
|
|
<if test="parentId != null and parentId != 0">parent_id,</if>
|
|
|
<if test="menuName != null and menuName != ''">menu_name,</if>
|
|
|
+ <if test="menuNameEn != null and menuNameEn != ''">menu_name_en,</if>
|
|
|
<if test="orderNum != null">order_num,</if>
|
|
|
<if test="path != null and path != ''">path,</if>
|
|
|
<if test="component != null and component != ''">component,</if>
|
|
@@ -264,6 +311,7 @@
|
|
|
<if test="menuId != null and menuId != 0">#{menuId},</if>
|
|
|
<if test="parentId != null and parentId != 0">#{parentId},</if>
|
|
|
<if test="menuName != null and menuName != ''">#{menuName},</if>
|
|
|
+ <if test="menuNameEn != null and menuNameEn != ''">#{menuNameEn},</if>
|
|
|
<if test="orderNum != null">#{orderNum},</if>
|
|
|
<if test="path != null and path != ''">#{path},</if>
|
|
|
<if test="component != null and component != ''">#{component},</if>
|
|
@@ -296,6 +344,7 @@
|
|
|
SELECT
|
|
|
m.menu_id,
|
|
|
m.menu_name,
|
|
|
+ m.menu_name_en,
|
|
|
m.parent_id,
|
|
|
m.order_num,
|
|
|
m.path,
|