[FO] 수입 수기 등록 create, update, remove, reset, today-none

This commit is contained in:
김현주
2025-06-12 10:23:37 +09:00
parent 7e00404c52
commit ce30993e44
28 changed files with 1249 additions and 180 deletions

View File

@@ -4,42 +4,47 @@
<select id="getDailyIncomeList"
resultType="app.module.front.usecase.daily.income.persistence.model.DailyIncomeDto">
select ds.id, ds.daily_record_seq, ds.input_type, ds.is_credit
select ds.id, ds.daily_record_seq, ds.input_type, ds.is_credit as credit
, ds.crop_code, ds.category_code, ds.category_self, ds.source_purpose
, ds.quantity, ds.unit_code, ds.price, ds.estimated_value
from daily_income ds
<include refid="app.module.front.usecase.daily.record.persistence.DailyRecordMapper.InnerJoinByDailyRecord"/>
where ds.is_deleted = false
<if test="incomeId != null and incomeId != ''">
and ds.id = ${incomeId}
<if test="id != null and id != '0'">
and ds.id = ${id}
</if>
order by
ds.id desc
</select>
<select id="getDailyIncomeExistCount" resultType="int">
<select id="getRecordExistCount" resultType="int">
select count(1)
from daily_income ds
<include refid="app.module.front.usecase.daily.record.persistence.DailyRecordMapper.InnerJoinByDailyRecord"/>
where ds.is_deleted = false
<if test="id != null and id != '0'">
and ds.id = ${id}
</if>
</select>
<insert id="createDailyIncome" useGeneratedKeys="true" keyProperty="id">
insert into daily_income (
daily_record_seq, is_credit, crop_code, category_code, category_self, source_purpose
daily_record_seq, input_type, is_credit, crop_code, category_code, category_self, source_purpose
, quantity, unit_code, price, estimated_value
, created_at, created_by, is_deleted
, is_deleted
, <include refid="common.fields.CreateUpdateBaseColumns"/>
) values (
#{householdSeq}
, #{isCredit}, #{cropCode}, #{categoryCode}, #{categoryName}, #{sourcePurpose}
#{dailyRecordSeq}
, #{inputType}, #{credit}, #{cropCode}, #{categoryCode}, #{categorySelf}, #{sourcePurpose}
, #{quantity}, #{unitCode}, #{price}, #{estimatedValue}
, now(), #{createdBy}, false
, false
, <include refid="common.fields.CreateUpdateBaseValues"/>
)
</insert>
<update id="updateDailyIncome">
update daily_income set
updated_at = now()
, updated_by = #{updatedBy}
, is_credit = #{isCredit}
update daily_income set <include refid="common.fields.UpdateBaseSet"/>
, is_credit = #{credit}
, crop_code = #{cropCode}
, category_code = #{categoryCode}
, category_self = #{categorySelf}
@@ -49,18 +54,18 @@
, price = #{price}
, estimated_value = #{estimatedValue}
where is_deleted = false
and daily_record_seq = 1
and id = 1
and daily_record_seq = #{dailyRecordSeq}
and id = #{id}
</update>
<update id="removeDailyIncome">
update daily_income set
deleted_at = now(),
deleted_by = '_system',
is_deleted = true
<include refid="common.fields.DeleteBaseSet"/>
where is_deleted = false
and daily_record_seq = 1
and id = 1
and daily_record_seq = #{dailyRecordSeq}
<if test="id != null and id != ''">
and id = #{id}
</if>
</update>
</mapper>

View File

@@ -41,7 +41,7 @@
</insert>
<update id="updateDailyRecordStatus">
update daily_record set <include refid="common.fields.UpdateBaseSet"/>
update daily_record set <include refid="common.fields.UpdateBaseSet"/>
<if test="allStatus != null and allStatus != ''">
, all_status = #{allStatus}
</if>
@@ -51,12 +51,27 @@
<when test="targetType eq 'INCOME'">
, income_status = #{targetStatus}
</when>
<when test="targetType eq 'WORK'">
, work_status = #{targetStatus}
</when>
<when test="targetType eq 'EXPENSE'">
, expense_status = #{targetStatus}
</when>
<when test="targetType eq 'POWER'">
, power_status = #{targetStatus}
</when>
<when test="targetType eq 'FORESTRY'">
, forestry_status = #{targetStatus}
</when>
<when test="targetType eq 'FARMING'">
, farming_status = #{targetStatus}
</when>
</choose>
</if>
where is_deleted = false
and household_seq = #{householdSeq}
and record_month = #{recordMonth}
and day_group_no = #{dayGroupNo}
where is_deleted = false
and household_seq = #{householdSeq}
and record_month = #{recordMonth}
and day_group_no = #{dayGroupNo}
</update>
<sql id="InnerJoinByDailyRecord">