parent
fbdbc8f089
commit
aa942f402b
@ -1,7 +0,0 @@
|
||||
package kr.xit.fims.biz.cmm;
|
||||
|
||||
import kr.xit.framework.core.utils.XitCmmnUtil;
|
||||
|
||||
public class FimsCmmnUtil extends XitCmmnUtil{
|
||||
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package kr.xit.framework.biz.cmm;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import kr.xit.framework.support.util.JBeanRegistry;
|
||||
|
||||
/**
|
||||
* 코드 caching
|
||||
*/
|
||||
public class CacheCodeUtils {
|
||||
|
||||
/**
|
||||
* 코드그룹ID(codeGrouId)에 해당하는 코드 Map 리스트를 반환한다.
|
||||
*
|
||||
* @param codeId 코드그룹ID
|
||||
* @return 코드그룹ID(codeGrouId)에 해당하는 코드 Map 리스트
|
||||
*/
|
||||
public static List<Map<String,Object>> getCodes(final String codeId) {
|
||||
return JBeanRegistry.getCacheService().findCodes(codeId);
|
||||
}
|
||||
|
||||
/**
|
||||
* combobox로 전달할 목록을 담은 Map 리스트를 반환한다.
|
||||
* @param codeId query의 binding data를 담은 Map
|
||||
* @return combobox로 전달할 목록을 담은 Map 리스트
|
||||
*/
|
||||
public static List<Map<String,Object>> getComboCodes(final String codeId) {
|
||||
return JBeanRegistry.getCacheService().findComboCodes(codeId);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package kr.xit.framework.biz.cmm;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import kr.xit.framework.support.util.JBeanRegistry;
|
||||
|
||||
/**
|
||||
* 메뉴 caching
|
||||
*
|
||||
*/
|
||||
public class CacheMenuUtils {
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param uniqId String
|
||||
* @return List<Map<String,Object>>
|
||||
*/
|
||||
public static List<Map<String,String>> findMenuListByUser(final String uniqId) {
|
||||
return JBeanRegistry.getCacheService().findMenuListByUser(uniqId);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param authorCode String
|
||||
* @return List<Map<String,Object>>
|
||||
*/
|
||||
public static List<Map<String,String>> findMenuListByAuthorCode(final String authorCode) {
|
||||
return JBeanRegistry.getCacheService().findMenuListByAuthorCode(authorCode);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
package kr.xit.framework.biz.cmm.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import egovframework.rte.psl.dataaccess.mapper.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface CacheCodeMapper<T> {
|
||||
List<T> selectCodes(final String codeId);
|
||||
List<T> selectComboCodes(final String codeId);
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
package kr.xit.framework.biz.cmm.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import egovframework.rte.psl.dataaccess.mapper.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface CacheMenuMapper<T> {
|
||||
List<T> selectMenuListByUser(final String uniqId);
|
||||
|
||||
List<T> selectMenuListByAuthorCode(final String authorCode);
|
||||
}
|
@ -0,0 +1,54 @@
|
||||
package kr.xit.framework.biz.cmm.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface CacheService {
|
||||
|
||||
/**
|
||||
* 코드 그룹 아이디로 모든 코드 목록을 Map 타입으로 조회한다.
|
||||
* @param codeId
|
||||
* @return List<T>
|
||||
*/
|
||||
List<Map<String, Object>> findCodes(final String codeId);
|
||||
|
||||
/**
|
||||
* 코드 그룹 아이디로 모든 코드 목록을 Map 타입으로 조회한다.
|
||||
* @param codeId
|
||||
* @return List<T>
|
||||
*/
|
||||
List<Map<String, Object>> findComboCodes(final String codeId);
|
||||
|
||||
/**
|
||||
* 사용자별 메뉴 조회
|
||||
* @param uniqId
|
||||
* @return List<T>
|
||||
*/
|
||||
List<Map<String, String>> findMenuListByUser(final String uniqId);
|
||||
/**
|
||||
* 궘한별 메뉴 조회
|
||||
* @param authorCode
|
||||
* @return List<T>
|
||||
*/
|
||||
List<Map<String, String>> findMenuListByAuthorCode(final String authorCode);
|
||||
|
||||
/**
|
||||
* 코드 캐시 Evict
|
||||
*/
|
||||
void evictAllCodeCache();
|
||||
|
||||
/**
|
||||
* 메뉴 캐시 Evict
|
||||
*/
|
||||
void evictAllMenuCache();
|
||||
|
||||
/**
|
||||
* 코드 캐시 Evict
|
||||
*/
|
||||
void evictCodeCache(final String codeId);
|
||||
|
||||
/**
|
||||
* 메뉴 캐시 Evict
|
||||
*/
|
||||
void evictMenuCache(final String userId);
|
||||
}
|
@ -0,0 +1,72 @@
|
||||
package kr.xit.framework.biz.cmm.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import kr.xit.framework.biz.cmm.service.CacheService;
|
||||
import kr.xit.framework.biz.cmm.mapper.CacheCodeMapper;
|
||||
import kr.xit.framework.biz.cmm.mapper.CacheMenuMapper;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
||||
@AllArgsConstructor
|
||||
@Service
|
||||
public class CacheServiceImpl implements CacheService {
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
private final CacheCodeMapper codeMapper;
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
private final CacheMenuMapper menuMapper;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Cacheable(cacheNames="codeCache", key = "#codeId")
|
||||
@Override
|
||||
public List<Map<String, Object>> findCodes(final String codeId) {
|
||||
return codeMapper.selectCodes(codeId);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Cacheable(cacheNames="codeComboCache", key = "#codeId")
|
||||
@Override
|
||||
public List<Map<String, Object>> findComboCodes(final String codeId) {
|
||||
return codeMapper.selectComboCodes(codeId);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Cacheable(cacheNames="menuCache", key = "#uniqId")
|
||||
@Override
|
||||
public List<Map<String, String>> findMenuListByUser(final String uniqId) {
|
||||
return menuMapper.selectMenuListByUser(uniqId);
|
||||
}
|
||||
|
||||
@Cacheable(cacheNames="menuCache", key = "#authorCode")
|
||||
@Override
|
||||
public List<Map<String, String>> findMenuListByAuthorCode(final String authorCode) {
|
||||
return menuMapper.selectMenuListByAuthorCode(authorCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
@CacheEvict(cacheNames="codeCache", allEntries = true)
|
||||
public void evictAllCodeCache() {
|
||||
}
|
||||
|
||||
@Override
|
||||
@CacheEvict(cacheNames="menuCache", allEntries = true)
|
||||
public void evictAllMenuCache() {
|
||||
}
|
||||
|
||||
@Override
|
||||
@CacheEvict(cacheNames="codeCache", allEntries = true)
|
||||
public void evictCodeCache(final String codeId) {
|
||||
}
|
||||
|
||||
@Override
|
||||
@CacheEvict(cacheNames="menuCache", allEntries = true)
|
||||
public void evictMenuCache(final String key) {
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
package kr.xit.framework.biz.cmm.web;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import kr.xit.framework.biz.cmm.CacheCodeUtils;
|
||||
import kr.xit.framework.biz.cmm.CacheMenuUtils;
|
||||
import kr.xit.framework.core.constants.FrameworkConstants;
|
||||
|
||||
/**
|
||||
* 공통코드, 사용자코드 콘트롤러
|
||||
*
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping(value="/framework/biz/cmm/cache")
|
||||
public class
|
||||
CacheController {
|
||||
|
||||
/**
|
||||
* 코드 목록조회
|
||||
* @param codeId String
|
||||
* @return ModelAndView
|
||||
*/
|
||||
@GetMapping(value="/getCodeList")
|
||||
public ModelAndView getCodeList(final String codeId) {
|
||||
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
|
||||
mav.addObject(codeId, CacheCodeUtils.getCodes(codeId));
|
||||
return mav;
|
||||
}
|
||||
|
||||
/**
|
||||
* Combo 코드 목록조회
|
||||
* @param codeId String
|
||||
* @return ModelAndView
|
||||
*/
|
||||
@GetMapping(value="/getComboCodeList")
|
||||
public ModelAndView getComboCodeList(final String codeId) {
|
||||
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
|
||||
mav.addObject(codeId, CacheCodeUtils.getComboCodes(codeId));
|
||||
return mav;
|
||||
}
|
||||
|
||||
@GetMapping(value="/getMenuListByUser")
|
||||
public ModelAndView getMenuListByUser(final String uniqId) {
|
||||
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
|
||||
mav.addObject("allMenuList", CacheMenuUtils.findMenuListByUser(uniqId));
|
||||
return mav;
|
||||
}
|
||||
|
||||
@GetMapping(value="/getMenuListByAuthorCode")
|
||||
public ModelAndView getMenuListByAuthorCode(final String authorCode) {
|
||||
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
|
||||
mav.addObject("allMenuList", CacheMenuUtils.findMenuListByAuthorCode(authorCode));
|
||||
return mav;
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package kr.xit.framework.support.cache;
|
||||
|
||||
import org.ehcache.event.CacheEvent;
|
||||
import org.ehcache.event.CacheEventListener;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@Slf4j
|
||||
public class EhCacheEventLogger implements CacheEventListener<Object, Object> {
|
||||
@Override
|
||||
public void onEvent(CacheEvent<?, ?> cacheEvent) {
|
||||
log.info("cache event logger message::getKey: {} / getOldValue: {} / getNewValue:{}", cacheEvent.getKey(), cacheEvent.getOldValue(), cacheEvent.getNewValue());
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:cache="http://www.springframework.org/schema/cache"
|
||||
xmlns:p="http://www.springframework.org/schema/p"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache.xsd">
|
||||
|
||||
<cache:annotation-driven cache-manager="ehCacheManager"/>
|
||||
<bean id="ehCacheManager" class="org.springframework.cache.jcache.JCacheCacheManager">
|
||||
<property name="cacheManager">
|
||||
<bean class="org.springframework.cache.jcache.JCacheManagerFactoryBean"
|
||||
p:cacheManagerUri="classpath:spring/service/cache/ehcache.xml" />
|
||||
</property>
|
||||
</bean>
|
||||
</beans>
|
@ -0,0 +1,91 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<config xmlns="http://www.ehcache.org/v3">
|
||||
<!-- 캐시 파일이 생성되는 경로 -->
|
||||
<persistence directory="${user.home}/data/cache/data"/>
|
||||
|
||||
<cache-template name="cacheLog">
|
||||
<!-- 캐시가 생성되고 삭제되는 이벤트를 모니터링 하고 싶을 때의 설정 -->
|
||||
<!-- 운영시 comment -->
|
||||
<listeners>
|
||||
<listener>
|
||||
<class>kr.xit.framework.support.cache.EhCacheEventLogger</class> <!-- 캐싱처리에 대한 리스너가 등록된 클래스의 FQCN을 등록한다. -->
|
||||
<event-firing-mode>ASYNCHRONOUS</event-firing-mode>
|
||||
<event-ordering-mode>UNORDERED</event-ordering-mode>
|
||||
<events-to-fire-on>CREATED</events-to-fire-on>
|
||||
<events-to-fire-on>EVICTED</events-to-fire-on>
|
||||
<events-to-fire-on>REMOVED</events-to-fire-on>
|
||||
<events-to-fire-on>UPDATED</events-to-fire-on>
|
||||
<events-to-fire-on>EXPIRED</events-to-fire-on>
|
||||
</listener>
|
||||
</listeners>
|
||||
</cache-template>
|
||||
|
||||
<cache alias="codeComboCache" uses-template="cacheLog"> <!-- cache name -->
|
||||
<key-type>java.lang.Object</key-type> <!-- 캐시의 키의 FQCN 지정. 기본 값은 java.lang.Object -->
|
||||
<value-type>java.lang.Object</value-type> <!-- Cache 인스턴스에 저장되는 값의 FQCN. 기본 값은 java.lang.Object -->
|
||||
<!-- 캐시 만료기간 -->
|
||||
<!-- unit : days, hours, minutes, seconds, millis, micros, nanos -->
|
||||
<expiry>
|
||||
<ttl unit="minutes">5</ttl>
|
||||
</expiry>
|
||||
|
||||
<!-- 캐시 데이터 저장 공간과 용량 지정 -->
|
||||
<!-- 만약 힙 메모리만 사용한다면 <heap> 요소만으로 대체 가능 -->
|
||||
<!-- heap unit : entries, TB, GB, MB, KB, B -->
|
||||
<!-- offheap unit : TB, GB, MB, KB, B -->
|
||||
<resources>
|
||||
<!-- 캐시 사용 갯수 지정 -->
|
||||
<heap unit="entries">100</heap>
|
||||
<!-- JVM heap 외부 메모리 -->
|
||||
<offheap unit="MB">10</offheap>
|
||||
<!-- Disk memory : shutdown시 삭제 여부 지정 -->
|
||||
<disk unit="MB" persistent="false">50</disk>
|
||||
</resources>
|
||||
</cache>
|
||||
|
||||
<cache alias="codeCache" uses-template="cacheLog"> <!-- cache name -->
|
||||
<key-type>java.lang.Object</key-type> <!-- 캐시의 키의 FQCN 지정. 기본 값은 java.lang.Object -->
|
||||
<value-type>java.lang.Object</value-type> <!-- Cache 인스턴스에 저장되는 값의 FQCN. 기본 값은 java.lang.Object -->
|
||||
<!-- 캐시 만료기간 -->
|
||||
<!-- unit : days, hours, minutes, seconds, millis, micros, nanos -->
|
||||
<expiry>
|
||||
<ttl unit="minutes">5</ttl>
|
||||
</expiry>
|
||||
|
||||
<!-- 캐시 데이터 저장 공간과 용량 지정 -->
|
||||
<!-- 만약 힙 메모리만 사용한다면 <heap> 요소만으로 대체 가능 -->
|
||||
<!-- heap unit : entries, TB, GB, MB, KB, B -->
|
||||
<!-- offheap unit : TB, GB, MB, KB, B -->
|
||||
<resources>
|
||||
<!-- 캐시 사용 갯수 지정 -->
|
||||
<heap unit="entries">100</heap>
|
||||
<!-- JVM heap 외부 메모리 -->
|
||||
<offheap unit="MB">10</offheap>
|
||||
<!-- Disk memory : shutdown시 삭제 여부 지정 -->
|
||||
<disk unit="MB" persistent="false">50</disk>
|
||||
</resources>
|
||||
</cache>
|
||||
|
||||
<cache alias="menuCache" uses-template="cacheLog"> <!-- cache name -->
|
||||
<key-type>java.lang.Object</key-type> <!-- 캐시의 키의 FQCN 지정. 기본 값은 java.lang.Object -->
|
||||
<value-type>java.lang.Object</value-type> <!-- Cache 인스턴스에 저장되는 값의 FQCN. 기본 값은 java.lang.Object -->
|
||||
<!-- 캐시 만료기간 -->
|
||||
<!-- unit : days, hours, minutes, seconds, millis, micros, nanos -->
|
||||
<expiry>
|
||||
<ttl unit="minutes">5</ttl>
|
||||
</expiry>
|
||||
|
||||
<!-- 캐시 데이터 저장 공간과 용량 지정 -->
|
||||
<!-- 만약 힙 메모리만 사용한다면 <heap> 요소만으로 대체 가능 -->
|
||||
<!-- heap unit : entries, TB, GB, MB, KB, B -->
|
||||
<!-- offheap unit : TB, GB, MB, KB, B -->
|
||||
<resources>
|
||||
<!-- 캐시 사용 갯수 지정 -->
|
||||
<heap unit="entries">100</heap>
|
||||
<!-- JVM heap 외부 메모리 -->
|
||||
<offheap unit="MB">10</offheap>
|
||||
<!-- Disk memory : shutdown시 삭제 여부 지정 -->
|
||||
<disk unit="MB" persistent="false">50</disk>
|
||||
</resources>
|
||||
</cache>
|
||||
</config>
|
@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="kr.xit.framework.biz.cmm.mapper.CacheCodeMapper">
|
||||
|
||||
<select id="selectCodes" parameterType="string" resultType="caseMap">
|
||||
/* cachecode-mysql-mapper|selectCodes-공통코드 코드그룹 조회|julim */
|
||||
SELECT code
|
||||
, code_nm
|
||||
, code_dc
|
||||
, etc_1
|
||||
, etc_2
|
||||
, etc_3
|
||||
, ordr
|
||||
FROM xit_cmmn_detail_code
|
||||
WHERE code_id = #{code_id}
|
||||
AND use_at = 'Y'
|
||||
ORDER BY ordr
|
||||
</select>
|
||||
|
||||
<select id="selectComboCodes" parameterType="string" resultType="caseMap">
|
||||
/* cachecode-mysql-mapper|selectComboCodes-공통코드 코드그룹 콤보코드 조회|julim */
|
||||
SELECT code
|
||||
, code_nm
|
||||
FROM xit_cmmn_detail_code
|
||||
WHERE code_id = #{code_id}
|
||||
AND use_at = 'Y'
|
||||
ORDER BY ordr
|
||||
</select>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,95 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="kr.xit.framework.biz.cmm.mapper.CacheMenuMapper">
|
||||
|
||||
<select id="selectMenuListByUser" parameterType="string" resultType="java.util.Map">
|
||||
/* cachemenu-mysql-mapper|selectMenuListByUser-사용자별 메뉴 조회|julim */
|
||||
<include refid="sql_tree"/>
|
||||
SELECT D.menu_id AS "menuSid"
|
||||
, D.menu_name AS "menuName"
|
||||
, (SELECT CASE SA.URL WHEN '/' THEN '#' ELSE SA.URL END
|
||||
FROM xit_progrm_list SA
|
||||
WHERE B.progrm_file_nm = SA.progrm_file_nm ) AS "menuUrl"
|
||||
, D.menu_depth AS "menuDepth"
|
||||
, D.parnt_menu_id AS "parentSid"
|
||||
, D.menu_full_path AS "menuPath"
|
||||
, D.menu_full_path_name AS "menuPathname"
|
||||
, '' AS "superYn"
|
||||
, ( SELECT COUNT(1)
|
||||
FROM TREE_QUERY SA
|
||||
WHERE SA.parnt_menu_id = D.menu_id) AS "childCnt"
|
||||
FROM xit_menu_creat_dtls A
|
||||
INNER JOIN xit_menu_info B
|
||||
ON A.menu_no = B.menu_no
|
||||
INNER JOIN (
|
||||
SELECT FA.author_code, FA.scrty_setup_trget_id
|
||||
FROM xit_user_scrty_setup FA
|
||||
WHERE FA.scrty_setup_trget_id = #{uniqId}
|
||||
) C
|
||||
ON A.author_code = C.author_code
|
||||
INNER JOIN tree_query D
|
||||
ON B.menu_no = D.menu_id
|
||||
ORDER BY D.parnt_menu_id, B.menu_ordr
|
||||
</select>
|
||||
|
||||
<select id="selectMenuListByAuthorCode" parameterType="string" resultType="java.util.Map">
|
||||
/* cachemenu-mysql-mapper|selectMenuListByAuthorCode-권한별 메뉴 조회|julim */
|
||||
<include refid="sql_tree"/>
|
||||
SELECT D.menu_id AS "menuSid"
|
||||
, D.menu_name AS "menuName"
|
||||
, (
|
||||
SELECT CASE SA.URL WHEN '/' THEN '#' ELSE SA.URL END
|
||||
FROM xit_progrm_list SA
|
||||
WHERE B.progrm_file_nm = SA.progrm_file_nm) AS "menuUrl"
|
||||
, D.menu_depth AS "menuDepth"
|
||||
, D.parnt_menu_id AS "parentSid"
|
||||
, D.menu_full_path AS "menuPath"
|
||||
, D.menu_full_path_name AS "menuPathname"
|
||||
, '' AS "superYn"
|
||||
, (SELECT COUNT(1)
|
||||
FROM TREE_QUERY SA
|
||||
WHERE SA.parnt_menu_id = D.menu_id) AS "childCnt"
|
||||
FROM xit_menu_creat_dtls A
|
||||
JOIN xit_menu_info B
|
||||
ON A.menu_no = B.menu_no
|
||||
JOIN tree_query D
|
||||
ON B.menu_no = D.menu_id
|
||||
WHERE A.AUTHOR_CODE = #{authorCode}
|
||||
ORDER BY D.parnt_menu_id, B.menu_ordr
|
||||
</select>
|
||||
|
||||
<sql id="sql_tree">
|
||||
WITH RECURSIVE tree_query(
|
||||
menu_id
|
||||
, PARNT_menu_id
|
||||
, menu_name
|
||||
, menu_full_path
|
||||
, menu_full_path_name
|
||||
, menu_depth
|
||||
) AS (
|
||||
SELECT A.menu_no AS "menu_id"
|
||||
, A.upper_menu_no AS "parnt_menu_id"
|
||||
, A.menu_nm AS "menu_name"
|
||||
, CONCAT('', A.menu_no) AS "menu_full_path"
|
||||
, CONCAT('', A.menu_nm) AS "menu_full_path_name"
|
||||
, 1 AS "menu_depth"
|
||||
FROM xit_menu_info A
|
||||
INNER JOIN xit_progrm_list B
|
||||
ON A.progrm_file_nm = B.progrm_file_nm
|
||||
WHERE A.UPPER_MENU_NO = 0
|
||||
UNION ALL
|
||||
SELECT A.menu_no AS "menu_id"
|
||||
, A.upper_menu_no AS "parnt_menu_id"
|
||||
, A.menu_nm AS "menu_name"
|
||||
, CONCAT(B.menu_full_path, '_', A.menu_no) AS "menu_full_path"
|
||||
, CONCAT(B.menu_full_path_name, ' > ', A.menu_nm) AS "menu_full_path_name"
|
||||
, B.menu_depth + 1 AS "menu_depth"
|
||||
FROM xit_menu_info A
|
||||
INNER JOIN tree_query B
|
||||
ON A.upper_menu_no = B.menu_id
|
||||
WHERE B.menu_id != 0
|
||||
)
|
||||
</sql>
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue