Merge branch 'susu' into dev

This commit is contained in:
주수현
2025-06-16 19:04:19 +09:00
9 changed files with 106 additions and 62 deletions

View File

@@ -83,16 +83,16 @@
im.code_text AS industry_middle_code_name,
case h.is_panel when false then '유지' when true then '탈락' end panel_flag
from household h
join admin_has_role ahr ON h.seq = ahr.admin_seq
join researcher_has_household rhh ON h.seq = rhh.household_seq and rhh.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 rd ON rd.parent_id = 'code.region.detail' AND 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
where ahr.role_id = 'ROLE_RESEARCHER' and ahr.is_deleted = false
<if test="seq > 0">
and ahr.admin_seq = #{seq}
</if>
where 1=1
<if test="seq > 0">
and rhh.admin_seq = #{seq}
</if>
LIMIT #{size} OFFSET #{page}*#{size}
</select>
@@ -100,10 +100,10 @@
select
count(*)
from household h
join admin_has_role ahr ON h.seq = ahr.admin_seq
where ahr.role_id = 'ROLE_RESEARCHER' and ahr.is_deleted = false
join researcher_has_household rhh ON h.seq = rhh.household_seq and rhh.is_deleted = false
where 1=1
<if test="seq > 0">
and ahr.admin_seq = #{seq}
and rhh.admin_seq = #{seq}
</if>
</select>
@@ -155,4 +155,31 @@
</foreach>)
</update>
<update id="deleteHouseholdResearcherMapping">
update researcher_has_household
set is_deleted = true,
deleted_at = NOW(),
deleted_by = #{deletedBy}
where household_seq = #{householdSeq}
</update>
<update id="insertHouseholdResearcherMapping">
insert into researcher_has_household(
id,
admin_seq,
household_seq,
created_at,
created_by,
updated_at,
updated_by
)values(
nextval('household_has_role_seq'),
#{researcherSeq},
#{householdSeq},
NOW(),
#{createdBy},
NOW(),
#{createdBy}
)
</update>
</mapper>