diff --git a/src/main/java/com/guaiguailang/harmony/domain/entity/MenuDataItem.java b/src/main/java/com/guaiguailang/harmony/domain/entity/MenuDataItem.java index 93ca9f8..c87289e 100644 --- a/src/main/java/com/guaiguailang/harmony/domain/entity/MenuDataItem.java +++ b/src/main/java/com/guaiguailang/harmony/domain/entity/MenuDataItem.java @@ -20,4 +20,5 @@ public class MenuDataItem { private long keepAlive; private String target; private String locale; + private int deleted; } diff --git a/src/main/java/com/guaiguailang/harmony/mapper/SystemMapper.java b/src/main/java/com/guaiguailang/harmony/mapper/SystemMapper.java index 65f443a..126134d 100644 --- a/src/main/java/com/guaiguailang/harmony/mapper/SystemMapper.java +++ b/src/main/java/com/guaiguailang/harmony/mapper/SystemMapper.java @@ -10,9 +10,19 @@ import java.util.List; @Mapper public interface SystemMapper extends BaseMapper { - List getAllMenus(); - @Select("SELECT * from menu_data_item where id in (select system_role_menu.menu_id from system_role_menu where role_id=#{roleId})") + /** + * 查询某个角色所拥有的菜单 + * @param roleId + * @return + */ + @Select(""" + SELECT * from menu_data_item where id in (select system_role_menu.menu_id from system_role_menu where role_id=#{roleId} and deleted!=1)""") List getMenus(String roleId); - @Select("SELECT * from menu_data_item") + + /** + * 查询所有菜单,不区分角色 + * @return + */ + @Select("SELECT * from menu_data_item where deleted!=1") List getMenusAll(); } diff --git a/src/main/resources/mapper/SystemMapper.xml b/src/main/resources/mapper/SystemMapper.xml index ecc1d37..8d6575a 100644 --- a/src/main/resources/mapper/SystemMapper.xml +++ b/src/main/resources/mapper/SystemMapper.xml @@ -3,20 +3,6 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - - + \ No newline at end of file