|
|
|
@ -16,11 +16,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
<result property="faultOccurrenceTime" column="fault_occurrence_time" />
|
|
|
|
|
<result property="handlingCompletionTime" column="handling_completion_time" />
|
|
|
|
|
<result property="handlingDuration" column="handling_duration" />
|
|
|
|
|
<result property="handlingDurationFormatted" column="handling_duration_formatted" />
|
|
|
|
|
<result property="remarks" column="remarks" />
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<sql id="selectDailyFaultRecordVo">
|
|
|
|
|
select id, date, location, daily_duty_supervisor, tenda_daily_duty_supervisor, fault_situation, handling_measures, fault_type, fault_occurrence_time, handling_completion_time, handling_duration, remarks from daily_fault_record
|
|
|
|
|
select id, date, location, daily_duty_supervisor, tenda_daily_duty_supervisor, fault_situation, handling_measures, fault_type, fault_occurrence_time, handling_completion_time, handling_duration,
|
|
|
|
|
CASE
|
|
|
|
|
WHEN handling_duration IS NULL OR handling_duration <= 0 THEN '00:00:00'
|
|
|
|
|
ELSE CONCAT(
|
|
|
|
|
LPAD(FLOOR(handling_duration / 3600), 2, '0'), ':',
|
|
|
|
|
LPAD(FLOOR((handling_duration % 3600) / 60), 2, '0'), ':',
|
|
|
|
|
LPAD(handling_duration % 60, 2, '0')
|
|
|
|
|
)
|
|
|
|
|
END as handling_duration_formatted,
|
|
|
|
|
remarks from daily_fault_record
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<select id="selectDailyFaultRecordList" parameterType="DailyFaultRecord" resultMap="DailyFaultRecordResult">
|
|
|
|
@ -34,7 +44,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
and STR_TO_DATE(date, '%Y/%m/%d') BETWEEN STR_TO_DATE(#{params.beginDate}, '%Y/%m/%d') AND STR_TO_DATE(#{params.endDate}, '%Y/%m/%d')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="params.beginDate != null and params.beginDate != '' and (params.endDate == null or params.endDate == '')">
|
|
|
|
|
and STR_TO_DATE(date, '%Y/%m/%d') >= STR_TO_DATE(#{params.beginDate}, '%Y/%m/%d')
|
|
|
|
|
and STR_TO_DATE(date, '%Y/%m/%d') >= STR_TO_DATE(#{params.beginDate}, '%Y/%m/%d')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="params.endDate != null and params.endDate != '' and (params.beginDate == null or params.beginDate == '')">
|
|
|
|
|
and STR_TO_DATE(date, '%Y/%m/%d') <= STR_TO_DATE(#{params.endDate}, '%Y/%m/%d')
|
|
|
|
@ -94,7 +104,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
<choose>
|
|
|
|
|
<when test="faultOccurrenceTime != null and handlingCompletionTime != null and faultOccurrenceTime != '' and handlingCompletionTime != ''">
|
|
|
|
|
CASE
|
|
|
|
|
WHEN TIME_TO_SEC(#{handlingCompletionTime}) >= TIME_TO_SEC(#{faultOccurrenceTime}) THEN
|
|
|
|
|
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})
|
|
|
|
@ -124,7 +134,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
<choose>
|
|
|
|
|
<when test="faultOccurrenceTime != null and handlingCompletionTime != null and faultOccurrenceTime != '' and handlingCompletionTime != ''">
|
|
|
|
|
CASE
|
|
|
|
|
WHEN TIME_TO_SEC(#{handlingCompletionTime}) >= TIME_TO_SEC(#{faultOccurrenceTime}) THEN
|
|
|
|
|
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})
|
|
|
|
|