[BO] 임가현황 등록 상세(수입, 지출) 엑셀다운로드

This commit is contained in:
김현주
2025-07-02 16:16:19 +09:00
parent c0f5e96476
commit edd33ffcc9
7 changed files with 218 additions and 17 deletions

View File

@@ -23,10 +23,15 @@
/* getDailyIncomeRecords : 일계부 등록 현황 상세 수입 조회 */
SELECT di.id, /* 수입 id */
di.input_type, /* 입력구분 */
di.category,
di.income_mark,
di.expense_mark,
di.is_credit, /* 외상판매여부 */
di.crop_code, /* 재배형태 코드 */
ui_crop.code_value AS crop_value, /* 재배형태 코드 값 */
ui_crop.code_text AS crop_text, /* 재배형태 코드 텍스트 */
di.income_kind, /* 수입의 종류 */
di.income_kind_mark,
di.source_purpose, /* 수입원(용도) */
di.quantity, /* 수량 */
di.unit_code, /* 단위 코드 */
@@ -39,6 +44,10 @@
di.estimated_value, /* 현물평가액 */
di.updated_by, /* 최종수정자 */
TO_CHAR(di.updated_at, 'YYYY-MM-DD HH24:MI') AS updated_at /* 최종수정날짜 */
<if test="recordSeq == null">
, ddg.start_day
, ddg.end_day
</if>
FROM daily_income di
LEFT JOIN uicode ui_crop
ON ui_crop.parent_id = 'code.record.crop'
@@ -46,9 +55,21 @@
LEFT JOIN uicode ui_unit
ON ui_unit.parent_id = 'code.record.unit'
AND ui_unit.id = di.unit_code
WHERE di.daily_record_seq = #{recordSeq}
AND di.is_deleted = false
<if test="recordSeq == null">
INNER JOIN daily_record dr
ON dr.id = di.daily_record_seq
AND dr.is_deleted = false AND dr.household_seq = #{householdSeq} AND dr.record_month = #{recordMonth}
LEFT JOIN daily_day_group ddg
ON ddg.group_no = dr.day_group_no
</if>
WHERE di.is_deleted = false
<if test="recordSeq != null">
AND di.daily_record_seq = #{recordSeq}
ORDER BY di.created_at
</if>
<if test="recordSeq == null">
ORDER BY ddg.start_day asc, di.created_at asc
</if>
</select>
<select id="getDailyWorkRecords"
@@ -98,8 +119,12 @@
/* getDailyExpenseRecords : 일계부 등록 현황 상세 지출 조회 */
SELECT de.id, /* 지출 id */
de.input_type, /* 입력구분 */
de.category,
de.income_mark,
de.expense_mark,
de.is_credit, /* 외상판매여부 */
de.expense_kind, /* 지출 종류 */
de.expense_kind_mark,
de.source_purpose, /* 지출원(용도) */
de.quantity, /* 수량 */
de.unit_code, /* 단위 */
@@ -112,13 +137,29 @@
de.estimated_value, /* 현물평가액 */
de.updated_by, /* 최종수정자 */
TO_CHAR(de.updated_at, 'YYYY-MM-DD HH24:MI') AS updated_at /* 최종수정날짜 */
<if test="recordSeq == null">
, ddg.start_day
, ddg.end_day
</if>
FROM daily_expense de
LEFT JOIN uicode ui_unit
ON ui_unit.parent_id = 'code.record.unit'
AND ui_unit.id = de.unit_code
WHERE de.daily_record_seq = #{recordSeq}
AND de.is_deleted = false
<if test="recordSeq == null">
INNER JOIN daily_record dr
ON dr.id = de.daily_record_seq
AND dr.is_deleted = false AND dr.household_seq = #{householdSeq} AND dr.record_month = #{recordMonth}
LEFT JOIN daily_day_group ddg
ON ddg.group_no = dr.day_group_no
</if>
WHERE de.is_deleted = false
<if test="recordSeq != null">
AND de.daily_record_seq = #{recordSeq}
ORDER BY de.created_at
</if>
<if test="recordSeq == null">
ORDER BY ddg.start_day asc, de.created_at asc
</if>
</select>
<select id="getDailyPowerRecords"

View File

@@ -404,7 +404,7 @@
const goExcel = (el) => {
let url = '';
if (el.dataset.tabValue === 'tab1') {
url = $('.tab-content .daily-record-list').is(':hidden') ? '' : '/api/household/dailyRecordsStatus/excel';
url = $('.tab-content .daily-record-list').is(':hidden') ? '/api/household/dailyRecordStatus/excel' : '/api/household/dailyRecordsStatus/excel';
} else if (el.dataset.tabValue === 'tab2') {
url = '';
} else if (el.dataset.tabValue === 'tab3') {