|
@@ -2,255 +2,7 @@
|
|
|
<!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.ei0106.persistence.EI01060001UMapper">
|
|
|
-
|
|
|
- <!-- <select id="getList" resultType="easyHashMap">
|
|
|
- SELECT A.CMPN_CD /* 회사 코드 */
|
|
|
- , A.PYEAR /* 기준 연도 */
|
|
|
- , A.PMONTH /* 기준 월 */
|
|
|
- , A.GB_CD /* 구분 */
|
|
|
- , MIN(A.GB_NM) AS GB_NM /* 구분명 */
|
|
|
- , MIN(A.SORT_NUM) AS SORT_NUM /* 정렬 순번 */
|
|
|
- , SUM(AMT_100) AS AMT_100 /* 그룹사 별 원금액 */
|
|
|
- , SUM(AMT_RV_100) AS AMT_RV_100 /* 그룹사 별 보정 금액 */
|
|
|
- , SUM(AMT_200) AS AMT_200
|
|
|
- , SUM(AMT_RV_200) AS AMT_RV_200
|
|
|
- , SUM(AMT_300) AS AMT_300
|
|
|
- , SUM(AMT_RV_300) AS AMT_RV_300
|
|
|
- , SUM(AMT_400) AS AMT_400
|
|
|
- , SUM(AMT_RV_400) AS AMT_RV_400
|
|
|
- , SUM(AMT_500) AS AMT_500
|
|
|
- , SUM(AMT_RV_500) AS AMT_RV_500
|
|
|
- , SUM(AMT_600) AS AMT_600
|
|
|
- , SUM(AMT_RV_600) AS AMT_RV_600
|
|
|
- , SUM(AMT_700) AS AMT_700
|
|
|
- , SUM(AMT_RV_700) AS AMT_RV_700
|
|
|
- FROM (
|
|
|
- SELECT A.CMPN_CD
|
|
|
- , A.PYEAR
|
|
|
- , A.PMONTH
|
|
|
- , A.GB_CD
|
|
|
- , A.GB_NM
|
|
|
- , A.SORT_NUM
|
|
|
- , A.GRPCOMP_GB_CD
|
|
|
- , CASE WHEN A.GRPCOMP_GB_CD = '100' THEN NVL(A.AMT, 0)
|
|
|
- ELSE 0
|
|
|
- END AS AMT_100 /* 연결, 유동자산 */
|
|
|
- , CASE WHEN A.GRPCOMP_GB_CD = '100' THEN NVL(A.AMT_RV, 0)
|
|
|
- ELSE 0
|
|
|
- END AS AMT_RV_100 /* 연결, 비유동자산 */
|
|
|
- , CASE WHEN A.GRPCOMP_GB_CD = '200' THEN NVL(A.AMT, 0)
|
|
|
- ELSE 0
|
|
|
- END AS AMT_200
|
|
|
- , CASE WHEN A.GRPCOMP_GB_CD = '200' THEN NVL(A.AMT_RV, 0)
|
|
|
- ELSE 0
|
|
|
- END AS AMT_RV_200
|
|
|
- , CASE WHEN A.GRPCOMP_GB_CD = '300' THEN NVL(A.AMT, 0)
|
|
|
- ELSE 0
|
|
|
- END AS AMT_300
|
|
|
- , CASE WHEN A.GRPCOMP_GB_CD = '300' THEN NVL(A.AMT_RV, 0)
|
|
|
- ELSE 0
|
|
|
- END AS AMT_RV_300
|
|
|
- , CASE WHEN A.GRPCOMP_GB_CD = '400' THEN NVL(A.AMT, 0)
|
|
|
- ELSE 0
|
|
|
- END AS AMT_400
|
|
|
- , CASE WHEN A.GRPCOMP_GB_CD = '400' THEN NVL(A.AMT_RV, 0)
|
|
|
- ELSE 0
|
|
|
- END AS AMT_RV_400
|
|
|
- , CASE WHEN A.GRPCOMP_GB_CD = '500' THEN NVL(A.AMT, 0)
|
|
|
- ELSE 0
|
|
|
- END AS AMT_500
|
|
|
- , CASE WHEN A.GRPCOMP_GB_CD = '500' THEN NVL(A.AMT_RV, 0)
|
|
|
- ELSE 0
|
|
|
- END AS AMT_RV_500
|
|
|
- , CASE WHEN A.GRPCOMP_GB_CD = '600' THEN NVL(A.AMT, 0)
|
|
|
- ELSE 0
|
|
|
- END AS AMT_600
|
|
|
- , CASE WHEN A.GRPCOMP_GB_CD = '600' THEN NVL(A.AMT_RV, 0)
|
|
|
- ELSE 0
|
|
|
- END AS AMT_RV_600
|
|
|
- , CASE WHEN A.GRPCOMP_GB_CD = '700' THEN NVL(A.AMT, 0)
|
|
|
- ELSE 0
|
|
|
- END AS AMT_700
|
|
|
- , CASE WHEN A.GRPCOMP_GB_CD = '700' THEN NVL(A.AMT_RV, 0)
|
|
|
- ELSE 0
|
|
|
- END AS AMT_RV_700
|
|
|
- FROM (
|
|
|
- SELECT CMPN_CD /* 회사 코드 */
|
|
|
- , PYEAR /* 기준 연도 */
|
|
|
- , PMONTH /* 기준 월 */
|
|
|
- , GRPCOMP_GB_CD /* 그룹사 구분코드[EI001] */
|
|
|
- , 'ASSET' AS GB_CD /* 구분 */
|
|
|
- , '자산' AS GB_NM /* 구분명 */
|
|
|
- , NVL(ASSET_CURR_AMT, 0) + NVL(ASSET_NCURR_AMT, 0) AS AMT /* 자산 */
|
|
|
- , NVL(ASSET_CURR_AMT_RV, 0) + NVL(ASSET_NCURR_AMT_RV, 0) AS AMT_RV /* 보정 */
|
|
|
- , 1 AS SORT_NUM
|
|
|
- FROM EIS_MI_FISTMT /* EIS) 경영정보 - 요약재무제표 */
|
|
|
- WHERE CMPN_CD = #{cmpnCd} /* 회사 코드 */
|
|
|
- AND PYEAR = #{pyear} /* 기준 연도 */
|
|
|
- AND PMONTH = #{pmonth} /* 그룹사 구분코드[EI001] */
|
|
|
- UNION ALL
|
|
|
- SELECT CMPN_CD
|
|
|
- , PYEAR
|
|
|
- , PMONTH
|
|
|
- , GRPCOMP_GB_CD
|
|
|
- , 'ASSET_CURR' AS GB_CD
|
|
|
- , '유동자산' AS GB_NM
|
|
|
- , ASSET_CURR_AMT
|
|
|
- , ASSET_CURR_AMT_RV
|
|
|
- , 2 AS SORT_NUM
|
|
|
- FROM EIS_MI_FISTMT /* EIS) 경영정보 - 요약재무제표 */
|
|
|
- WHERE CMPN_CD = #{cmpnCd} /* 회사 코드 */
|
|
|
- AND PYEAR = #{pyear} /* 기준 연도 */
|
|
|
- AND PMONTH = #{pmonth}
|
|
|
- UNION ALL
|
|
|
- SELECT CMPN_CD
|
|
|
- , PYEAR
|
|
|
- , PMONTH
|
|
|
- , GRPCOMP_GB_CD
|
|
|
- , 'ASSET_NCURR' AS GB_CD
|
|
|
- , '비유동자산' AS GB_NM
|
|
|
- , ASSET_NCURR_AMT
|
|
|
- , ASSET_NCURR_AMT_RV
|
|
|
- , 3 AS SORT_NUM
|
|
|
- FROM EIS_MI_FISTMT /* EIS) 경영정보 - 요약재무제표 */
|
|
|
- WHERE CMPN_CD = #{cmpnCd} /* 회사 코드 */
|
|
|
- AND PYEAR = #{pyear} /* 기준 연도 */
|
|
|
- AND PMONTH = #{pmonth}
|
|
|
- UNION ALL
|
|
|
- SELECT CMPN_CD
|
|
|
- , PYEAR
|
|
|
- , PMONTH
|
|
|
- , GRPCOMP_GB_CD
|
|
|
- , 'ASSET_CASH' AS GB_CD
|
|
|
- , 'CASH' AS GB_NM
|
|
|
- , ASSET_CASH_AMT
|
|
|
- , ASSET_CASH_AMT_RV
|
|
|
- , 4 AS SORT_NUM
|
|
|
- FROM EIS_MI_FISTMT /* EIS) 경영정보 - 요약재무제표 */
|
|
|
- WHERE CMPN_CD = #{cmpnCd} /* 회사 코드 */
|
|
|
- AND PYEAR = #{pyear} /* 기준 연도 */
|
|
|
- AND PMONTH = #{pmonth}
|
|
|
- UNION ALL
|
|
|
- SELECT CMPN_CD
|
|
|
- , PYEAR
|
|
|
- , PMONTH
|
|
|
- , GRPCOMP_GB_CD
|
|
|
- , 'LIAB' AS GB_CD
|
|
|
- , '부채' AS GB_NM
|
|
|
- , NVL(LIAB_CURR_AMT, 0) + NVL(LIAB_NCURR_AMT, 0) AS LIAB_AMT
|
|
|
- , NVL(LIAB_CURR_AMT_RV, 0) + NVL(LIAB_NCURR_AMT_RV, 0) AS LIAB_AMT
|
|
|
- , 5 AS SORT_NUM
|
|
|
- FROM EIS_MI_FISTMT /* EIS) 경영정보 - 요약재무제표 */
|
|
|
- WHERE CMPN_CD = #{cmpnCd} /* 회사 코드 */
|
|
|
- AND PYEAR = #{pyear} /* 기준 연도 */
|
|
|
- AND PMONTH = #{pmonth}
|
|
|
- UNION ALL
|
|
|
- SELECT CMPN_CD
|
|
|
- , PYEAR
|
|
|
- , PMONTH
|
|
|
- , GRPCOMP_GB_CD
|
|
|
- , 'LIAB_CURR' AS GB_CD
|
|
|
- , '유동부채' AS GB_NM
|
|
|
- , LIAB_CURR_AMT
|
|
|
- , LIAB_CURR_AMT_RV
|
|
|
- , 6 AS SORT_NUM
|
|
|
- FROM EIS_MI_FISTMT /* EIS) 경영정보 - 요약재무제표 */
|
|
|
- WHERE CMPN_CD = #{cmpnCd} /* 회사 코드 */
|
|
|
- AND PYEAR = #{pyear} /* 기준 연도 */
|
|
|
- AND PMONTH = #{pmonth}
|
|
|
- UNION ALL
|
|
|
- SELECT CMPN_CD
|
|
|
- , PYEAR
|
|
|
- , PMONTH
|
|
|
- , GRPCOMP_GB_CD
|
|
|
- , 'LIAB_NCURR' AS GB_CD
|
|
|
- , '비유동부채' AS GB_NM
|
|
|
- , LIAB_NCURR_AMT
|
|
|
- , LIAB_NCURR_AMT_RV
|
|
|
- , 7 AS SORT_NUM
|
|
|
- FROM EIS_MI_FISTMT /* EIS) 경영정보 - 요약재무제표 */
|
|
|
- WHERE CMPN_CD = #{cmpnCd} /* 회사 코드 */
|
|
|
- AND PYEAR = #{pyear} /* 기준 연도 */
|
|
|
- AND PMONTH = #{pmonth}
|
|
|
- UNION ALL
|
|
|
- SELECT CMPN_CD
|
|
|
- , PYEAR
|
|
|
- , PMONTH
|
|
|
- , GRPCOMP_GB_CD
|
|
|
- , 'LIAB_BR' AS GB_CD
|
|
|
- , '차입금' AS GB_NM
|
|
|
- , LIAB_BR_AMT
|
|
|
- , LIAB_BR_AMT_RV
|
|
|
- , 8 AS SORT_NUM
|
|
|
- FROM EIS_MI_FISTMT /* EIS) 경영정보 - 요약재무제표 */
|
|
|
- WHERE CMPN_CD = #{cmpnCd} /* 회사 코드 */
|
|
|
- AND PYEAR = #{pyear} /* 기준 연도 */
|
|
|
- AND PMONTH = #{pmonth}
|
|
|
- UNION ALL
|
|
|
- SELECT CMPN_CD
|
|
|
- , PYEAR
|
|
|
- , PMONTH
|
|
|
- , GRPCOMP_GB_CD
|
|
|
- , 'CAPITAL' AS GB_CD
|
|
|
- , '자본' AS GB_NM /* 구분명 */
|
|
|
- , (NVL(ASSET_CURR_AMT, 0) + NVL(ASSET_NCURR_AMT, 0)) - (NVL(LIAB_CURR_AMT, 0) + NVL(LIAB_NCURR_AMT, 0)) AS CAPITAL_AMT /* (자본) 자산 - 부채 */
|
|
|
- , (NVL(ASSET_CURR_AMT_RV, 0) + NVL(ASSET_NCURR_AMT_RV, 0)) - (NVL(LIAB_CURR_AMT_RV, 0) + NVL(LIAB_NCURR_AMT_RV, 0)) AS CAPITAL_AMT_RV
|
|
|
- , 9 AS SORT_NUM
|
|
|
- FROM EIS_MI_FISTMT /* EIS) 경영정보 - 요약재무제표 */
|
|
|
- WHERE CMPN_CD = #{cmpnCd} /* 회사 코드 */
|
|
|
- AND PYEAR = #{pyear} /* 기준 연도 */
|
|
|
- AND PMONTH = #{pmonth}
|
|
|
- UNION ALL
|
|
|
- SELECT CMPN_CD
|
|
|
- , PYEAR
|
|
|
- , PMONTH
|
|
|
- , GRPCOMP_GB_CD
|
|
|
- , 'INTE_COST' AS GB_CD
|
|
|
- , '이자비용' AS GB_NM
|
|
|
- , INTE_COST_AMT
|
|
|
- , INTE_COST_AMT_RV
|
|
|
- , 10 AS SORT_NUM
|
|
|
- FROM EIS_MI_FISTMT /* EIS) 경영정보 - 요약재무제표 */
|
|
|
- WHERE CMPN_CD = #{cmpnCd} /* 회사 코드 */
|
|
|
- AND PYEAR = #{pyear} /* 기준 연도 */
|
|
|
- AND PMONTH = #{pmonth}
|
|
|
- UNION ALL
|
|
|
- SELECT CMPN_CD
|
|
|
- , PYEAR
|
|
|
- , PMONTH
|
|
|
- , GRPCOMP_GB_CD
|
|
|
- , 'NINCM' AS GB_CD
|
|
|
- , '당기순이익' AS GB_NM
|
|
|
- , NINCM_AMT /* 당기순이익 */
|
|
|
- , NINCM_AMT_RV
|
|
|
- , 11 AS SORT_NUM
|
|
|
- FROM EIS_MI_FISTMT /* EIS) 경영정보 - 요약재무제표 */
|
|
|
- WHERE CMPN_CD = #{cmpnCd} /* 회사 코드 */
|
|
|
- AND PYEAR = #{pyear} /* 기준 연도 */
|
|
|
- AND PMONTH = #{pmonth}
|
|
|
- UNION ALL
|
|
|
- SELECT CMPN_CD
|
|
|
- , PYEAR
|
|
|
- , PMONTH
|
|
|
- , GRPCOMP_GB_CD
|
|
|
- , 'CAPIT_LIAB_SUM' AS GB_CD
|
|
|
- , '자본 및 부채 총계' AS GB_NM
|
|
|
- , (NVL(ASSET_CURR_AMT, 0) + NVL(ASSET_NCURR_AMT, 0)) - (NVL(LIAB_CURR_AMT, 0) + NVL(LIAB_NCURR_AMT, 0)) + (NVL(LIAB_CURR_AMT, 0) + NVL(LIAB_NCURR_AMT, 0)) AS CAPIT_LIAB_SUM_AMT /* (자본 및 부채 총계) 자본 + 부채 */
|
|
|
- , (NVL(ASSET_CURR_AMT_RV, 0) + NVL(ASSET_NCURR_AMT_RV, 0)) - (NVL(LIAB_CURR_AMT_RV, 0) + NVL(LIAB_NCURR_AMT_RV, 0)) + (NVL(LIAB_CURR_AMT_RV, 0) + NVL(LIAB_NCURR_AMT_RV, 0)) AS CAPIT_LIAB_SUM_AMT_RV
|
|
|
- , 12 AS SORT_NUM
|
|
|
- FROM EIS_MI_FISTMT /* EIS) 경영정보 - 요약재무제표 */
|
|
|
- WHERE CMPN_CD = #{cmpnCd} /* 회사 코드 */
|
|
|
- AND PYEAR = #{pyear} /* 기준 연도 */
|
|
|
- AND PMONTH = #{pmonth}
|
|
|
- ) A
|
|
|
- ) A
|
|
|
- GROUP BY A.CMPN_CD
|
|
|
- , A.PYEAR
|
|
|
- , A.PMONTH
|
|
|
- , A.GB_CD
|
|
|
- ORDER BY MIN(A.SORT_NUM)
|
|
|
- </select> -->
|
|
|
- <!-- PIVOT SQL 변경 -->
|
|
|
+
|
|
|
<select id="getList" resultType="easyHashMap">
|
|
|
SELECT *
|
|
|
FROM (
|