[FO] 일계부 월별현황 목록 Model 변경

This commit is contained in:
김현주
2025-06-16 12:18:33 +09:00
parent 132077a3c4
commit 152d5e5e42
11 changed files with 791 additions and 205 deletions

View File

@@ -19,43 +19,27 @@
<select id="getDailyRecordStatus"
resultType="app.module.front.usecase.daily.calendar.persistence.model.DailyRecordStatusDto">
select dr.id as daily_id
, dr.start_date, dr.end_date
, dr.day_group_no, dr.start_date, dr.end_date
, dr.all_status
, dr.income_status
, (select count(*) from daily_income di where di.daily_record_seq = dr.id and di.is_deleted = false) as income_count
, dr.work_status
, dr.expense_status
, dr.power_status
, dr.forestry_status
, dr.farming_status
, (select count(*) from daily_income di where di.daily_record_seq = dr.id and di.is_deleted = false) as income_count
, (select count(*) from daily_work dw where dw.daily_record_seq = dr.id and dw.is_deleted = false) as work_count
, (select count(*) from daily_expense de where de.daily_record_seq = dr.id and de.is_deleted = false) as expense_count
, (select count(*) from daily_power dp where dp.daily_record_seq = dr.id and dp.is_deleted = false) as power_count
, (select count(*) from daily_forestry df1 where df1.daily_record_seq = dr.id and df1.is_deleted = false) as forestry_count
, (select count(*) from daily_farming df2 where df2.daily_record_seq = dr.id and df2.is_deleted = false) as farming_count
from daily_record dr
where dr.is_deleted = false
and dr.household_seq = #{householdSeq}
and dr.record_month = #{searchMonth}
and dr.day_group_no = #{groupNo}
<if test="groupNo != null and groupNo != 'groupNo'">
and dr.day_group_no = #{groupNo}
</if>
</select>
<select id="getStartDayByDailyGroupNo"
resultType="int">
select ddg.start_day
from daily_day_group ddg
where ddg.is_deleted = false
and ddg.group_no = #{groupNo}
</select>
<select id="getDailyRecordExistCount"
resultType="int">
/* 일계부 데이터 존재 여부 getDailyRecordExistCount */
select count(*) as exist
from daily_record dr
where dr.household_seq = 2
and dr.is_deleted = false
and dr.record_month = '2025-06'
and dr.day_group_no = 3
</select>
<sql id="InnerJoinByDailyRecord">
/* TODO */
inner join daily_record dr on
dr.id = ds.daily_record_seq
and dr.is_deleted = false
and dr.recordMonth = #{recordMonth} and dr.day_group_no = #{dayGroupNo}
and dr.household_seq = #{householdSeq}
</sql>
</mapper>