Browse Source

판매관리비 row 위치 변경

dev001 10 months ago
parent
commit
a6c7f4a134
1 changed files with 401 additions and 1 deletions
  1. 401 1
      src/main/resources/sqlmap/mappers/ei/ei0103/EI01030001UMapper.xml

+ 401 - 1
src/main/resources/sqlmap/mappers/ei/ei0103/EI01030001UMapper.xml

@@ -2,7 +2,7 @@
 <!DOCTYPE mapper PUBLIC "-//ibatis.apache.org//DTD Mapper 3.0//EN" "http://ibatis.apache.org/dtd/ibatis-3-mapper.dtd">
 <!DOCTYPE mapper PUBLIC "-//ibatis.apache.org//DTD Mapper 3.0//EN" "http://ibatis.apache.org/dtd/ibatis-3-mapper.dtd">
 
 
 <mapper namespace="sgc.portal.ei.ei0103.persistence.EI01030001UMapper">
 <mapper namespace="sgc.portal.ei.ei0103.persistence.EI01030001UMapper">
-
+    <!-- 
 	<select id="getList" resultType="easyHashMap">
 	<select id="getList" resultType="easyHashMap">
      SELECT  A.CMPN_CD                                    /* 회사 코드                       */
      SELECT  A.CMPN_CD                                    /* 회사 코드                       */
            , A.PYEAR                                      /* 기준 연도                        */
            , A.PYEAR                                      /* 기준 연도                        */
@@ -401,6 +401,406 @@
      ORDER BY A.CCGRP_GB_CD
      ORDER BY A.CCGRP_GB_CD
             , MIN(A.SORT_NUM)
             , MIN(A.SORT_NUM)
             , MIN(A.DTL_SORT_NUM)
             , MIN(A.DTL_SORT_NUM)
