|
|
@@ -689,10 +689,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
LEFT JOIN (
|
|
|
SELECT
|
|
|
rop.user_id,
|
|
|
- SUM( TIMESTAMPDIFF( MINUTE, ro.accept_time, ro.real_start_time ) / 60 ) + SUM( TIMESTAMPDIFF( MINUTE, ro.real_start_time, ro.real_end_time ) / 60 ) AS wxgs
|
|
|
+ SUM(TIMESTAMPDIFF( MINUTE, ro.real_start_time, ro.real_end_time ) / 60 - IFNULL(gq.total_in_work_suspend_seconds, 0) / 3600) AS wxgs
|
|
|
FROM
|
|
|
gxt_repair_order_person rop
|
|
|
LEFT JOIN gxt_repair_order ro ON rop.order_id = ro.id
|
|
|
+ LEFT JOIN gxt_repair_order_flow_records_next gq ON gq.order_id = rop.order_id
|
|
|
LEFT JOIN ( SELECT MIN( action_time ) AS accept_time, order_id FROM gxt_repair_order_flow WHERE action_type = 'accept' GROUP BY order_id ) e ON ro.id = e.order_id
|
|
|
LEFT JOIN ( SELECT MIN( action_time ) AS process_time, order_id FROM gxt_repair_order_flow WHERE action_type = 'process' GROUP BY order_id ) f ON ro.id = f.order_id
|
|
|
LEFT JOIN ( SELECT MAX( action_time ) AS complete_time, order_id FROM gxt_repair_order_flow WHERE action_type = 'complete' GROUP BY order_id ) g ON ro.id = g.order_id
|
|
|
@@ -721,10 +722,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
LEFT JOIN (
|
|
|
SELECT
|
|
|
wop.user_id,
|
|
|
- SUM( TIMESTAMPDIFF( MINUTE, wo.real_start_time, wo.real_end_time ) / 60 ) AS wbgs
|
|
|
+ SUM(TIMESTAMPDIFF( MINUTE, wo.real_start_time, wo.real_end_time ) / 60 - IFNULL(gq.total_in_work_suspend_seconds, 0) / 3600) AS wbgs
|
|
|
FROM
|
|
|
gxt_work_order_person wop
|
|
|
LEFT JOIN gxt_work_order wo ON wop.order_id = wo.id
|
|
|
+ LEFT JOIN gxt_work_order_flow_records_next gq ON gq.order_id = wop.order_id
|
|
|
LEFT JOIN ( SELECT MIN( action_time ) AS process_time, order_id FROM gxt_work_order_flow WHERE action_type = 'process' GROUP BY order_id ) h ON wo.id = h.order_id
|
|
|
LEFT JOIN ( SELECT MIN( action_time ) AS complete_time, order_id FROM gxt_work_order_flow WHERE action_type = 'complete' GROUP BY order_id ) i ON wo.id = i.order_id
|
|
|
WHERE
|