[FO] 일계부 등록 wip, FrontAuditCommand 커밋 누락

This commit is contained in:
김현주
2025-06-10 11:06:07 +09:00
parent b6aeb92597
commit d352b27c3e
17 changed files with 368 additions and 78 deletions

View File

@@ -0,0 +1,73 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="app.module.front.usecase.daily.income.persistence.DailyIncomeMapper">
<select id="getDailyIncomeExistCount" resultType="int">
select count(ds.*)
from daily_income ds
<include refid="app.module.front.usecase.daily.record.persistence.DailyRecordMapper.InnerJoinByDailyRecord"/>
where ds.is_deleted = false
</select>
<select id="getDailyIncomeList">
select id, daily_record_seq, is_credit, crop_code, category_code, category_name, source_purpose
, quantity, unit_code, price, estimated_value
, created_at, created_by
from daily_income
where is_deleted = false
and daily_record_seq = 1
and id = 1
</select>
<select id="getDailyIncome">
select id, daily_record_seq, is_credit, crop_code, category_code, category_name, source_purpose
, quantity, unit_code, price, estimated_value
, created_at, created_by
from daily_income
where is_deleted = false
and daily_record_seq = 1
and id = 1
</select>
<insert id="createDailyIncome" useGeneratedKeys="true" keyProperty="id">
insert into daily_income (
daily_record_seq, is_credit, crop_code, category_code, category_name, source_purpose
, quantity, unit_code, price, estimated_value
, created_at, created_by, is_deleted
) values (
#{householdSeq}
, #{isCredit}, #{cropCode}, #{categoryCode}, #{categoryName}, #{sourcePurpose}
, #{quantity}, #{unitCode}, #{price}, #{estimatedValue}
, now(), #{createdBy}, false
)
</insert>
<update id="updateDailyIncome">
update daily_income set
updated_at = now()
, updated_by = #{updatedBy}
, is_credit = #{isCredit}
, crop_code = #{cropCode}
, category_code = #{categoryCode}
, category_name = #{categoryName}
, source_purpose = #{sourcePurpose}
, quantity = #{quantity}
, unit_code = #{unitCode}
, price = #{price}
, estimated_value = #{estimatedValue}
where is_deleted = false
and daily_record_seq = 1
and id = 1
</update>
<update id="removeDailyIncome">
update daily_income set
deleted_at = now(),
deleted_by = '_system',
is_deleted = true
where is_deleted = false
and daily_record_seq = 1
and id = 1
</update>
</mapper>

View File

@@ -31,19 +31,19 @@
insert into daily_record (
household_seq, record_month, day_group_no, start_date, end_date
, all_status, income_status, work_status, expense_status, power_status, forestry_status
, created_at, created_by, is_deleted
, is_deleted
, <include refid="common.fields.CreateUpdateBaseColumns"/>
) values (
#{householdSeq}
, #{recordMonth}, #{dayGroupNo}, #{startDate}, #{endDate}
, #{allStatus}, #{incomeStatus}, #{workStatus}, #{expenseStatus}, #{powerStatus}, #{forestryStatus}
, now(), #{createdBy}, false
, false
, <include refid="common.fields.CreateUpdateBaseValues"/>
)
</insert>
<update id="updateDailyRecordStatus">
update daily_record set
updated_at = now()
, updated_by = #{updatedBy}
update daily_record set <include refid="common.fields.UpdateBaseSet"/>
<if test="allStatus != null and allStatus != ''">
, all_status = #{allStatus}
</if>