[BO] 수정 반영

This commit is contained in:
kangsunlee
2025-07-14 17:46:15 +09:00
parent 52b962fcf4
commit cb8525c7b2
16 changed files with 121 additions and 72 deletions

View File

@@ -106,11 +106,11 @@
from household h
join researcher_has_household rhh ON h.seq = rhh.household_seq and rhh.is_deleted = false
join admin a ON a.seq = rhh.admin_seq and a.is_deleted = false
left join uicode rm ON rm.parent_id = 'code.region.main' AND rm.id = h.region_main_code
left join uicode rs ON rs.parent_id = 'code.region.sub' AND rs.id = h.region_sub_code
left join uicode rm ON rm.id = h.region_main_code
left join uicode rs ON rs.id = h.region_sub_code
left join uicode rd ON rd.id = h.region_detail_code
left join uicode il ON il.parent_id = 'code.industry.large' AND il.id = h.industry_large_code
left join uicode im ON im.parent_id = 'code.industry.middle' AND im.id = h.industry_middle_code
left join uicode il ON il.id = h.industry_large_code
left join uicode im ON im.id = h.industry_middle_code
where 1=1
<if test="seq > 0">
and rhh.admin_seq = #{seq}
@@ -156,6 +156,7 @@
<if test="searchMonth != null and searchMonth != ''">
and TO_CHAR(rhv.visit_date ,'YYYYMM')= #{searchMonth}
</if>
order by rhv.visit_date
</select>
<select id="selectVisitHouseholdPercentage">
@@ -245,6 +246,17 @@
where rhv.is_deleted = false and rhv.id = #{id}
</select>
<update id="updateGiftSentToFalse">
/* updateGiftSentToFalse : 동일 household_seq 의 다른 방문 중 전달여부 true → false */
UPDATE household_visit
SET is_gift_sent = false
WHERE household_seq = #{householdSeq}
AND TO_CHAR(visit_date, 'YYYYMM') = TO_CHAR(#{visitDate}, 'YYYYMM')
AND is_gift_sent = true
AND (#{id} IS NULL OR id != #{id})
AND is_deleted = false
</update>
<update id="updateVisitHousehold">
update household_visit
set visit_date = #{visitDate},