메인페이지 실적조회 쿼리 성능 개선

master
강석 최 2022-04-13 10:37:03 +09:00
parent 8123b512e9
commit 61c133a7cc
1 changed files with 10 additions and 9 deletions

View File

@ -942,21 +942,18 @@
<!-- 내 실적 목록 -->
<select id="Report.selectMyList" parameterType="reportSearchVO" resultMap="reportMap">
select (ROW_NUMBER() OVER()) AS RNUM, a.*
select (ROW_NUMBER() OVER()) AS RNUM,
cat1.name AS inCategory1Str,
cat2.name AS inCategory2Str,
cat3.name AS inCategory3Str,
cat4.name AS inCategory4Str,
a.*
from (
select
(IN_PLACE_NAME || '외사-' || IN_PLACE_NUM) AS docNo,
cat1.name AS inCategory1Str,
cat2.name AS inCategory2Str,
cat3.name AS inCategory3Str,
cat4.name AS inCategory4Str,
RPT.*
FROM
RPT_INFO RPT
inner join Rpt_Category CAT1 on CAT1.type = 1 and cat1.code = rpt.IN_CATEGORY1
inner join Rpt_Category CAT2 on CAT2.type = 2 and cat2.code = rpt.IN_CATEGORY2
inner join Rpt_Category CAT3 on CAT3.type = 3 and cat3.code = rpt.IN_CATEGORY3
inner join Rpt_Category CAT4 on CAT4.type = 4 and cat4.code = rpt.IN_CATEGORY4
WHERE
IN_STATE_CODE != '99'
AND IN_TYPE = #{type}
@ -984,6 +981,10 @@
</if>
limit #{recordCountPerPage} offset #{firstIndex}
) a
inner join Rpt_Category CAT1 on CAT1.type = 1 and cat1.code = a.IN_CATEGORY1
inner join Rpt_Category CAT2 on CAT2.type = 2 and cat2.code = a.IN_CATEGORY2
inner join Rpt_Category CAT3 on CAT3.type = 3 and cat3.code = a.IN_CATEGORY3
inner join Rpt_Category CAT4 on CAT4.type = 4 and cat4.code = a.IN_CATEGORY4
</select>
<select id="Report.selectMyListCnt" parameterType="reportSearchVO" resultType="int">
<![CDATA[