260617_01_ENH: 배정 테스트를 위해 개발 중도 커밋

This commit is contained in:
2026-06-17 15:39:24 +09:00
parent 825282deab
commit 06e4569157
30 changed files with 1643 additions and 34 deletions

View File

@@ -5,22 +5,38 @@
<mapper namespace="com.kri.gwcf.review.back.persistence.mapper.kon.KonMapper">
<sql id="BaseDataSelect">
SELECT DISTINCT
JSON_VALUE(DJ.[VALUE], '$.SC') AS IDKEY,
DV.[value] AS performance_id
FROM [DATA] DA WITH(NOLOCK)
CROSS APPLY OPENJSON([DATJSON]) DJ
CROSS APPLY OPENJSON(DJ.[value]) DV
WHERE PKEY = '2605013_B'
AND [Status] = 10
AND JSON_VALUE(DJ.[VALUE], '$.SC') IS NOT NULL
AND JSON_VALUE(DJ.[VALUE], '$.SC') != ''
AND DV.[KEY] LIKE 'Q1%'
AND [SURVEY_TYPE] = #{surveyType}
</sql>
<select id="findPerformanceApplyCount" resultType="PerformanceApplyCountDto">
WITH Base AS (
<include refid="BaseDataSelect"/>
)
SELECT performance_id, COUNT(1) AS apply_cnt
FROM (
SELECT DISTINCT
JSON_VALUE(DJ.[VALUE], '$.SC') AS IDKEY,
DV.[value] AS performance_id
FROM [DATA] DA WITH(NOLOCK)
CROSS APPLY OPENJSON([DATJSON]) DJ
CROSS APPLY OPENJSON(DJ.[value]) DV
WHERE PKEY = '2605013_B'
AND [Status] = 10
AND JSON_VALUE(DJ.[VALUE], '$.SC') IS NOT NULL
AND DV.[KEY] LIKE 'Q1%'
AND [SURVEY_TYPE] = #{surveyType}
) A
FROM Base
GROUP BY performance_id
</select>
<select id="findPerformanceApplyUser" resultType="PerformanceApplyUserDto">
WITH Base AS (
<include refid="BaseDataSelect"/>
)
SELECT performance_id, IDKEY AS user_id
FROM Base
WHERE performance_id = #{performanceId}
GROUP BY performance_id, IDKEY
</select>
</mapper>