[BO] 임가 현황 리스트 service 원복

This commit is contained in:
kangsunlee
2025-06-16 20:13:20 +09:00
parent d8f35f6617
commit 5203d7000e
3 changed files with 14 additions and 52 deletions

View File

@@ -7,22 +7,20 @@
<select id="getHouseholdsStatus"
resultType="app.module.admin.usecase.household.getHouseholdsStatus.ports.application.domain.GetHouseholdsStatus">
/* getHouseholdsStatus : 임가현황 리스트 조회 */
<if test="!(cmd.viewType eq 'popup')">
WITH record_progress AS (
SELECT ROUND(
100.0 *
WITH record_progress AS (
SELECT ROUND(
100.0 *
(SELECT COUNT(*)
FROM daily_record
WHERE record_month = #{cmd.recordMonth} AND all_status = 'DONE')
/ NULLIF(
(SELECT COUNT(*)
FROM daily_record
WHERE record_month = #{cmd.recordMonth} AND all_status = 'DONE')
/ NULLIF(
(SELECT COUNT(*)
FROM daily_day_group
WHERE end_day &lt;= EXTRACT(DAY FROM CURRENT_DATE)), 0
),
2
) AS progress_percent
) /* 일계부 입력 진행 완료 퍼센테이지 (이번달 작성 완료일 수 / 현재날짜 기준 전체 입력 가능 날짜 수) */
</if>
FROM daily_day_group
WHERE end_day &lt;= EXTRACT(DAY FROM CURRENT_DATE)), 0
),
2
) AS progress_percent
) /* 일계부 입력 진행 완료 퍼센테이지 (이번달 작성 완료일 수 / 현재날짜 기준 전체 입력 가능 날짜 수) */
SELECT
hvr.*,
COUNT(*) OVER () AS total
@@ -43,12 +41,7 @@
h.industry_middle_code as industryMiddleCode,
h.industry_middle_name AS industryMiddleName,
h.is_panel AS isPanel,
<if test="!(cmd.viewType eq 'popup')">
ps.progress_percent AS progressPercent,
</if>
<if test="cmd.viewType eq 'popup'">
0 AS progressPercent,
</if>
v.first_visit_date AS firstVisitDate,
v.second_visit_date AS secondVisitDate,
COALESCE(v.is_gift_sent, false) AS isGiftSent,
@@ -57,9 +50,7 @@
FROM v_household_with_code h
LEFT JOIN v_household_visit v ON h.seq = v.household_seq
LEFT JOIN v_household_researcher r ON h.seq = r.household_seq
<if test="!(cmd.viewType eq 'popup')">
CROSS JOIN record_progress ps
</if>
) AS hvr
<where>
@@ -186,18 +177,6 @@
</when>
</choose>
</if>
<if test="cmd.isMapping != null">
/* 패널 유지 여부 */
<choose>
<when test="cmd.isMapping">
AND r.researcher_name is not null
</when>
<when test="!cmd.isMapping">
AND r.researcher_name is null
</when>
</choose>
</if>
</where>
ORDER BY hvr.householdNum ASC