diff --git a/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/mapper/MenuMapper.java b/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/mapper/MenuMapper.java index d42ab9ca..47b8db0d 100644 --- a/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/mapper/MenuMapper.java +++ b/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/mapper/MenuMapper.java @@ -12,13 +12,13 @@ import java.util.Set; @Mapper public interface MenuMapper extends BaseMapper { - List selectMenuByCriteria(@Param("criteria") QueryMenuRequest criteria); + List queryMenuListByArgs(@Param("criteria") QueryMenuRequest criteria); - LinkedHashSet selectMenuByRoleIdsAndType(@Param("roleIds") Set roleIds, @Param("type") Integer type); + LinkedHashSet queryMenuSetByRoleIdsAndType(@Param("roleIds") Set roleIds, @Param("type") Integer type); - List selectMenuByPidIsNullOrderByMenuSort(); + List queryMenuListByPidIsNullOrderByMenuSort(); - List selectMenuByPidOrderByMenuSort(@Param("pid") Long pid); + List queryMenuListByPidOrderByMenuSort(@Param("pid") Long pid); Menu getMenuByTitle(@Param("title") String title); @@ -26,5 +26,5 @@ public interface MenuMapper extends BaseMapper { Integer getMenuCountByPid(@Param("pid") Long pid); - void updateSubCntById(@Param("count") int count, @Param("menuId") Long menuId); + void updateSubCntByMenuId(@Param("count") int count, @Param("menuId") Long menuId); } diff --git a/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/service/impl/MenuServiceImpl.java b/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/service/impl/MenuServiceImpl.java index 6e4c423b..1b5bd22f 100644 --- a/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/service/impl/MenuServiceImpl.java +++ b/cutejava/cutejava-system/src/main/java/cn/odboy/application/system/service/impl/MenuServiceImpl.java @@ -71,7 +71,7 @@ public class MenuServiceImpl extends ServiceImpl implements Me } } } - return menuMapper.selectMenuByCriteria(criteria); + return menuMapper.queryMenuListByArgs(criteria); } @Override @@ -98,7 +98,7 @@ public class MenuServiceImpl extends ServiceImpl implements Me if (CollUtil.isEmpty(menus)) { List roles = roleService.selectRoleByUsersId(currentUserId); Set roleIds = roles.stream().map(Role::getId).collect(Collectors.toSet()); - menus = new ArrayList<>(menuMapper.selectMenuByRoleIdsAndType(roleIds, 2)); + menus = new ArrayList<>(menuMapper.queryMenuSetByRoleIdsAndType(roleIds, 2)); redisHelper.set(key, menus, 1, TimeUnit.DAYS); } return menus; @@ -186,7 +186,7 @@ public class MenuServiceImpl extends ServiceImpl implements Me public Set selectChildMenus(List menuList, Set menuSet) { for (Menu menu : menuList) { menuSet.add(menu); - List menus = menuMapper.selectMenuByPidOrderByMenuSort(menu.getId()); + List menus = menuMapper.queryMenuListByPidOrderByMenuSort(menu.getId()); if (CollUtil.isNotEmpty(menus)) { selectChildMenus(menus, menuSet); } @@ -210,9 +210,9 @@ public class MenuServiceImpl extends ServiceImpl implements Me public List selectMenuByPid(Long pid) { List menus; if (pid != null && !pid.equals(0L)) { - menus = menuMapper.selectMenuByPidOrderByMenuSort(pid); + menus = menuMapper.queryMenuListByPidOrderByMenuSort(pid); } else { - menus = menuMapper.selectMenuByPidIsNullOrderByMenuSort(); + menus = menuMapper.queryMenuListByPidIsNullOrderByMenuSort(); } return menus; } @@ -220,10 +220,10 @@ public class MenuServiceImpl extends ServiceImpl implements Me @Override public List selectSuperiorMenu(Menu menu, List menus) { if (menu.getPid() == null) { - menus.addAll(menuMapper.selectMenuByPidIsNullOrderByMenuSort()); + menus.addAll(menuMapper.queryMenuListByPidIsNullOrderByMenuSort()); return menus; } - menus.addAll(menuMapper.selectMenuByPidOrderByMenuSort(menu.getPid())); + menus.addAll(menuMapper.queryMenuListByPidOrderByMenuSort(menu.getPid())); return selectSuperiorMenu(getMenuById(menu.getPid()), menus); } @@ -315,7 +315,7 @@ public class MenuServiceImpl extends ServiceImpl implements Me private void updateSubCnt(Long menuId) { if (menuId != null) { int count = menuMapper.getMenuCountByPid(menuId); - menuMapper.updateSubCntById(count, menuId); + menuMapper.updateSubCntByMenuId(count, menuId); } } diff --git a/cutejava/cutejava-system/src/main/resources/mapper/MenuMapper.xml b/cutejava/cutejava-system/src/main/resources/mapper/MenuMapper.xml index 435c2530..1f970f08 100644 --- a/cutejava/cutejava-system/src/main/resources/mapper/MenuMapper.xml +++ b/cutejava/cutejava-system/src/main/resources/mapper/MenuMapper.xml @@ -21,7 +21,7 @@ - select menu_id, title, name, menu_sort, component, path, type, permission, icon, cache, hidden, pid, sub_count, i_frame, create_by, update_by, create_time, update_time @@ -46,7 +46,7 @@ order by menu_sort - SELECT m.* FROM sys_menu m, sys_roles_menus r WHERE m.menu_id = r.menu_id AND r.role_id IN @@ -55,7 +55,7 @@ AND type != #{type} order by m.menu_sort - SELECT menu_id, title, name, @@ -78,7 +78,7 @@ where pid is null order by menu_sort - SELECT menu_id, title, name, @@ -111,12 +111,12 @@ FROM sys_menu WHERE name = #{name} - SELECT count(*) FROM sys_menu WHERE pid = #{pid} - + update sys_menu set sub_count = #{count} where menu_id = #{menuId}