case when round(TIMESTAMPDIFF(SECOND,ltad.create_time,ldpl.create_time)/3600,1)<=IFNULL(lrat.hours_time,#{param.hoursTime}) then '未超时'
case when round(TIMESTAMPDIFF(SECOND,ltad.create_time,IFNULL(ldpl.create_time,NOW()))/3600,1)<=IFNULL(lrat.hours_time,#{param.hoursTime}) then '未超时'
when round(TIMESTAMPDIFF(SECOND,ltad.create_time,ldpl.create_time)/3600,1)>IFNULL(lrat.hours_time,#{param.hoursTime}) then '超时'
when round(TIMESTAMPDIFF(SECOND,ltad.create_time,IFNULL(ldpl.create_time,NOW()))/3600,1)>IFNULL(lrat.hours_time,#{param.hoursTime}) then '超时'
else '未知' end isOverTime
else '未知' end isOverTime
from logpm_trunkline_advance_detail ltad
from logpm_trunkline_advance_detail ltad
left join logpm_trunkline_advance lta on lta.id = ltad.advance_id
left join logpm_trunkline_advance lta on lta.id = ltad.advance_id
@ -2681,14 +2681,14 @@
<iftest="param.trainNumber != null and param.trainNumber != ''">
<iftest="param.trainNumber != null and param.trainNumber != ''">
and ltad.train_number like concat('%',#{param.trainNumber},'%')
and ltad.train_number like concat('%',#{param.trainNumber},'%')
</if>
</if>
<iftest="param.isDesIncomging != null">
<iftest="param.isDesIncoming != null">
and IF(ldpl.id IS NULL,0,1) = #{param.isDesIncomging}
and IF(ldpl.id IS NULL,0,1) = #{param.isDesIncoming}
</if>
</if>
<iftest="param.isOverTime != null and param.isOverTime ==0">
<iftest="param.isOverTime != null and param.isOverTime ==0">
and round(TIMESTAMPDIFF(SECOND,ltad.create_time,ldpl.create_time)/3600,1)<=IFNULL(lrat.hours_time,#{param.hoursTime})
and round(TIMESTAMPDIFF(SECOND,ltad.create_time,IFNULL(ldpl.create_time,NOW()))/3600,1)<=IFNULL(lrat.hours_time,#{param.hoursTime})
</if>
</if>
<iftest="param.isOverTime != null and param.isOverTime ==1">
<iftest="param.isOverTime != null and param.isOverTime ==1">
and round(TIMESTAMPDIFF(SECOND,ltad.create_time,ldpl.create_time)/3600,1)>IFNULL(lrat.hours_time,#{param.hoursTime})
and round(TIMESTAMPDIFF(SECOND,ltad.create_time,IFNULL(ldpl.create_time,NOW()))/3600,1)>IFNULL(lrat.hours_time,#{param.hoursTime})
</if>
</if>
<iftest="param.allTrunklineTimeDetailType != null and param.allTrunklineTimeDetailType ==2">
<iftest="param.allTrunklineTimeDetailType != null and param.allTrunklineTimeDetailType ==2">
and ldpl.id IS NOT NULL
and ldpl.id IS NOT NULL
@ -2698,7 +2698,7 @@
</if>
</if>
<iftest="param.allTrunklineTimeDetailType != null and param.allTrunklineTimeDetailType ==4">
<iftest="param.allTrunklineTimeDetailType != null and param.allTrunklineTimeDetailType ==4">
and ldpl.id IS NOT NULL
and ldpl.id IS NOT NULL
and round(TIMESTAMPDIFF(SECOND,ltad.create_time,ldpl.create_time)/3600,1)<=IFNULL(lrat.hours_time,#{param.hoursTime})
and round(TIMESTAMPDIFF(SECOND,ltad.create_time,IFNULL(ldpl.create_time,NOW()))/3600,1)<=IFNULL(lrat.hours_time,#{param.hoursTime})
</if>
</if>
</select>
</select>
@ -2776,8 +2776,8 @@
<iftest="param.trainNumber != null and param.trainNumber != ''">
<iftest="param.trainNumber != null and param.trainNumber != ''">
and ltad.train_number like concat('%',#{param.trainNumber},'%')
and ltad.train_number like concat('%',#{param.trainNumber},'%')
</if>
</if>
<iftest="param.isDesIncomging != null">
<iftest="param.isStarting != null">
and if(ltcll.start_date is null,0,1) = #{param.isDesIncomging}
and if(ltcll.start_date is null,0,1) = #{param.isStarting}
</if>
</if>
<iftest="param.isOverTime != null and param.isOverTime ==0">
<iftest="param.isOverTime != null and param.isOverTime ==0">
and round(TIMESTAMPDIFF(SECOND,ltad.incoming_time,IFNULL(ltcll.start_date,NOW()))/3600,1)<=#{param.hoursTime}
and round(TIMESTAMPDIFF(SECOND,ltad.incoming_time,IFNULL(ltcll.start_date,NOW()))/3600,1)<=#{param.hoursTime}
@ -2876,8 +2876,8 @@
<iftest="param.trainNumber != null and param.trainNumber != ''">
<iftest="param.trainNumber != null and param.trainNumber != ''">
and ltad.train_number like concat('%',#{param.trainNumber},'%')
and ltad.train_number like concat('%',#{param.trainNumber},'%')
</if>
</if>
<iftest="param.isDesIncomging != null">
<iftest="param.isStarting != null">
and if(ltcll.start_date is null,0,1) = #{param.isDesIncomging}
and if(ltcll.start_date is null,0,1) = #{param.isStarting}
</if>
</if>
<iftest="param.isOverTime != null and param.isOverTime ==0">
<iftest="param.isOverTime != null and param.isOverTime ==0">
and round(TIMESTAMPDIFF(SECOND,ltad.incoming_time,IFNULL(ltcll.start_date,NOW()))/3600,1)<=#{param.hoursTime}
and round(TIMESTAMPDIFF(SECOND,ltad.incoming_time,IFNULL(ltcll.start_date,NOW()))/3600,1)<=#{param.hoursTime}