改为sys_role and sys_user_role

This commit is contained in:
sxu 2025-03-06 19:16:17 +08:00
parent 84936608f7
commit d71c8b3b2d
1 changed files with 33 additions and 28 deletions

View File

@ -237,8 +237,13 @@
left join alloc_stall a on mr.stall_id = a.stall_id
left join mkt_effective me on mr.eff_id = me.eff_id
left join alloc_area aa on ac.area_id = aa.area_id
LEFT JOIN sys_role sr ON aa.area_id = sr.area_id
LEFT JOIN sys_user_role sur ON sr.role_id = sur.role_id
where
mr.del_flag = #{delFlag}
AND sr.del_flag = 0
AND sr.role_key = #{authPO.roleCode}
AND sur.user_id = #{authPO.userId}
<if test="content.recipeId != null ">
and mr.recipe_id = #{content.recipeId}
</if>
@ -281,34 +286,34 @@
<if test="content.recipeType != null">
and mr.recipe_type = #{content.recipeType}
</if>
<if test="'3'.toString() == authPO.roleType.toString()">
and exists(
select
null
from mgr_role_canteen it1
left join mgr_role it2 on it2.role_id = it1.role_id
left join mgr_user_role it3 on it1.role_id = it3.role_id
where
it2.del_flag = 2
and it2.role_code = #{authPO.roleCode}
and it1.half_select = 1
and it3.user_id = #{authPO.userId}
and mr.stall_id = it1.data_id
)
</if>
<if test="'-1'.toString() != authPO.roleType.toString() ">
and EXISTS (
SELECT null
FROM mgr_role_area it1
LEFT JOIN mgr_role it2 ON it2.role_id = it1.role_id
LEFT JOIN mgr_user_role it3 ON it1.role_id = it3.role_id
WHERE it2.del_flag = 2
AND it2.role_code = #{authPO.roleCode}
AND it1.half_select = 1
AND it3.user_id = #{authPO.userId}
AND aa.area_id = it1.data_id
)
</if>
<!-- <if test="'3'.toString() == authPO.roleType.toString()">-->
<!-- and exists(-->
<!-- select-->
<!-- null-->
<!-- from mgr_role_canteen it1-->
<!-- left join mgr_role it2 on it2.role_id = it1.role_id-->
<!-- left join mgr_user_role it3 on it1.role_id = it3.role_id-->
<!-- where-->
<!-- it2.del_flag = 2-->
<!-- and it2.role_code = #{authPO.roleCode}-->
<!-- and it1.half_select = 1-->
<!-- and it3.user_id = #{authPO.userId}-->
<!-- and mr.stall_id = it1.data_id-->
<!-- )-->
<!-- </if>-->
<!-- <if test="'-1'.toString() != authPO.roleType.toString() ">-->
<!-- and EXISTS (-->
<!-- SELECT null-->
<!-- FROM mgr_role_area it1-->
<!-- LEFT JOIN mgr_role it2 ON it2.role_id = it1.role_id-->
<!-- LEFT JOIN mgr_user_role it3 ON it1.role_id = it3.role_id-->
<!-- WHERE it2.del_flag = 2-->
<!-- AND it2.role_code = #{authPO.roleCode}-->
<!-- AND it1.half_select = 1-->
<!-- AND it3.user_id = #{authPO.userId}-->
<!-- AND aa.area_id = it1.data_id-->
<!-- )-->
<!-- </if>-->
order by
mr.crtime desc