페이지 타이틀 쿼리 오류 수정.

master
강석 최 2022-04-05 10:11:52 +09:00
parent 8313c57024
commit aa4c298b14
3 changed files with 18 additions and 30 deletions

View File

@ -52,11 +52,9 @@ public class CommonAop {
LogService logService; LogService logService;
@Around("execution(* kcg.faics..*Controller.*(..))") @Around("execution(* kcg.faics..*Controller.*(..))")
public Object menuGenerator(final ProceedingJoinPoint thisJoinPoint) public Object menuGenerator(final ProceedingJoinPoint thisJoinPoint) throws Throwable {
throws Throwable {
HttpServletRequest req = ((ServletRequestAttributes) RequestContextHolder HttpServletRequest req = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
.getRequestAttributes()).getRequest();
String loginUrl = "/loginView.do"; String loginUrl = "/loginView.do";
String url = req.getRequestURI(); String url = req.getRequestURI();
@ -125,7 +123,7 @@ public class CommonAop {
menu.put("query", qryCate); menu.put("query", qryCate);
HashMap<String, Object> menuInfo = menuService.getMenuInfo(menu); HashMap<String, Object> menuInfo = menuService.getMenuInfo(menu);
menuVO.setId(Integer.parseInt(menuInfo.get("ID").toString())); menuVO.setId(((Double)menuInfo.get("id")).intValue());
menuInfo.put("userId", loginUserVO.getUserid()); menuInfo.put("userId", loginUserVO.getUserid());
List<MenuVO> currAndHigherMenuList = menuService.selectListWithHigher(menuVO); List<MenuVO> currAndHigherMenuList = menuService.selectListWithHigher(menuVO);
@ -140,8 +138,7 @@ public class CommonAop {
// e.printStackTrace(); // e.printStackTrace();
} }
Object proc = thisJoinPoint.proceed(); return thisJoinPoint.proceed();
return proc;
} }
/** /**

View File

@ -84,12 +84,11 @@ public class MenuServiceImpl implements MenuService {
public HashMap<String, Object> getMenuInfo(final HashMap<String, Object> menu) { public HashMap<String, Object> getMenuInfo(final HashMap<String, Object> menu) {
HashMap<String, Object> paramMenu = menuMapper.getMenuInfo(menu); HashMap<String, Object> paramMenu = menuMapper.getMenuInfo(menu);
int depth = ((BigDecimal) paramMenu.get("DEPTH")).intValue(); if ((Double)paramMenu.get("depth") < 3.0d) {
if (depth < 3) {
return paramMenu; return paramMenu;
} else { } else {
menu.put("id", ((BigDecimal) paramMenu.get("PARENT")).intValue()); menu.put("id", ((BigDecimal) paramMenu.get("parent")).intValue());
return menuMapper.getMenuInfoById(menu); return menuMapper.getMenuInfoById(menu);
} }
} }

View File

@ -97,25 +97,17 @@
</select> </select>
<!----> <!---->
<select id="Menu.getMenuInfo" parameterType="map" resultType="map"> <select id="Menu.getMenuInfo" parameterType="map" resultType="map">
<![CDATA[ SELECT *
SELECT * FROM ( FROM T_MENU
SELECT WHERE URL_GROUP = #{group}
* AND URL = #{url}
FROM <if test="boardId != null and boardId != ''">
T_MENU AND BOARD_ID = #{boardId}
WHERE </if>
URL_GROUP = #{group} AND <if test="query != null and query != ''">
URL = #{url} AND URL_QUERY = #{query}
]]> </if>
<if test="boardId != null and boardId != ''"><![CDATA[ limit 1
AND BOARD_ID = #{boardId}
]]></if>
<if test="query != null and query != ''"><![CDATA[
AND URL_QUERY = #{query}
]]></if>
<![CDATA[
) WHERE ROWNUM = 1
]]>
</select> </select>
<select id="Menu.getMenuInfoById" parameterType="map" resultType="map"> <select id="Menu.getMenuInfoById" parameterType="map" resultType="map">