diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/ext/bigScreen/wql/QDEVICE_SCREEN.wql b/mes/hd/nladmin-system/src/main/java/org/nl/wms/ext/bigScreen/wql/QDEVICE_SCREEN.wql index 1d76f614..8520c0bd 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/ext/bigScreen/wql/QDEVICE_SCREEN.wql +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/ext/bigScreen/wql/QDEVICE_SCREEN.wql @@ -317,10 +317,11 @@ FROM ( SELECT - device.productivity, - device.productivity * TIMESTAMPDIFF( HOUR, realproducestart_date, now( ) ) AS max_productivity, - shiftorder.produceorder_code, - shiftorder.realproducestart_date + device.productivity, + CASE WHEN TIMESTAMPDIFF( HOUR, realproducestart_date, now( ) ) = '0' THEN device.productivity + ELSE device.productivity * TIMESTAMPDIFF( HOUR, realproducestart_date, now( ) ) END AS max_productivity, + shiftorder.produceorder_code, + shiftorder.realproducestart_date FROM pdm_bi_device device RIGHT JOIN MPS_BD_ProduceShiftOrder shiftorder ON shiftorder.device_id = device.device_id