|
|
|
@ -55,7 +55,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
<if test="faultType != null">fault_type,</if>
|
|
|
|
|
<if test="faultOccurrenceTime != null">fault_occurrence_time,</if>
|
|
|
|
|
<if test="handlingCompletionTime != null">handling_completion_time,</if>
|
|
|
|
|
<if test="handlingDuration != null">handling_duration,</if>
|
|
|
|
|
handling_duration,
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="date != null">#{date},</if>
|
|
|
|
@ -67,7 +67,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
<if test="faultType != null">#{faultType},</if>
|
|
|
|
|
<if test="faultOccurrenceTime != null">#{faultOccurrenceTime},</if>
|
|
|
|
|
<if test="handlingCompletionTime != null">#{handlingCompletionTime},</if>
|
|
|
|
|
<if test="handlingDuration != null">#{handlingDuration},</if>
|
|
|
|
|
<choose>
|
|
|
|
|
<when test="faultOccurrenceTime != null and handlingCompletionTime != null and faultOccurrenceTime != '' and handlingCompletionTime != ''">
|
|
|
|
|
CASE
|
|
|
|
|
WHEN TIME_TO_SEC(#{handlingCompletionTime}) >= TIME_TO_SEC(#{faultOccurrenceTime}) THEN
|
|
|
|
|
TIME_TO_SEC(#{handlingCompletionTime}) - TIME_TO_SEC(#{faultOccurrenceTime})
|
|
|
|
|
ELSE
|
|
|
|
|
TIME_TO_SEC(#{handlingCompletionTime}) + 86400 - TIME_TO_SEC(#{faultOccurrenceTime})
|
|
|
|
|
END,
|
|
|
|
|
</when>
|
|
|
|
|
<otherwise>
|
|
|
|
|
#{handlingDuration},
|
|
|
|
|
</otherwise>
|
|
|
|
|
</choose>
|
|
|
|
|
</trim>
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
@ -83,7 +95,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
<if test="faultType != null">fault_type = #{faultType},</if>
|
|
|
|
|
<if test="faultOccurrenceTime != null">fault_occurrence_time = #{faultOccurrenceTime},</if>
|
|
|
|
|
<if test="handlingCompletionTime != null">handling_completion_time = #{handlingCompletionTime},</if>
|
|
|
|
|
<if test="handlingDuration != null">handling_duration = #{handlingDuration},</if>
|
|
|
|
|
handling_duration =
|
|
|
|
|
<choose>
|
|
|
|
|
<when test="faultOccurrenceTime != null and handlingCompletionTime != null and faultOccurrenceTime != '' and handlingCompletionTime != ''">
|
|
|
|
|
CASE
|
|
|
|
|
WHEN TIME_TO_SEC(#{handlingCompletionTime}) >= TIME_TO_SEC(#{faultOccurrenceTime}) THEN
|
|
|
|
|
TIME_TO_SEC(#{handlingCompletionTime}) - TIME_TO_SEC(#{faultOccurrenceTime})
|
|
|
|
|
ELSE
|
|
|
|
|
TIME_TO_SEC(#{handlingCompletionTime}) + 86400 - TIME_TO_SEC(#{faultOccurrenceTime})
|
|
|
|
|
END
|
|
|
|
|
</when>
|
|
|
|
|
<otherwise>
|
|
|
|
|
#{handlingDuration}
|
|
|
|
|
</otherwise>
|
|
|
|
|
</choose>,
|
|
|
|
|
</trim>
|
|
|
|
|
where id = #{id}
|
|
|
|
|
</update>
|
|
|
|
|