It's Repository

blog.selpa.co.kr

포토로그



메뉴번호로 메뉴 링크 가져오기 (forward) - 2depth 용 전자정부프레임워크

<생성 Controller.java>
-----------------------------------------------------------
@RequestMapping("/let/cmm/letMenuLink.do")
public String selectpage(
Map<String, Object> commandMap
, HttpServletRequest request 
, ModelMap model) throws Exception {
String menuUrl = "";
String tmpUniqId = "";
LoginVO user = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null;
if(EgovUserDetailsHelper.isAuthenticated() && user!=null){
tmpUniqId = user.getUniqId();
}
String menuNoStr = (String) commandMap.get("menuNo");
int menuNo = Integer.parseInt(menuNoStr);
MenuManageVO menuVO = new MenuManageVO();
menuVO.setMenuNo(menuNo);
menuVO.setTmpUniqId(tmpUniqId);
menuUrl = menuManageService.selectMenuURL(menuVO);
if("/".equals(menuUrl.trim())){
EgovMap resultMap = menuManageService.selectTopMenuURL(menuVO);
log.debug(resultMap);
menuUrl = (String) resultMap.get("url");
}
return "forward:" + menuUrl;
}
-----------------------------------------------------------



<EgovMenuManageServiceImpl.java>
-----------------------------------------------------------
기존 서비스
public String selectMenuURL(MenuManageVO menuVO) throws Exception {
return menuManageDAO.selectLastMenuURL(menuVO);
}
추가서비스
public EgovMap selectTopMenuURL(MenuManageVO menuVO) throws Exception {
return menuManageDAO.selectTopMenuURL(menuVO);
}
-----------------------------------------------------------


<MenuManageDAO.java>
-----------------------------------------------------------
추가 DAO
      public EgovMap selectTopMenuURL(MenuManageVO menuVO) throws Exception{
return (EgovMap) selectByPk("menuManageDAO.selectTopMenuURL", menuVO);
}
-----------------------------------------------------------



<EgovMainMenu_SQL_Oracle.xml>
-----------------------------------------------------------
      추가 SQL
<select id="menuManageDAO.selectTopMenuURL" parameterClass="MenuManageVO" resultClass="egovMap">
<![CDATA[ 
select * from (
SELECT 
M.MENU_NO
, M.MENU_NM
, M.MENU_ORDR
, M.PROGRM_FILE_NM
, P.URL
FROM
LETTNMENUINFO M
, LETTNMENUCREATDTLS MC
, LETTNPROGRMLIST P
where 
1 = 1
and M.MENU_NO = MC.MENU_NO
and P.PROGRM_FILE_NM = M.PROGRM_FILE_NM
and MC.AUTHOR_CODE = (SELECT C.AUTHOR_CODE from LETTNEMPLYRSCRTYESTBS C WHERE  C.SCRTY_DTRMN_TRGET_ID = #tmpUniqId#)
and M.UPPER_MENU_NO = #menuNo#
order by M.menu_ordr asc
) T where rownum = 1
]]> 
</select>

덧글

댓글 입력 영역