From 410193c53c54a37dba69337f83755ab7e91a7fdd Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Mon, 10 Mar 2025 19:06:57 +0800 Subject: [PATCH] apply datapermission --- .../core/menu/mapper/MenuDishesMapper.java | 10 +++ .../mapper/menu/MenuDishesMapper.xml | 64 ------------------- 2 files changed, 10 insertions(+), 64 deletions(-) diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/mapper/MenuDishesMapper.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/mapper/MenuDishesMapper.java index 3c0df718..b4f0e6ea 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/mapper/MenuDishesMapper.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/mapper/MenuDishesMapper.java @@ -178,6 +178,11 @@ public interface MenuDishesMapper extends BaseMapper { @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 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 { // // void openLimitCustomId(); // + + @LeNiuDataPermission( + alias = "md", + permissionType = DataPermissionTypeEnum.PERMISSION_AREA + ) List selectUseTypeDishesList(@Param("content") MenuTypeDishesDTO content, @Param("authPO") MgrUserAuthPO authPO); // // List selectTasteByDishesIds(@Param("dishesIds") List dishesIdList); diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/menu/MenuDishesMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/menu/MenuDishesMapper.xml index 762a7d5b..374efaf4 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/menu/MenuDishesMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/menu/MenuDishesMapper.xml @@ -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} and ( md.dishes_name like #{content.dishesName} @@ -1217,33 +1212,6 @@ #{typeId} - - - - - - - - - - - - - - - - - - - - - - - - - - - order by md.id desc @@ -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} and md.type_id = #{content.typeId} @@ -1416,33 +1379,6 @@ and md.sales_mode = #{content.salesMode} - - - - - - - - - - - - - - - - - - - - - - - - - - -