浏览代码

驾驶舱-准备时长=开始时间-下发时间-开工前挂起时长

wanglt 2 月之前
父节点
当前提交
91582dd9c5

+ 6 - 6
ygtx-gxt/src/main/resources/mapper/gxt/GxtWorkOrderMapper.xml

@@ -688,13 +688,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 wo.team_leader_name AS chargePerson,
                 <if test="repairPerson != null and repairPerson == 'true'">wop.nick_name AS repairPerson,ROUND(wop.score,2) AS score,</if>
                 <if test="repairPerson == null or repairPerson == '' or repairPerson == 'false'">ROUND(wo.score,2) AS score,</if>
-                ROUND(TIMESTAMPDIFF( SECOND, wo.create_time, wo.assign_time ) / 3600,2) AS xfsc,
-                ROUND(TIMESTAMPDIFF( SECOND, wo.assign_time, wo.accept_time ) / 3600,2) AS xysc,
-                ROUND((TIMESTAMPDIFF( SECOND, wo.accept_time, wo.real_start_time ) - IFNULL(gq.total_before_start_suspend_seconds, 0)) / 3600,2) AS zbsc,
+                NULL AS xfsc,
+                NULL AS xysc,
+                NULL AS zbsc,
                 ROUND(TIMESTAMPDIFF( SECOND, COALESCE ( wo.pause_time, wo.real_start_time ), wo.restart_time ) / 3600,2) AS tjsc,
                 ROUND(TIMESTAMPDIFF( SECOND, wo.restart_time, wo.real_end_time ) / 3600,2) AS qjbwsc,
                 ROUND(( TIMESTAMPDIFF( SECOND, wo.real_start_time, wo.real_end_time ) - IFNULL(gq.total_in_work_suspend_seconds, 0)) / 3600,2) AS clsc,
-                ROUND(CASE WHEN gq.order_id IS NOT NULL THEN (gq.total_before_start_suspend_seconds + gq.total_in_work_suspend_seconds + gq.total_night_auto_suspend_seconds)/3600 ELSE 0 END,2) AS gqsc
+                ROUND(CASE WHEN gq.order_id IS NOT NULL THEN (gq.total_before_start_suspend_seconds + gq.total_in_work_suspend_seconds)/3600 ELSE 0 END,2) AS gqsc
             FROM
                 gxt_work_order wo
                 <if test="repairPerson != null and repairPerson == 'true'">
@@ -781,11 +781,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 <if test="repairPerson == null or repairPerson == '' or repairPerson == 'false'">ROUND(wo.score,2) AS score,</if>
                 ROUND(TIMESTAMPDIFF( SECOND, wo.occur_time, wo.assign_time ) / 3600,2) AS xfsc,
                 ROUND(( TIMESTAMPDIFF( SECOND, wo.assign_time, wo.accept_time ) - IFNULL(gq.total_night_auto_suspend_seconds, 0))/ 3600,2) AS xysc,
-                ROUND((TIMESTAMPDIFF( SECOND, wo.accept_time, wo.real_start_time ) - IFNULL(gq.total_before_start_suspend_seconds, 0)) / 3600,2) AS zbsc,
+                ROUND((TIMESTAMPDIFF( SECOND, wo.assign_time, wo.real_start_time ) - IFNULL(gq.total_before_start_suspend_seconds, 0)) / 3600,2) AS zbsc,
                 ROUND(TIMESTAMPDIFF( SECOND, wo.occur_time, wo.restart_time ) / 3600,2) AS tjsc,
                 ROUND(TIMESTAMPDIFF( SECOND, wo.restart_time, wo.real_end_time ) / 3600,2) AS qjbwsc,
                 ROUND((TIMESTAMPDIFF( SECOND, wo.real_start_time, wo.real_end_time ) - IFNULL(gq.total_in_work_suspend_seconds, 0)) / 3600,2) AS clsc,
-                ROUND(CASE WHEN gq.order_id IS NOT NULL THEN (gq.total_before_start_suspend_seconds + gq.total_in_work_suspend_seconds + gq.total_night_auto_suspend_seconds)/3600 ELSE 0 END,2) AS gqsc
+                ROUND(CASE WHEN gq.order_id IS NOT NULL THEN (gq.total_before_start_suspend_seconds + gq.total_in_work_suspend_seconds)/3600 ELSE 0 END,2) AS gqsc
             FROM
                 gxt_repair_order wo
                 <if test="repairPerson != null and repairPerson == 'true'">

+ 4 - 4
ygtx-gxt/src/main/resources/mapper/gxt/gxtOrderPersonMapper.xml

@@ -278,11 +278,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         FROM (SELECT order_id FROM gxt_repair_order_flow_records GROUP BY order_id) t0
                  LEFT JOIN gxt_repair_order_flow_records t1
                            ON t0.order_id = t1.order_id
-                               AND t1.action_type = 'approved'
+                               AND t1.action_type IN ('approved','auto_suspend')
                  LEFT JOIN gxt_repair_order_flow_records t2
                            ON t1.order_id = t2.order_id
                                AND t2.order_seq = t1.order_seq + 1
-                               AND t1.action_type = 'approved'
+                               AND t1.action_type IN ('approved','auto_suspend')
                                AND t2.action_type IN ('resume','auto_resume')
                  LEFT JOIN gxt_repair_order_flow_records t3
                            ON t0.order_id = t3.order_id
@@ -467,11 +467,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         FROM (SELECT order_id FROM gxt_work_order_flow_records GROUP BY order_id) t0
                  LEFT JOIN gxt_work_order_flow_records t1
                            ON t0.order_id = t1.order_id
-                               AND t1.action_type = 'approved'
+                               AND t1.action_type IN ('approved','auto_suspend')
                  LEFT JOIN gxt_work_order_flow_records t2
                            ON t1.order_id = t2.order_id
                                AND t2.order_seq = t1.order_seq + 1
-                               AND t1.action_type = 'approved'
+                               AND t1.action_type IN ('approved','auto_suspend')
                                AND t2.action_type IN ('resume','auto_resume')
                  LEFT JOIN gxt_work_order_flow_records t3
                            ON t0.order_id = t3.order_id