[BO] 일계부 농업생산물 등록, 수정 [FO] 농업생산물 수입/지출부호 Util 로 변경
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
<?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.admin.usecase.household.tab.dailyRecord.saveDailyFarming.adapters.persistence.SaveDailyFarmingMapper">
|
||||
|
||||
<select id="getDailyFarming"
|
||||
resultType="app.module.admin.usecase.household.tab.dailyRecord.saveDailyFarming.adapters.persistence.modal.GetDailyFarmingDto">
|
||||
select ds.id, ds.daily_record_seq
|
||||
, ds.product_code, ds.product_self, ds.usage
|
||||
, ds.quantity, ds.unit_code, ds.unit_self, ds.estimated_value
|
||||
from daily_farming ds
|
||||
<include refid="app.module.core.usecase.daily.record.adapters.persistence.DailyRecordMapper.InnerJoinByDailyRecord"/>
|
||||
where ds.is_deleted = false
|
||||
and ds.id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="getRecordExistCount" resultType="int">
|
||||
select count(1)
|
||||
from daily_farming ds
|
||||
<include refid="app.module.core.usecase.daily.record.adapters.persistence.DailyRecordMapper.InnerJoinByDailyRecord"/>
|
||||
where ds.is_deleted = false
|
||||
<if test="id != null and id != '0'">
|
||||
and ds.id = #{id}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<insert id="createDailyFarming" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into daily_farming (
|
||||
daily_record_seq, income_mark, expense_mark
|
||||
, product_code, product_self, usage
|
||||
, quantity, unit_code, unit_self, estimated_value
|
||||
, is_deleted
|
||||
, <include refid="common.fields.CreateUpdateBaseColumns"/>
|
||||
) values (
|
||||
#{dailyRecordSeq}, #{incomeMark}, #{expenseMark}
|
||||
, #{productCode}, #{productSelf}, #{usage}
|
||||
, #{quantity}, #{unitCode}, #{unitSelf}, #{estimatedValue}
|
||||
, false
|
||||
, <include refid="common.fields.CreateUpdateBaseValues"/>
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateDailyFarming">
|
||||
update daily_farming set <include refid="common.fields.UpdateBaseSet"/>
|
||||
, income_mark = #{incomeMark}
|
||||
, expense_mark = #{expenseMark}
|
||||
, product_code = #{productCode}
|
||||
, product_self = #{productSelf}
|
||||
, usage = #{usage}
|
||||
, quantity = #{quantity}
|
||||
, unit_code = #{unitCode}
|
||||
, unit_self = #{unitSelf}
|
||||
, estimated_value = #{estimatedValue}
|
||||
where is_deleted = false
|
||||
and daily_record_seq = #{dailyRecordSeq}
|
||||
and id = #{id}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user