diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportTimeMapper.xml b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportTimeMapper.xml index 300d8d41c..8cc8de6ab 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportTimeMapper.xml +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportTimeMapper.xml @@ -1200,21 +1200,20 @@ IFNULL(concat(round(sum(IFNULL(t.sevenToTenNum,0))/sum(lww.total_count)*100,2),'%'),'0.00%') sevenToTenArriveRate, sum(IFNULL(t.moreTenNum,0)) moreTenArriveNum, IFNULL(concat(round(sum(IFNULL(t.moreTenNum,0))/sum(lww.total_count)*100,2),'%'),'0.00%') moreTenArriveRate - from logpm_warehouse_waybill lww - left join logpm_warehouse_warehouse waw on waw.id = lww.departure_warehouse_id - left join (select ldpl.waybill_id, - sum(ldpn.quantity) totalNum, - sum(TIMESTAMPDIFF(SECOND,lw.create_time,ldpl.create_time )) timeSecond, - sum(if(ldpl.create_time <= DATE_ADD( lw.create_time, INTERVAL IFNULL(lrat.hours_time,0) HOUR ),ldpn.quantity,0)) onTimeNum, - sum(if(ldpl.create_time <= DATE_ADD( lw.create_time, INTERVAL 24 HOUR ),ldpn.quantity,0)) oneNum, - sum(if(DATE_ADD( lw.create_time, INTERVAL 24 HOUR )<ldpl.create_time and ldpl.create_time <= DATE_ADD( lw.create_time, INTERVAL 48 HOUR ),ldpn.quantity,0)) twoNum, - sum(if(DATE_ADD( lw.create_time, INTERVAL 48 HOUR )<ldpl.create_time and ldpl.create_time <= DATE_ADD( lw.create_time, INTERVAL 72 HOUR ),ldpn.quantity,0)) threeNum, - sum(if(DATE_ADD( lw.create_time, INTERVAL 72 HOUR )<ldpl.create_time and ldpl.create_time <= DATE_ADD( lw.create_time, INTERVAL 96 HOUR ),ldpn.quantity,0)) fourNum, - sum(if(DATE_ADD( lw.create_time, INTERVAL 96 HOUR )<ldpl.create_time and ldpl.create_time <= DATE_ADD( lw.create_time, INTERVAL 120 HOUR ),ldpn.quantity,0)) fiveNum, - sum(if(DATE_ADD( lw.create_time, INTERVAL 120 HOUR )<ldpl.create_time and ldpl.create_time <= DATE_ADD( lw.create_time, INTERVAL 144 HOUR ),ldpn.quantity,0)) sixNum, - sum(if(DATE_ADD( lw.create_time, INTERVAL 144 HOUR )<ldpl.create_time and ldpl.create_time <= DATE_ADD( lw.create_time, INTERVAL 168 HOUR ),ldpn.quantity,0)) sevenNum, - sum(if(DATE_ADD( lw.create_time, INTERVAL 168 HOUR )<ldpl.create_time and ldpl.create_time <= DATE_ADD( lw.create_time, INTERVAL 240 HOUR ),ldpn.quantity,0)) sevenToTenNum, - sum(if(DATE_ADD( lw.create_time, INTERVAL 240 HOUR )<ldpl.create_time,ldpn.quantity,0)) moreTenNum + from (select lw.id waybillId, + lrat.hours_time, + sum(ltcls.unload_num) totalNum, + sum(TIMESTAMPDIFF(SECOND,lw.create_time,ltcls.unload_time )) timeSecond, + sum(if(ltcls.unload_time <= DATE_ADD( lw.create_time, INTERVAL IFNULL(lrat.hours_time,#{param.hoursTime}) HOUR ),ltcls.unload_num,0)) onTimeNum, + sum(if(ltcls.unload_time <= DATE_ADD( lw.create_time, INTERVAL 24 HOUR ),ltcls.unload_num,0)) oneNum, + sum(if(DATE_ADD( lw.create_time, INTERVAL 24 HOUR )<ltcls.unload_time and ltcls.unload_time <= DATE_ADD( lw.create_time, INTERVAL 48 HOUR ),ltcls.unload_num,0)) twoNum, + sum(if(DATE_ADD( lw.create_time, INTERVAL 48 HOUR )<ltcls.unload_time and ltcls.unload_time <= DATE_ADD( lw.create_time, INTERVAL 72 HOUR ),ltcls.unload_num,0)) threeNum, + sum(if(DATE_ADD( lw.create_time, INTERVAL 72 HOUR )<ltcls.unload_time and ltcls.unload_time <= DATE_ADD( lw.create_time, INTERVAL 96 HOUR ),ltcls.unload_num,0)) fourNum, + sum(if(DATE_ADD( lw.create_time, INTERVAL 96 HOUR )<ltcls.unload_time and ltcls.unload_time <= DATE_ADD( lw.create_time, INTERVAL 120 HOUR ),ltcls.unload_num,0)) fiveNum, + sum(if(DATE_ADD( lw.create_time, INTERVAL 120 HOUR )<ltcls.unload_time and ltcls.unload_time <= DATE_ADD( lw.create_time, INTERVAL 144 HOUR ),ltcls.unload_num,0)) sixNum, + sum(if(DATE_ADD( lw.create_time, INTERVAL 144 HOUR )<ltcls.unload_time and ltcls.unload_time <= DATE_ADD( lw.create_time, INTERVAL 168 HOUR ),ltcls.unload_num,0)) sevenNum, + sum(if(DATE_ADD( lw.create_time, INTERVAL 168 HOUR )<ltcls.unload_time and ltcls.unload_time <= DATE_ADD( lw.create_time, INTERVAL 240 HOUR ),ltcls.unload_num,0)) sevenToTenNum, + sum(if(DATE_ADD( lw.create_time, INTERVAL 240 HOUR )<ltcls.unload_time,ltcls.unload_num,0)) moreTenNum from logpm_trunkline_cars_load_scan ltcls left join logpm_warehouse_waybill lw on lw.waybill_no = ltcls.waybill_no left join logpm_reportconfig_all_trunkline lrat on lrat.departure_warehouse_id = lw.departure_warehouse_id and lrat.destination_warehouse_id = lw.destination_warehouse_id and lrat.is_deleted=0