[BO] 일계부 동력 사용시간등록, 수정

This commit is contained in:
김현주
2025-07-01 13:59:53 +09:00
parent f540b842f4
commit 15dd6a4798
16 changed files with 639 additions and 1 deletions

View File

@@ -0,0 +1,49 @@
<?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.saveDailyPower.adapters.persistence.SaveDailyPowerMapper">
<select id="getDailyPower"
resultType="app.module.admin.usecase.household.tab.dailyRecord.saveDailyPower.adapters.persistence.modal.GetDailyPowerDto">
select ds.id, ds.daily_record_seq
, ds.equipment_name, ds.owned_hours, ds.leased_hours
from daily_power 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_power 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="createDailyPower" useGeneratedKeys="true" keyProperty="id">
insert into daily_power (
daily_record_seq
, equipment_name, owned_hours, leased_hours
, is_deleted
, <include refid="common.fields.CreateUpdateBaseColumns"/>
) values (
#{dailyRecordSeq}
, #{equipmentName}, #{ownedHours}, #{leasedHours}
, false
, <include refid="common.fields.CreateUpdateBaseValues"/>
)
</insert>
<update id="updateDailyPower">
update daily_power set <include refid="common.fields.UpdateBaseSet"/>
, equipment_name = #{equipmentName}
, owned_hours = #{ownedHours}
, leased_hours = #{leasedHours}
where is_deleted = false
and daily_record_seq = #{dailyRecordSeq}
and id = #{id}
</update>
</mapper>