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 ee40bfa8..3c0df718 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 @@ -3,6 +3,8 @@ package com.bonus.canteen.core.menu.mapper; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.bonus.canteen.core.auth.config.LeNiuDataPermission; +import com.bonus.canteen.core.auth.enums.DataPermissionTypeEnum; import com.bonus.canteen.core.auth.po.MgrUserAuthPO; import com.bonus.canteen.core.menu.dto.*; import com.bonus.canteen.core.menu.entity.MenuDishes; @@ -78,6 +80,11 @@ public interface MenuDishesMapper extends BaseMapper { // @Select({"select id, dishes_name from menu_dishes ${ew.customSqlSegment}"}) // List selectIdAndNameByWrapper(@Param("ew") Wrapper wrapper); // + + @LeNiuDataPermission( + alias = "aa", + permissionType = DataPermissionTypeEnum.PERMISSION_AREA + ) Page selectAllV2List(Page resultPage, @Param("content") MenuDishesV2PageDTO content, @Param("canteenEnable") boolean canteenEnable, @Param("authPO") MgrUserAuthPO authPO); // MenuDishesDetailVO selectDishesDetailById(Long dishesId); @@ -85,6 +92,11 @@ public interface MenuDishesMapper extends BaseMapper { @Select({"select custom_id from menu_dishes ${ew.customSqlSegment}"}) List selectCustomIdByWrapper(@Param("ew") Wrapper wrapper); // + + @LeNiuDataPermission( + alias = "aa", + permissionType = DataPermissionTypeEnum.PERMISSION_AREA + ) List selectTypeDishesList(@Param("content") MenuTypeDishesDTO content, @Param("authPO") MgrUserAuthPO authPO); // // @Select({"select 1 from menu_dishes ${ew.customSqlSegment}"}) 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 cff7a6e5..762a7d5b 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 @@ -541,14 +541,9 @@ left join alloc_area aa on md.area_id = aa.area_id left join alloc_canteen ac on md.canteen_id = ac.canteen_id left join alloc_stall ast on md.shopstall_id = ast.stall_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.sales_mode = #{content.salesMode} @@ -595,56 +590,6 @@ and mmd.material_id = #{content.materialId} ) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - order by md.id desc @@ -728,13 +673,8 @@ 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 menu_dishes_type mdt on md.type_id = mdt.type_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 sr.del_flag = 0 - AND sr.role_key = #{authPO.roleCode} - AND sur.user_id = #{authPO.userId} and md.type_id = #{content.typeId} @@ -772,33 +712,6 @@ and md.sales_mode = #{content.salesMode} - - - - - - - - - - - - - - - - - - - - - - - - - - -