|
@@ -65,6 +65,22 @@
|
|
|
and a.status=1
|
|
|
</select>
|
|
|
|
|
|
+ <!-- 根据主键获取租户菜单 -->
|
|
|
+ <select id="findTenantMenuByParentIds" resultType="com.huaxu.entity.MenuEntity">
|
|
|
+ select a.id
|
|
|
+ from uims_tenant_menu a
|
|
|
+ inner JOIN uims_menu b on a.menu_id=b.id
|
|
|
+ inner join uims_menu c on b.id =c.PARENT_MENU_ID and c.status=1
|
|
|
+ inner join uims_tenant_menu d on d.menu_id=c.id and d.status=1
|
|
|
+ <if test="tenantId != null and tenantId != ''">
|
|
|
+ and d.TENANT_ID=#{tenantId}
|
|
|
+ </if>
|
|
|
+ WHERE a.id in
|
|
|
+ <foreach collection = "Ids" item = "dramaId" open = "(" close = ")" separator = "," >
|
|
|
+ #{dramaId}
|
|
|
+ </foreach>
|
|
|
+ </select>
|
|
|
+
|
|
|
<!-- 根据获取实体List -->
|
|
|
<select id="findList" resultType="com.huaxu.entity.MenuEntity">
|
|
|
SELECT
|
|
@@ -82,27 +98,258 @@
|
|
|
order by a.seq
|
|
|
</select>
|
|
|
<!-- 根据获取实体List -->
|
|
|
- <select id="findUserFirstMenu" resultType="com.huaxu.entity.MenuEntity">
|
|
|
+ <select id="findTenantList" resultType="com.huaxu.entity.MenuEntity">
|
|
|
+ select
|
|
|
+ b.id as "id" ,
|
|
|
+ b.app_id as "appId" ,
|
|
|
+ b.third_menu_id as "thirdMenuId" ,
|
|
|
+ b.parent_menu_id as "parentMenuId" ,
|
|
|
+ a.id as "tenantMenuId",
|
|
|
+ a.MENU_NAME as "name" ,
|
|
|
+ a.menu_image as "menuImage" ,
|
|
|
+ b.permission_flag as "permissionFlag" ,
|
|
|
+ a.link_path as "linkPath" ,
|
|
|
+ a.MENU_SEQ as "seq" ,
|
|
|
+ b.show_state as "showState" ,
|
|
|
+ a.remark as "remark" ,
|
|
|
+ b.is_tenant as "isTenant" ,
|
|
|
+ b.is_admin as "isAdmin" ,
|
|
|
+ a.date_create as "dateCreate" ,
|
|
|
+ a.create_by as "createBy" ,
|
|
|
+ a.date_update as "dateUpdate" ,
|
|
|
+ a.update_by as "updateBy" ,
|
|
|
+ a.status as "status"
|
|
|
+ from uims_tenant_menu a
|
|
|
+ inner join uims_menu b on a.MENU_ID=b.id and b.STATUS=1
|
|
|
+ <where>
|
|
|
+ a.status=1
|
|
|
+ <if test="name != null and name != ''">
|
|
|
+ and a.MENU_NAME LIKE concat('%',#{name},'%')
|
|
|
+ </if>
|
|
|
+ <if test="tenantId != null and tenantId != ''">
|
|
|
+ and a.tenant_id = #{tenantId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ order by a.MENU_SEQ
|
|
|
+ </select>
|
|
|
+ <!-- 根据获取实体List -->
|
|
|
+ <select id="findUserMenuById" resultType="com.huaxu.entity.MenuEntity">
|
|
|
+ select
|
|
|
+ a.id as "id" ,
|
|
|
+ b.app_id as "appId" ,
|
|
|
+ b.third_menu_id as "thirdMenuId" ,
|
|
|
+ b.parent_menu_id as "parentMenuId" ,
|
|
|
+ a.id as "tenantMenuId",
|
|
|
+ a.MENU_NAME as "name" ,
|
|
|
+ a.menu_image as "menuImage" ,
|
|
|
+ b.permission_flag as "permissionFlag" ,
|
|
|
+ a.link_path as "linkPath" ,
|
|
|
+ a.MENU_SEQ as "seq" ,
|
|
|
+ b.show_state as "showState" ,
|
|
|
+ a.remark as "remark" ,
|
|
|
+ b.is_tenant as "isTenant" ,
|
|
|
+ b.is_admin as "isAdmin" ,
|
|
|
+ a.date_create as "dateCreate" ,
|
|
|
+ a.create_by as "createBy" ,
|
|
|
+ a.date_update as "dateUpdate" ,
|
|
|
+ a.update_by as "updateBy" ,
|
|
|
+ a.status as "status"
|
|
|
+ from uims_tenant_menu a
|
|
|
+ inner join uims_menu b on a.MENU_ID=b.id and b.STATUS=1
|
|
|
+ <where>
|
|
|
+ a.status=1 and b.id = #{id}
|
|
|
+ <if test="tenantId != null and tenantId != ''">
|
|
|
+ and a.tenant_id = #{tenantId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+ <!-- 根据获取实体List -->
|
|
|
+ <select id="findUserList" resultType="com.huaxu.entity.MenuEntity">
|
|
|
+ select
|
|
|
+ b.id as "id" ,
|
|
|
+ b.app_id as "appId" ,
|
|
|
+ b.third_menu_id as "thirdMenuId" ,
|
|
|
+ b.parent_menu_id as "parentMenuId" ,
|
|
|
+ a.id as "tenantMenuId",
|
|
|
+ a.MENU_NAME as "name" ,
|
|
|
+ a.menu_image as "menuImage" ,
|
|
|
+ b.permission_flag as "permissionFlag" ,
|
|
|
+ a.link_path as "linkPath" ,
|
|
|
+ a.MENU_SEQ as "seq" ,
|
|
|
+ b.show_state as "showState" ,
|
|
|
+ a.remark as "remark" ,
|
|
|
+ b.is_tenant as "isTenant" ,
|
|
|
+ b.is_admin as "isAdmin" ,
|
|
|
+ a.date_create as "dateCreate" ,
|
|
|
+ a.create_by as "createBy" ,
|
|
|
+ a.date_update as "dateUpdate" ,
|
|
|
+ a.update_by as "updateBy" ,
|
|
|
+ a.status as "status"
|
|
|
+ from uims_user_role userrole
|
|
|
+ inner join uims_role_menu rolemenu on rolemenu.ROLE_ID=userrole.ROLE_ID and rolemenu.status=1
|
|
|
+ inner join uims_menu b on rolemenu.MENU_ID=b.id and b.STATUS=1
|
|
|
+ inner join uims_tenant_menu a on a.MENU_ID= b.id and a.status=1
|
|
|
+ <if test="tenantId != null and tenantId != ''">
|
|
|
+ and a.tenant_id = #{tenantId}
|
|
|
+ </if>
|
|
|
+ <where>
|
|
|
+ a.status=1 and userrole.status=1
|
|
|
+ <if test="name != null and name != ''">
|
|
|
+ and a.MENU_NAME LIKE concat('%',#{name},'%')
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ order by a.MENU_SEQ
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 超级管理员查询 一级菜单List -->
|
|
|
+ <select id="findAllFirstMenu" resultType="com.huaxu.entity.MenuEntity">
|
|
|
SELECT
|
|
|
<include refid="menuColumns"/>
|
|
|
+ FROM uims_menu a
|
|
|
+ <where>
|
|
|
+ a.status=1 and a.PARENT_MENU_ID=0 and a.SHOW_STATE=1
|
|
|
+ </where>
|
|
|
+ order by a.seq
|
|
|
+ </select>
|
|
|
+ <!-- 租户管理员查询租户菜单 -->
|
|
|
+ <select id="findTenantByMenuId" resultType="com.huaxu.entity.MenuEntity">
|
|
|
+ select b.id
|
|
|
+ from uims_tenant_menu b
|
|
|
+ <where>
|
|
|
+ b.status=1 and b.MENU_ID= #{id}
|
|
|
+ <if test="tenantId != null and tenantId != ''">
|
|
|
+ and b.tenant_id = #{tenantId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ limit 1
|
|
|
+ </select>
|
|
|
+ <!-- 租户管理员查询租户菜单 -->
|
|
|
+ <select id="findTenantFirstMenu" resultType="com.huaxu.entity.MenuEntity">
|
|
|
+ select
|
|
|
+ a.id as "id" ,
|
|
|
+ a.parent_menu_id as "parentMenuId" ,
|
|
|
+ b.MENU_NAME as "name" ,
|
|
|
+ b.MENU_IMAGE as "menuImage" ,
|
|
|
+ a.permission_flag as "permissionFlag" ,
|
|
|
+ b.LINK_PATH as "linkPath" ,
|
|
|
+ b.MENU_SEQ as "seq" ,
|
|
|
+ a.show_state as "showState" ,
|
|
|
+ b.remark as "remark" ,
|
|
|
+ b.date_create as "dateCreate" ,
|
|
|
+ b.create_by as "createBy" ,
|
|
|
+ b.date_update as "dateUpdate" ,
|
|
|
+ b.update_by as "updateBy" ,
|
|
|
+ b.status as "status"
|
|
|
+ from uims_tenant_menu b
|
|
|
+ inner join uims_menu a on a.id= b.MENU_ID and a.status=1
|
|
|
+ <where>
|
|
|
+ b.status=1 and a.PARENT_MENU_ID=0 and a.show_state=1
|
|
|
+ <if test="tenantId != null and tenantId != ''">
|
|
|
+ and b.tenant_id = #{tenantId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ order by b.MENU_SEQ
|
|
|
+ </select>
|
|
|
+ <!-- 普通用户查询租户菜单 -->
|
|
|
+ <select id="findUserFirstMenu" resultType="com.huaxu.entity.MenuEntity">
|
|
|
+ SELECT
|
|
|
+ a.id as "id" ,
|
|
|
+ a.parent_menu_id as "parentMenuId" ,
|
|
|
+ b.MENU_NAME as "name" ,
|
|
|
+ b.MENU_IMAGE as "menuImage" ,
|
|
|
+ a.permission_flag as "permissionFlag" ,
|
|
|
+ b.LINK_PATH as "linkPath" ,
|
|
|
+ b.MENU_SEQ as "seq" ,
|
|
|
+ a.show_state as "showState" ,
|
|
|
+ b.remark as "remark" ,
|
|
|
+ b.date_create as "dateCreate" ,
|
|
|
+ b.create_by as "createBy" ,
|
|
|
+ b.date_update as "dateUpdate" ,
|
|
|
+ b.update_by as "updateBy" ,
|
|
|
+ b.status as "status"
|
|
|
from uims_user_role userrole
|
|
|
inner join uims_role_menu rolemenu on rolemenu.ROLE_ID=userrole.ROLE_ID and rolemenu.status=1
|
|
|
- inner join uims_menu a on a.id= rolemenu.MENU_ID and a.status=1
|
|
|
+ inner join uims_menu a on a.id=rolemenu.MENU_ID and a.STATUS=1
|
|
|
+ inner join uims_tenant_menu b on a.id= b.MENU_ID and b.status=1
|
|
|
+ <if test="tenantId != null and tenantId != ''">
|
|
|
+ and b.tenant_id = #{tenantId}
|
|
|
+ </if>
|
|
|
<where>
|
|
|
userrole.status=1 and a.PARENT_MENU_ID=0 and a.SHOW_STATE=1
|
|
|
<if test="userId != null and userId != ''">
|
|
|
and userrole.user_id = #{userId}
|
|
|
</if>
|
|
|
+
|
|
|
+ </where>
|
|
|
+ order by b.MENU_SEQ
|
|
|
+ </select>
|
|
|
+ <!-- 超级管理员获取左侧菜单 -->
|
|
|
+ <select id="findSystemUserMenu" resultType="com.huaxu.entity.MenuEntity">
|
|
|
+ SELECT
|
|
|
+ <include refid="menuColumns"/>
|
|
|
+ FROM uims_menu a
|
|
|
+ <where>
|
|
|
+ a.status=1 and a.SHOW_STATE=1
|
|
|
+ <if test="appId != null and appId != ''">
|
|
|
+ and a.app_id = #{appId}
|
|
|
+ </if>
|
|
|
</where>
|
|
|
order by a.seq
|
|
|
</select>
|
|
|
- <!-- 根据获取实体List -->
|
|
|
+ <!-- 租户管理员获取左侧菜单 -->
|
|
|
+ <select id="findTenantUserMenu" resultType="com.huaxu.entity.MenuEntity">
|
|
|
+ select
|
|
|
+ a.id as "id" ,
|
|
|
+ a.parent_menu_id as "parentMenuId" ,
|
|
|
+ b.MENU_NAME as "name" ,
|
|
|
+ b.MENU_IMAGE as "menuImage" ,
|
|
|
+ a.permission_flag as "permissionFlag" ,
|
|
|
+ b.LINK_PATH as "linkPath" ,
|
|
|
+ b.MENU_SEQ as "seq" ,
|
|
|
+ a.show_state as "showState" ,
|
|
|
+ b.remark as "remark" ,
|
|
|
+ b.date_create as "dateCreate" ,
|
|
|
+ b.create_by as "createBy" ,
|
|
|
+ b.date_update as "dateUpdate" ,
|
|
|
+ b.update_by as "updateBy" ,
|
|
|
+ b.status as "status"
|
|
|
+ from uims_tenant_menu b
|
|
|
+ inner join uims_menu a on a.id= b.MENU_ID and a.status=1
|
|
|
+ <where>
|
|
|
+ b.status=1 and a.SHOW_STATE=1
|
|
|
+ <if test="appId != null and appId != ''">
|
|
|
+ and a.app_id = #{appId}
|
|
|
+ </if>
|
|
|
+ <if test="tenantId != null and tenantId != ''">
|
|
|
+ and b.tenant_id = #{tenantId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ order by b.MENU_SEQ
|
|
|
+ </select>
|
|
|
+ <!-- 普通用户获取实体List -->
|
|
|
<select id="findUserMenu" resultType="com.huaxu.entity.MenuEntity">
|
|
|
SELECT
|
|
|
- <include refid="menuColumns"/>
|
|
|
+ a.id as "id" ,
|
|
|
+ a.parent_menu_id as "parentMenuId" ,
|
|
|
+ b.MENU_NAME as "name" ,
|
|
|
+ b.MENU_IMAGE as "menuImage" ,
|
|
|
+ a.permission_flag as "permissionFlag" ,
|
|
|
+ b.LINK_PATH as "linkPath" ,
|
|
|
+ b.MENU_SEQ as "seq" ,
|
|
|
+ a.show_state as "showState" ,
|
|
|
+ b.remark as "remark" ,
|
|
|
+ b.date_create as "dateCreate" ,
|
|
|
+ b.create_by as "createBy" ,
|
|
|
+ b.date_update as "dateUpdate" ,
|
|
|
+ b.update_by as "updateBy" ,
|
|
|
+ b.status as "status"
|
|
|
from uims_user_role userrole
|
|
|
inner join uims_role_menu rolemenu on rolemenu.ROLE_ID=userrole.ROLE_ID and rolemenu.status=1
|
|
|
- inner join uims_menu a on a.id= rolemenu.MENU_ID and a.status=1
|
|
|
+ inner join uims_menu a on a.id=rolemenu.MENU_ID and a.STATUS=1
|
|
|
+ inner join uims_tenant_menu b on a.id= b.MENU_ID and b.status=1
|
|
|
+ <if test="tenantId != null and tenantId != ''">
|
|
|
+ and b.tenant_id = #{tenantId}
|
|
|
+ </if>
|
|
|
<where>
|
|
|
userrole.status=1 and a.SHOW_STATE=1
|
|
|
<if test="userId != null and userId != ''">
|
|
@@ -111,10 +358,10 @@
|
|
|
<if test="appId != null and appId != ''">
|
|
|
and a.app_id = #{appId}
|
|
|
</if>
|
|
|
+
|
|
|
</where>
|
|
|
- order by a.seq
|
|
|
+ order by b.MENU_SEQ
|
|
|
</select>
|
|
|
-
|
|
|
<!-- 根据获取实体 page -->
|
|
|
<select id="findPage" resultType="com.huaxu.entity.MenuEntity">
|
|
|
SELECT
|
|
@@ -127,4 +374,7 @@
|
|
|
</if>
|
|
|
</where>
|
|
|
</select>
|
|
|
+ <update id="updateState">
|
|
|
+ update uims_tenant_menu set status=0 where id=#{Id}
|
|
|
+ </update>
|
|
|
</mapper>
|