+    </select> -->
+    
+	<select id="getList" resultType="easyHashMap">
+     SELECT  A.CMPN_CD                                    /* 회사 코드                       */
+           , A.PYEAR                                      /* 기준 연도                        */
+           , A.CCGRP_GB_CD                                /* 사업본부 구분코드[EI002] */
+           , A.GB_CD                                      /* 구분 코드                        */  
+           , MIN(A.GB_NM)          AS GB_NM               /* 구분명                            */
+           , A.DTL_GB_CD                                  /* 구분 코드(상세)         */ 
+           , MIN(A.DTL_GB_NM)      AS DTL_GB_NM           /* 구분명(상세)           */
+           , MIN(A.SORT_NUM)       AS SORT_NUM            /* 정렬 순서                         */
+           , MIN(A.DTL_SORT_NUM)   AS DTL_SORT_NUM        /* 정렬 순서(상세)         */
+           , SUM(A.PLAN_01)        AS PLAN_01             /* 월별 계획                         */
+           , SUM(A.PFMC_01)        AS PFMC_01             /* 월별  실적                        */
+           , SUM(A.PFMC_RV_01)     AS PFMC_RV_01          /* 월별  실적(보정)         */
+           , SUM(A.FCST_01)        AS FCST_01             /* 월별  전망                        */
+           , SUM(A.PLAN_02)        AS PLAN_02
+           , SUM(A.PFMC_02)        AS PFMC_02
+           , SUM(A.PFMC_RV_02)     AS PFMC_RV_02
+           , SUM(A.FCST_02)        AS FCST_02
+           , SUM(A.PLAN_03)        AS PLAN_03
+           , SUM(A.PFMC_03)        AS PFMC_03
+           , SUM(A.PFMC_RV_03)     AS PFMC_RV_03
+           , SUM(A.FCST_03)        AS FCST_03
+           , SUM(A.PLAN_04)        AS PLAN_04
+           , SUM(A.PFMC_04)        AS PFMC_04
+           , SUM(A.PFMC_RV_04)     AS PFMC_RV_04
+           , SUM(A.FCST_04)        AS FCST_04
+           , SUM(A.PLAN_05)        AS PLAN_05
+           , SUM(A.PFMC_05)        AS PFMC_05
+           , SUM(A.PFMC_RV_05)     AS PFMC_RV_05
+           , SUM(A.FCST_05)        AS FCST_05
+           , SUM(A.PLAN_06)        AS PLAN_06
+           , SUM(A.PFMC_06)        AS PFMC_06
+           , SUM(A.PFMC_RV_06)     AS PFMC_RV_06
+           , SUM(A.FCST_06)        AS FCST_06
+           , SUM(A.PLAN_07)        AS PLAN_07
+           , SUM(A.PFMC_07)        AS PFMC_07
+           , SUM(A.PFMC_RV_07)     AS PFMC_RV_07
+           , SUM(A.FCST_07)        AS FCST_07
+           , SUM(A.PLAN_08)        AS PLAN_08
+           , SUM(A.PFMC_08)        AS PFMC_08
+           , SUM(A.PFMC_RV_08)     AS PFMC_RV_08
+           , SUM(A.FCST_08)        AS FCST_08
+           , SUM(A.PLAN_09)        AS PLAN_09
+           , SUM(A.PFMC_09)        AS PFMC_09
+           , SUM(A.PFMC_RV_09)     AS PFMC_RV_09
+           , SUM(A.FCST_09)        AS FCST_09
+           , SUM(A.PLAN_10)        AS PLAN_10
+           , SUM(A.PFMC_10)        AS PFMC_10
+           , SUM(A.PFMC_RV_10)     AS PFMC_RV_10
+           , SUM(A.FCST_10)        AS FCST_10
+           , SUM(A.PLAN_11)        AS PLAN_11
+           , SUM(A.PFMC_11)        AS PFMC_11
+           , SUM(A.PFMC_RV_11)     AS PFMC_RV_11
+           , SUM(A.FCST_11)        AS FCST_11
+           , SUM(A.PLAN_12)        AS PLAN_12
+           , SUM(A.PFMC_12)        AS PFMC_12
+           , SUM(A.PFMC_RV_12)     AS PFMC_RV_12
+           , SUM(A.FCST_12)        AS FCST_12
+     FROM (
+             SELECT A.CMPN_CD                                          /* 회사 코드                        */
+                  , A.PYEAR                                            /* 기준 연도                        */
+                  , A.PMONTH                                           /* 기준 월                          */
+                  , A.CCGRP_GB_CD                                      /* 사업본부 구분코드[EI002] */
+                  , A.GB_CD
+                  , A.GB_NM
+                  , A.DTL_GB_CD
+                  , A.DTL_GB_NM
+                  , A.SORT_NUM
+                  , A.DTL_SORT_NUM
+                  , CASE WHEN A.PMONTH = '01' THEN NVL(A.PLAN, 0)      /* 월별 매출액 계획          */
+                         ELSE 0
+                     END  AS PLAN_01
+                  , CASE WHEN A.PMONTH = '01' THEN NVL(A.PFMC, 0)      /* 월별 매출액 실적          */
+                         ELSE 0
+                     END  AS PFMC_01
+                  , CASE WHEN A.PMONTH = '01' THEN NVL(A.PFMC_RV, 0)   /* 월별 매출액 실적(보정) */
+                         ELSE 0
+                     END  AS PFMC_RV_01
+                  , CASE WHEN A.PMONTH = '01' THEN NVL(A.FCST, 0)      /* 월별 매출액 전망          */
+                         ELSE 0
+                     END  AS FCST_01
+                  , CASE WHEN A.PMONTH = '02' THEN NVL(A.PLAN, 0)
+                         ELSE 0
+                     END  AS PLAN_02
+                  , CASE WHEN A.PMONTH = '02' THEN NVL(A.PFMC, 0)
+                         ELSE 0
+                     END  AS PFMC_02
+                  , CASE WHEN A.PMONTH = '02' THEN NVL(A.PFMC_RV, 0)
+                         ELSE 0
+                     END  AS PFMC_RV_02
+                  , CASE WHEN A.PMONTH = '02' THEN NVL(A.FCST, 0)
+                         ELSE 0
+                     END  AS FCST_02
+                  , CASE WHEN A.PMONTH = '03' THEN NVL(A.PLAN, 0)
+                         ELSE 0
+                     END  AS PLAN_03
+                  , CASE WHEN A.PMONTH = '03' THEN NVL(A.PFMC, 0)
+                         ELSE 0
+                     END  AS PFMC_03
+                  , CASE WHEN A.PMONTH = '03' THEN NVL(A.PFMC_RV, 0)
+                         ELSE 0
+                     END  AS PFMC_RV_03
+                  , CASE WHEN A.PMONTH = '03' THEN NVL(A.FCST, 0)
+                         ELSE 0
+                     END  AS FCST_03
+                  , CASE WHEN A.PMONTH = '04' THEN NVL(A.PLAN, 0)
+                         ELSE 0
+                     END  AS PLAN_04
+                  , CASE WHEN A.PMONTH = '04' THEN NVL(A.PFMC, 0)
+                         ELSE 0
+                     END  AS PFMC_04
+                  , CASE WHEN A.PMONTH = '04' THEN NVL(A.PFMC_RV, 0)
+                         ELSE 0
+                     END  AS PFMC_RV_04
+                  , CASE WHEN A.PMONTH = '04' THEN NVL(A.FCST, 0)
+                         ELSE 0
+                     END  AS FCST_04
+                  , CASE WHEN A.PMONTH = '05' THEN NVL(A.PLAN, 0)
+                         ELSE 0
+                     END  AS PLAN_05
+                  , CASE WHEN A.PMONTH = '05' THEN NVL(A.PFMC, 0)
+                         ELSE 0
+                     END  AS PFMC_05
+                  , CASE WHEN A.PMONTH = '05' THEN NVL(A.PFMC_RV, 0)
+                         ELSE 0
+                     END  AS PFMC_RV_05
+                  , CASE WHEN A.PMONTH = '05' THEN NVL(A.FCST, 0)
+                         ELSE 0
+                     END  AS FCST_05
+                  , CASE WHEN A.PMONTH = '06' THEN NVL(A.PLAN, 0)
+                         ELSE 0
+                     END  AS PLAN_06
+                  , CASE WHEN A.PMONTH = '06' THEN NVL(A.PFMC, 0)
+                         ELSE 0
+                     END  AS PFMC_06
+                  , CASE WHEN A.PMONTH = '06' THEN NVL(A.PFMC_RV, 0)
+                         ELSE 0
+                     END  AS PFMC_RV_06
+                  , CASE WHEN A.PMONTH = '06' THEN NVL(A.FCST, 0)
+                         ELSE 0
+                     END  AS FCST_06
+                  , CASE WHEN A.PMONTH = '07' THEN NVL(A.PLAN, 0)
+                         ELSE 0
+                     END  AS PLAN_07
+                  , CASE WHEN A.PMONTH = '07' THEN NVL(A.PFMC, 0)
+                         ELSE 0
+                     END  AS PFMC_07
+                  , CASE WHEN A.PMONTH = '07' THEN NVL(A.PFMC_RV, 0)
+                         ELSE 0
+                     END  AS PFMC_RV_07
+                  , CASE WHEN A.PMONTH = '07' THEN NVL(A.FCST, 0)
+                         ELSE 0
+                     END  AS FCST_07
+                  , CASE WHEN A.PMONTH = '08' THEN NVL(A.PLAN, 0)
+                         ELSE 0
+                     END  AS PLAN_08
+                  , CASE WHEN A.PMONTH = '08' THEN NVL(A.PFMC, 0)
+                         ELSE 0
+                     END  AS PFMC_08
+                  , CASE WHEN A.PMONTH = '08' THEN NVL(A.PFMC_RV, 0)
+                         ELSE 0
+                     END  AS PFMC_RV_08
+                  , CASE WHEN A.PMONTH = '08' THEN NVL(A.FCST, 0)
+                         ELSE 0
+                     END  AS FCST_08
+                  , CASE WHEN A.PMONTH = '09' THEN NVL(A.PLAN, 0)
+                         ELSE 0
+                     END  AS PLAN_09
+                  , CASE WHEN A.PMONTH = '09' THEN NVL(A.PFMC, 0)
+                         ELSE 0
+                     END  AS PFMC_09
+                  , CASE WHEN A.PMONTH = '09' THEN NVL(A.PFMC_RV, 0)
+                         ELSE 0
+                     END  AS PFMC_RV_09
+                  , CASE WHEN A.PMONTH = '09' THEN NVL(A.FCST, 0)
+                         ELSE 0
+                     END  AS FCST_09
+                  , CASE WHEN A.PMONTH = '10' THEN NVL(A.PLAN, 0)
+                         ELSE 0
+                     END  AS PLAN_10
+                  , CASE WHEN A.PMONTH = '10' THEN NVL(A.PFMC, 0)
+                         ELSE 0
+                     END  AS PFMC_10
+                  , CASE WHEN A.PMONTH = '10' THEN NVL(A.PFMC_RV, 0)
+                         ELSE 0
+                     END  AS PFMC_RV_10
+                  , CASE WHEN A.PMONTH = '10' THEN NVL(A.FCST, 0)
+                         ELSE 0
+                     END  AS FCST_10
+                  , CASE WHEN A.PMONTH = '11' THEN NVL(A.PLAN, 0)
+                         ELSE 0
+                     END  AS PLAN_11
+                  , CASE WHEN A.PMONTH = '11' THEN NVL(A.PFMC, 0)
+                         ELSE 0
+                     END  AS PFMC_11
+                  , CASE WHEN A.PMONTH = '11' THEN NVL(A.PFMC_RV, 0)
+                         ELSE 0
+                     END  AS PFMC_RV_11
+                  , CASE WHEN A.PMONTH = '11' THEN NVL(A.FCST, 0)
+                         ELSE 0
+                     END  AS FCST_11
+                  , CASE WHEN A.PMONTH = '12' THEN NVL(A.PLAN, 0)
+                         ELSE 0
+                     END  AS PLAN_12
+                  , CASE WHEN A.PMONTH = '12' THEN NVL(A.PFMC, 0)
+                         ELSE 0
+                     END  AS PFMC_12
+                  , CASE WHEN A.PMONTH = '12' THEN NVL(A.PFMC_RV, 0)
+                         ELSE 0
+                     END  AS PFMC_RV_12
+                  , CASE WHEN A.PMONTH = '12' THEN NVL(A.FCST, 0)
+                         ELSE 0
+                     END  AS FCST_12
+            FROM (
+                   /* 1 매출액 */
+                   SELECT  CMPN_CD                             /* 회사 코드                       */
+                         , PYEAR                               /* 기준 연도                       */
+                         , PMONTH                              /* 기준 월                          */
+                         , CCGRP_GB_CD                         /* 사업본부 구분코드[EI002] */
+                         , 'SLAMT'        AS GB_CD
+                         , '매출액'         AS GB_NM
+                         , 'SLAMT'        AS DTL_GB_CD
+                         , '매출액'         AS DTL_GB_NM
+                         , 1              AS SORT_NUM
+                         , 1              AS DTL_SORT_NUM
+                         , SLAMT_PLAN     AS PLAN              /* 매출액 계획                     */
+                         , SLAMT_PFMC     AS PFMC              /* 매출액 실적                     */
+                         , SLAMT_PFMC_RV  AS PFMC_RV           /* 매출액 실적(보정)       */
+                         , SLAMT_FCST     AS FCST              /* 매출액 전망                     */
+                   FROM EIS_MI_PL_ETEC       /* EIS) 경영정보 - 손익(이테크) */
+                   WHERE CMPN_CD = #{cmpnCd}  /* 회사 코드 */
+                     AND PYEAR = #{pyear}     /* 기준 연도 */
+                   UNION ALL
+                   /* 2 매출원가 */
+                   SELECT  CMPN_CD
+                         , PYEAR
+                         , PMONTH
+                         , CCGRP_GB_CD
+                         , 'SLPCOST'   AS GB_CD
+                         , '매출원가'    AS GB_NM
+                         , 'SLPCOST'   AS DTL_GB_CD
+                         , '매출원가'    AS DTL_GB_CD
+                         , 2           AS SORT_NUM
+                         , 1           AS DTL_SORT_NUM
+                         , SLPCOST_PLAN                        /* 매출원가 계획                   */
+                         , SLPCOST_PFMC                        /* 매출원가 실적                   */
+                         , SLPCOST_PFMC_RV                     /* 매출원가 실적(보정)      */
+                         , SLPCOST_FCST                        /* 매출원가 전망                   */
+                   FROM EIS_MI_PL_ETEC       /* EIS) 경영정보 - 손익(이테크) */
+                   WHERE CMPN_CD = #{cmpnCd}  /* 회사 코드 */
+                     AND PYEAR = #{pyear}     /* 기준 연도 */
+                   UNION ALL
+                   /* 3 매출총이익 */
+                   SELECT  CMPN_CD
+                         , PYEAR
+                         , PMONTH
+                         , CCGRP_GB_CD
+                         , 'SLPROF'     AS GB_CD
+                         , '매출총이익'    AS GB_NM
+                         , 'SLPROF'     AS DTL_GB_CD
+                         , '매출총이익'    AS DTL_GB_CD
+                         , 3            AS SORT_NUM_NUM
+                         , 1            AS DTL_SORT_NUM
+                         , SLPROF_PLAN                         /* 매출총이익 계획                 */
+                         , SLPROF_PFMC                         /* 매출총이익 실적                 */
+                         , SLPROF_PFMC_RV                      /* 매출총이익 실적(보정)     */
+                         , SLPROF_FCST                         /* 매출총이익 전망                 */
+                   FROM EIS_MI_PL_ETEC       /* EIS) 경영정보 - 손익(이테크) */
+                   WHERE CMPN_CD = #{cmpnCd}  /* 회사 코드 */
+                     AND PYEAR = #{pyear}     /* 기준 연도 */
+                   UNION ALL
+                   /* 4 판매관리비 사업부 */
+                   SELECT  CMPN_CD
+                         , PYEAR
+                         , PMONTH
+                         , CCGRP_GB_CD
+                         , 'SMCOST'     AS GB_CD
+                         , '판매관리비'    AS GB_NM
+                         , 'SMCOST_BZ'  AS DTL_GB_CD
+                         , '사업부'       AS DTL_GB_CD
+                         , 4            AS SORT_NUM
+                         , 1            AS DTL_SORT_NUM
+                         , SMCOST_BZ_PLAN                     /* 판매관리비 사업부 계획            */
+                         , SMCOST_BZ_PFMC                     /* 판매관리비 사업부 실적            */
+                         , SMCOST_BZ_PFMC_RV                  /* 판매관리비 사업부 실적(보정)  */
+                         , SMCOST_BZ_FCST                     /* 판매관리비 사업부 전망            */
+                   FROM EIS_MI_PL_ETEC       /* EIS) 경영정보 - 손익(이테크) */
+                   WHERE CMPN_CD = #{cmpnCd}  /* 회사 코드 */
+                     AND PYEAR = #{pyear}     /* 기준 연도 */
+                   UNION ALL
+                   /* 5 판매관리비 지원부서 */
+                   SELECT  CMPN_CD
+                         , PYEAR
+                         , PMONTH
+                         , CCGRP_GB_CD
+                         , 'SMCOST'      AS GB_CD
+                         , '판매관리비'     AS GB_NM
+                         , 'SMCOST_SPT'  AS DTL_GB_CD
+                         , '지원부서'      AS DTL_GB_CD
+                         , 4             AS SORT_NUM
+                         , 2             AS DTL_SORT_NUM
+                         , SMCOST_SPT_PLAN                   /* 판매관리비 지원부서 계획            */
+                         , SMCOST_SPT_PFMC                   /* 판매관리비 지원부서 실적            */
+                         , SMCOST_SPT_PFMC_RV                /* 판매관리비 지원부서 실적(보정)  */
+                         , SMCOST_SPT_FCST                   /* 판매관리비 지원부서 전망            */
+                   FROM EIS_MI_PL_ETEC       /* EIS) 경영정보 - 손익(이테크) */
+                   WHERE CMPN_CD = #{cmpnCd}  /* 회사 코드 */
+                     AND PYEAR = #{pyear}     /* 기준 연도 */
+                   UNION ALL
+                   /* 6 판매관리비 일시적비용 */
+                   SELECT  CMPN_CD
+                         , PYEAR
+                         , PMONTH
+                         , CCGRP_GB_CD
+                         , 'SMCOST'      AS GB_CD
+                         , '판매관리비'     AS GB_NM
+                         , 'SMCOST_TMP'  AS DTL_GB_CD
+                         , '일시적비용'     AS DTL_GB_CD
+                         , 4             AS SORT_NUM
+                         , 3             AS DTL_SORT_NUM
+                         , SMCOST_TMP_PLAN                  /* 판매관리비 일시적비용 계획          */
+                         , SMCOST_TMP_PFMC                  /* 판매관리비 일시적비용 실적          */
+                         , SMCOST_TMP_PFMC_RV               /* 판매관리비 일시적비용 실적(보정) */
+                         , SMCOST_TMP_FCST                  /* 판매관리비 일시적비용 전망          */
+                   FROM EIS_MI_PL_ETEC       /* EIS) 경영정보 - 손익(이테크) */
+                   WHERE CMPN_CD = #{cmpnCd}  /* 회사 코드 */
+                     AND PYEAR = #{pyear}     /* 기준 연도 */
+                   UNION ALL
+                   /* 7 판매관리비 자체사업비용 */
+                   SELECT  CMPN_CD
+                         , PYEAR
+                         , PMONTH
+                         , CCGRP_GB_CD
+                         , 'SMCOST'         AS GB_CD
+                         , '판매관리비'        AS GB_NM
+                         , 'SMCOST_ONSF'    AS DTL_GB_CD
+                         , '자체사업비용'      AS DTL_GB_CD
+                         , 4                AS SORT_NUM
+                         , 4                AS DTL_SORT_NUM
+                         , SMCOST_ONSL_PLAN                   /* 판매관리비 자체사업비용 계획          */
+                         , SMCOST_ONSL_PFMC                   /* 판매관리비 자체사업비용 실적          */
+                         , SMCOST_ONSL_PFMC_RV                /* 판매관리비 자체사업비용 실적(보정) */
+                         , SMCOST_ONSL_FCST                   /* 판매관리비 자체사업비용 전망          */
+                   FROM EIS_MI_PL_ETEC       /* EIS) 경영정보 - 손익(이테크) */
+                   WHERE CMPN_CD = #{cmpnCd}  /* 회사 코드 */
+                     AND PYEAR = #{pyear}     /* 기준 연도 */
+                   UNION ALL
+                   /* 8 판매관리비 */
+                   SELECT  CMPN_CD
+                         , PYEAR
+                         , PMONTH
+                         , CCGRP_GB_CD
+                         , 'SMCOST'      AS GB_CD
+                         , '판매관리비'     AS GB_NM
+                         , 'SMCOST'      AS DTL_GB_CD
+                         , '판매관리비'     AS DTL_GB_CD
+                         , 4             AS SORT_NUM
+                         , 5             AS DTL_SORT_NUM
+                         , SMCOST_PLAN                         /* 판매관리비 계획                 */
+                         , SMCOST_PFMC                         /* 판매관리비 실적                 */
+                         , SMCOST_PFMC_RV                      /* 판매관리비 실적(보정)     */
+                         , SMCOST_FCST                         /* 판매관리비 전망                 */
+                   FROM EIS_MI_PL_ETEC       /* EIS) 경영정보 - 손익(이테크) */
+                   WHERE CMPN_CD = #{cmpnCd}  /* 회사 코드 */
+                     AND PYEAR = #{pyear}     /* 기준 연도 */
+                   UNION ALL
+                   /* 9 영업이익 */
+                   SELECT  CMPN_CD
+                         , PYEAR
+                         , PMONTH
+                         , CCGRP_GB_CD
+                         , 'BZPROF'       AS GB_CD
+                         , '영업이익'       AS GB_NM
+                         , 'BZPROF'       AS DTL_GB_CD
+                         , '영업이익'       AS DTL_GB_CD
+                         , 5              AS SORT_NUM
+                         , 1              AS DTL_SORT_NUM
+                         , BZPROF_PLAN                     /* 영업이익 계획                   */
+                         , BZPROF_PFMC                     /* 영업이익 실적                   */
+                         , BZPROF_PFMC_RV                  /* 영업이익 실적(보정)      */
+                         , BZPROF_FCST                     /* 영업이익 전망                   */
+                   FROM EIS_MI_PL_ETEC       /* EIS) 경영정보 - 손익(이테크) */
+                   WHERE CMPN_CD = #{cmpnCd}  /* 회사 코드 */
+                     AND PYEAR = #{pyear}     /* 기준 연도 */
+                   ) A
+            ) A
+     WHERE 1 = 1
+       <if test="ccgrpGbCd != 'all' and ccgrpGbCd != ''">
+       AND A.CCGRP_GB_CD = #{ccgrpGbCd}                 /* 사업본부 구분코드[EI002] */   
+       </if>
+     GROUP BY A.CMPN_CD                                 /* 회사 코드                       */
+            , A.PYEAR                                   /* 기준 연도                        */
+            , A.CCGRP_GB_CD                             /* 사업본부 구분코드[EI002] */
+            , A.GB_CD                                   /* 구분 코드                        */  
+            , A.DTL_GB_CD                               /* 구분 코드(상세)         */ 
+     ORDER BY A.CCGRP_GB_CD
+            , MIN(A.SORT_NUM)
+            , MIN(A.DTL_SORT_NUM)
     </select>
     </select>
 	
 	
     <update id="update1">
     <update id="update1">