Commit dfe8edb3 by guojuxing

用户所在菜单权限接口修改:按照sort排序

parent 8524c904
...@@ -120,6 +120,8 @@ public interface TabSysMenuMapper { ...@@ -120,6 +120,8 @@ public interface TabSysMenuMapper {

 */ 
 */
List<TabSysMenu> selectByIds(@Param("menuIdList") List<Integer> menuIdList); List<TabSysMenu> selectByIds(@Param("menuIdList") List<Integer> menuIdList);
List<TabSysMenu> selectByIdsAndOrderBy(@Param("menuIdList")List<Integer> menuIdList, @Param("orderByStr") String orderByStr);
/** /**
* 查询页面下的权限项数据 * 查询页面下的权限项数据
* @Title: listAuthItemByMenuId
 * @Title: listAuthItemByMenuId

......
...@@ -87,6 +87,17 @@ public interface MenuService { ...@@ -87,6 +87,17 @@ public interface MenuService {
List<TabSysMenu> selectByIds(List<Integer> menuIdList); List<TabSysMenu> selectByIds(List<Integer> menuIdList);
/** /**
* 根据ID list 查询 排序
* @Title: selectByIdsAndOrderBy

* @Description:

 * @author guojuxing
* @param menuIdList
* @param orderByStr
 order by sort 比如
* @return java.util.List<com.gic.auth.entity.TabSysMenu>


 */
List<TabSysMenu> selectByIdsAndOrderBy(List<Integer> menuIdList, String orderByStr);
/**
* 查询页面下的权限项数据 * 查询页面下的权限项数据
* @Title: listAuthItemByMenuId
 * @Title: listAuthItemByMenuId

* @Description: * @Description:
......
...@@ -111,6 +111,14 @@ public class MenuServiceImpl implements MenuService { ...@@ -111,6 +111,14 @@ public class MenuServiceImpl implements MenuService {
} }
@Override @Override
public List<TabSysMenu> selectByIdsAndOrderBy(List<Integer> menuIdList, String orderByStr) {
if (CollectionUtils.isEmpty(menuIdList)) {
return new ArrayList<>();
}
return tabSysMenuMapper.selectByIdsAndOrderBy(menuIdList, orderByStr);
}
@Override
public List<AuthItemListDTO> listAuthItemByMenuId(Integer menuId) { public List<AuthItemListDTO> listAuthItemByMenuId(Integer menuId) {
return tabSysMenuMapper.listAuthItemByMenuId(menuId); return tabSysMenuMapper.listAuthItemByMenuId(menuId);
} }
......
...@@ -886,7 +886,7 @@ public class MenuApiServiceImpl implements MenuApiService { ...@@ -886,7 +886,7 @@ public class MenuApiServiceImpl implements MenuApiService {
menuIdList.add(menu.getMenuId()); menuIdList.add(menu.getMenuId());
} }
} }
resultList = menuService.selectByIds(menuIdList); resultList = menuService.selectByIdsAndOrderBy(menuIdList, " order by sort");
} }
int level = 1; int level = 1;
int parentId = 0; int parentId = 0;
......
...@@ -376,6 +376,22 @@ ...@@ -376,6 +376,22 @@
</if> </if>
</select> </select>
<select id="selectByIdsAndOrderBy" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_sys_menu
where status=1
<if test="null != menuIdList and menuIdList.size() &gt; 0">
and menu_id in
<foreach close=")" collection="menuIdList" index="index" item="item" open="(" separator=",">
#{item}
</foreach>
</if>
<if test="orderByStr != null and orderByStr != '' ">
#{orderByStr}
</if>
</select>
<select id="listAuthItemByMenuId" resultType="com.gic.auth.dto.AuthItemListDTO"> <select id="listAuthItemByMenuId" resultType="com.gic.auth.dto.AuthItemListDTO">
select select
a.menu_id menuId, a.menu_id menuId,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment