[FO] 일계부 동력 사용시간 CRUD, 일계부 공통 수정
This commit is contained in:
63
front/src/main/resources/mappers/daily/DailyPowerMapper.xml
Normal file
63
front/src/main/resources/mappers/daily/DailyPowerMapper.xml
Normal file
@@ -0,0 +1,63 @@
|
||||
<?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.power.adapters.persistence.DailyPowerMapper">
|
||||
|
||||
<select id="getDailyPowerList"
|
||||
resultType="app.module.front.usecase.daily.power.adapters.persistence.model.DailyPowerDto">
|
||||
select ds.id, ds.daily_record_seq
|
||||
, ds.equipment_name, ds.owned_hours, ds.leased_hours
|
||||
from daily_power ds
|
||||
<include refid="app.module.front.usecase.daily.record.adapters.persistence.DailyRecordMapper.InnerJoinByDailyRecord"/>
|
||||
where ds.is_deleted = false
|
||||
<if test="id != null and id != '0'">
|
||||
and ds.id = ${id}
|
||||
</if>
|
||||
order by
|
||||
ds.id desc
|
||||
</select>
|
||||
|
||||
<select id="getRecordExistCount" resultType="int">
|
||||
select count(1)
|
||||
from daily_power ds
|
||||
<include refid="app.module.front.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>
|
||||
|
||||
<update id="removeDailyPower">
|
||||
update daily_power set
|
||||
<include refid="common.fields.DeleteBaseSet"/>
|
||||
where is_deleted = false
|
||||
and daily_record_seq = #{dailyRecordSeq}
|
||||
<if test="id != null and id != ''">
|
||||
and id = #{id}
|
||||
</if>
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user