내정보 > 최근 일계부 날짜 수정

This commit is contained in:
주수현
2025-06-20 13:50:43 +09:00
parent d775238165
commit 68039e2b34
3 changed files with 42 additions and 31 deletions

View File

@@ -2,6 +2,8 @@ package app.module.core.usecase.household.getHousehold.ports.application.domain;
import app.module.core.config.adapters.web.security.domain.CoreRole;
import app.module.core.config.application.enums.SignUpType;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Set;
import lombok.AllArgsConstructor;
@@ -34,6 +36,8 @@ public class GetHousehold {
private Boolean isPanel;
private String memo;
private String dropReason;
private LocalDate latestRegisterStartDate;
private LocalDate latestRegisterEndDate;
private LocalDateTime createdAt;
private String createdBy;
private LocalDateTime updatedAt;

View File

@@ -7,32 +7,39 @@
<select id="findByHouseholdNum"
resultType="app.module.core.usecase.household.getHousehold.ports.application.domain.GetHousehold">
SELECT
seq,
household_num,
owner_name,
owner_age,
tel,
phone,
password,
region_main_code,
region_sub_code,
region_detail_code,
address,
industry_large_code,
industry_middle_code,
industry_sub_middle,
industry_detail,
employment_code,
is_panel,
memo,
drop_reason,
created_at,
created_by,
updated_at,
updated_by
FROM household
WHERE household_num = #{householdNum}
AND is_deleted = false
h.seq,
h.household_num,
h.owner_name,
h.owner_age,
h.tel,
h.phone,
h.password,
h.region_main_code,
h.region_sub_code,
h.region_detail_code,
h.address,
h.industry_large_code,
h.industry_middle_code,
h.industry_sub_middle,
h.industry_detail,
h.employment_code,
h.is_panel,
h.memo,
h.drop_reason,
dr.start_date as latest_register_start_date,
dr.end_date as latest_register_end_date,
h.created_at,
h.created_by,
h.updated_at,
h.updated_by
FROM household h
LEFT JOIN (
SELECT start_date , end_date ,household_seq
FROM daily_record dr
ORDER BY start_date desc
LIMIT 1 ) dr ON dr.household_seq = h.seq
WHERE h.household_num = #{householdNum}
AND h.is_deleted = false
</select>
<resultMap id="HouseholdRoleHasPrivilegesMap" type="app.module.core.config.adapters.web.security.domain.CoreRole">
@@ -54,6 +61,7 @@
JOIN role r ON hhr.role_id = r.id AND r.is_deleted = false
LEFT JOIN role_has_privilege rhp ON r.id = rhp.role_id AND rhp.is_deleted = false
LEFT JOIN privilege p ON rhp.privilege_id = p.id AND p.is_deleted = false
LEFT JOIN daily_record dr ON dr.household_seq = hhr.household_seq
WHERE hhr.household_seq = #{seq}
AND hhr.is_deleted = false
</select>