[FO] 수입 수기 등록 create, update, remove, reset, today-none
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user