apply datapermission
This commit is contained in:
parent
f7f49960a1
commit
410193c53c
|
|
@ -178,6 +178,11 @@ public interface MenuDishesMapper extends BaseMapper<MenuDishes> {
|
|||
@Select({"select calories, protein, fat, carbohydrate, dietary_fiber, cholesterol, calcium, sodium, purine, iron, iodine, kalium, vitamin_a, vitamin_c, vitamin_e, magnesium, zinc, glycemic_index from menu_dishes where dishes_id = #{dishesId}"})
|
||||
MenuDishesNutritionVO selectDishesNutrition(@Param("dishesId") Long dishesId);
|
||||
//
|
||||
|
||||
@LeNiuDataPermission(
|
||||
alias = "aa",
|
||||
permissionType = DataPermissionTypeEnum.PERMISSION_AREA
|
||||
)
|
||||
List<MenuDishesExportVO> selectDishesExportList(@Param("content") MenuDishesExportDTO content, @Param("canteenEnable") boolean canteenEnable, @Param("authPO") MgrUserAuthPO authPO);
|
||||
//
|
||||
@Select({"select material_cost from menu_dishes ${ew.customSqlSegment}"})
|
||||
|
|
@ -200,6 +205,11 @@ public interface MenuDishesMapper extends BaseMapper<MenuDishes> {
|
|||
//
|
||||
// void openLimitCustomId();
|
||||
//
|
||||
|
||||
@LeNiuDataPermission(
|
||||
alias = "md",
|
||||
permissionType = DataPermissionTypeEnum.PERMISSION_AREA
|
||||
)
|
||||
List<Long> selectUseTypeDishesList(@Param("content") MenuTypeDishesDTO content, @Param("authPO") MgrUserAuthPO authPO);
|
||||
//
|
||||
// List<DishesLabelDto> selectTasteByDishesIds(@Param("dishesIds") List<Long> dishesIdList);
|
||||
|
|
|
|||
|
|
@ -1178,14 +1178,9 @@
|
|||
left join alloc_area aa on aa.area_id = md.area_id
|
||||
left join alloc_canteen ac on md.canteen_id = ac.canteen_id
|
||||
left join alloc_stall ass on ass.stall_id = md.shopstall_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
|
||||
md.del_flag = 2
|
||||
and hide_flag = 2
|
||||
AND sr.del_flag = 0
|
||||
AND sr.role_key = #{authPO.roleCode}
|
||||
AND sur.user_id = #{authPO.userId}
|
||||
<if test="content.dishesName != null and content.dishesName != ''">
|
||||
and (
|
||||
md.dishes_name like #{content.dishesName}
|
||||
|
|
@ -1217,33 +1212,6 @@
|
|||
#{typeId}
|
||||
</foreach>
|
||||
</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 it3.user_id = #{authPO.userId}-->
|
||||
<!-- and (md.canteen_id = it1.data_id or md.canteen_id = -1)-->
|
||||
<!-- )-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="'2'.toString() == authPO.roleType.toString() or '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 (md.area_id = it1.data_id or md.area_id = -1)-->
|
||||
<!-- )-->
|
||||
<!-- </if>-->
|
||||
order by
|
||||
md.id desc
|
||||
</select>
|
||||
|
|
@ -1372,13 +1340,8 @@
|
|||
from
|
||||
menu_dishes_base mdb
|
||||
left join menu_dishes md on mdb.base_dishes_id = md.base_dishes_id and md.size_json != '{"sizeType":"小份"}'
|
||||
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
|
||||
md.del_flag = 2
|
||||
AND sr.del_flag = 0
|
||||
AND sr.role_key = #{authPO.roleCode}
|
||||
AND sur.user_id = #{authPO.userId}
|
||||
<if test="content.typeId != null">
|
||||
and md.type_id = #{content.typeId}
|
||||
</if>
|
||||
|
|
@ -1416,33 +1379,6 @@
|
|||
<if test="content.salesMode != null">
|
||||
and md.sales_mode = #{content.salesMode}
|
||||
</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 it3.user_id = #{authPO.userId}-->
|
||||
<!-- and (md.canteen_id = it1.data_id or md.canteen_id = -1)-->
|
||||
<!-- )-->
|
||||
<!-- </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 (md.area_id = it1.data_id or md.area_id = -1)-->
|
||||
<!-- )-->
|
||||
<!-- </if>-->
|
||||
</select>
|
||||
|
||||
<!-- <update id="openLimitCustomId">-->
|
||||
|
|
|
|||
Loading…
Reference in New Issue