fix: 菜单查询新增字段deleted
This commit is contained in:
parent
92b01751bf
commit
8e63cb4ef9
@ -20,4 +20,5 @@ public class MenuDataItem {
|
||||
private long keepAlive;
|
||||
private String target;
|
||||
private String locale;
|
||||
private int deleted;
|
||||
}
|
||||
|
@ -10,9 +10,19 @@ import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface SystemMapper extends BaseMapper<MenuDataItem> {
|
||||
List<SystemMenu> 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<MenuDataItem> getMenus(String roleId);
|
||||
@Select("SELECT * from menu_data_item")
|
||||
|
||||
/**
|
||||
* 查询所有菜单,不区分角色
|
||||
* @return
|
||||
*/
|
||||
@Select("SELECT * from menu_data_item where deleted!=1")
|
||||
List<MenuDataItem> getMenusAll();
|
||||
}
|
||||
|
@ -3,20 +3,6 @@
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.guaiguailang.harmony.mapper.SystemMapper">
|
||||
|
||||
<!-- 查询所有菜单 -->
|
||||
<select id="getAllMenus" resultType="com.guaiguailang.harmony.domain.entity.SystemMenu">
|
||||
SELECT id,
|
||||
title,
|
||||
`key`,
|
||||
name,
|
||||
component,
|
||||
redirect,
|
||||
icon,
|
||||
status,
|
||||
parent,
|
||||
`order`
|
||||
FROM system_menu
|
||||
ORDER BY `order`
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue
Block a user