|
|
|
@ -231,6 +231,8 @@
|
|
|
|
|
count(DISTINCT lta.waybill_id) waybillNum, |
|
|
|
|
count(lta.waybill_id) openNum, |
|
|
|
|
count(ltcls.id) startNum, |
|
|
|
|
count(lta.id)-count(ltcls.id) noOutNum, |
|
|
|
|
sum(if( ltcls.id is null and now() <= DATE_ADD( lta.create_time, INTERVAL #{param.hoursTime} HOUR ),1,0)) noOutOverNum, |
|
|
|
|
sum(if(ltcll.start_date <= DATE_ADD( lta.create_time, INTERVAL #{param.hoursTime} HOUR ),1,0)) onTimeNum, |
|
|
|
|
IFNULL(round(sum(if(ltcll.start_date <= DATE_ADD( lta.create_time, INTERVAL #{param.hoursTime} HOUR ),1,0))/count(ltcls.id)*100,2),'0.00') onTimeRate, |
|
|
|
|
round(sum(TIMESTAMPDIFF(SECOND, lta.create_time, ltcll.start_date))/count(ltcls.id)/3600,1) avgTime |
|
|
|
@ -287,6 +289,8 @@
|
|
|
|
|
count(DISTINCT lta.waybill_id) waybillNum, |
|
|
|
|
count(lta.waybill_id) openNum, |
|
|
|
|
count(ltcls.id) startNum, |
|
|
|
|
count(lta.id)-count(ltcls.id) noOutNum, |
|
|
|
|
sum(if( ltcls.id is null and now() <= DATE_ADD( lta.create_time, INTERVAL #{param.hoursTime} HOUR ),1,0)) noOutOverNum, |
|
|
|
|
sum(if(ltcll.start_date <= DATE_ADD( lta.create_time, INTERVAL #{param.hoursTime} HOUR ),1,0)) onTimeNum, |
|
|
|
|
IFNULL(concat(round(sum(if(ltcll.start_date <= DATE_ADD( lta.create_time, INTERVAL #{param.hoursTime} HOUR ),1,0))/count(ltcls.id)*100,2),'%'),'0.00%') onTimeRate, |
|
|
|
|
round(sum(TIMESTAMPDIFF(SECOND, lta.create_time, ltcll.start_date))/count(ltcls.id)/3600,1) avgTime |
|
|
|
@ -346,7 +350,7 @@
|
|
|
|
|
sum(IFNULL(t.njgNum,0))+sum(IFNULL(t.jgNum,0)) startNum, |
|
|
|
|
sum(IFNULL(t.jgNum,0)) onTimeNum, |
|
|
|
|
IFNULL(round(sum(IFNULL(t.jgNum,0))/sum(lww.total_count)*100,2),'0.00') onTimeRate, |
|
|
|
|
round(sum(TIMESTAMPDIFF(SECOND, lww.create_time, t.startTime))/(sum(IFNULL(t.njgNum,0))+sum(IFNULL(t.jgNum,0)))/3600,1) '平均发运时效' |
|
|
|
|
round(sum(TIMESTAMPDIFF(SECOND, lww.create_time, t.startTime))/(sum(IFNULL(t.njgNum,0))+sum(IFNULL(t.jgNum,0)))/3600,1) avgTime |
|
|
|
|
from logpm_warehouse_waybill lww |
|
|
|
|
left join logpm_warehouse_warehouse waw on waw.id = lww.departure_warehouse_id |
|
|
|
|
left join ( |
|
|
|
@ -551,8 +555,10 @@
|
|
|
|
|
ldpl.brand_name brand, |
|
|
|
|
sum(ldpl.quantity) incomingNum, |
|
|
|
|
count(ltcls.id) outNum, |
|
|
|
|
sum(if(ltcll.start_date <= DATE_ADD( ldpl.create_time, INTERVAL #{param.hoursTime} HOUR ),1,0)) outOnTimeNum, |
|
|
|
|
IFNULL(round(sum(if(ltcll.start_date <= DATE_ADD( ldpl.create_time, INTERVAL #{param.hoursTime} HOUR ),1,0))/count(ltcls.id)*100,2),'0.00') outOnTimeRate, |
|
|
|
|
sum(ldpl.quantity)-count(ltcls.id) noOutNum, |
|
|
|
|
sum(if(ldpl.order_package_status='20' and now() < DATE_ADD( ldpl.create_time, INTERVAL #{param.hoursTime} HOUR ),1,0 )) noOutOverNum, |
|
|
|
|
sum(if(ltcll.start_date < DATE_ADD( ldpl.create_time, INTERVAL #{param.hoursTime} HOUR ),1,0)) outOnTimeNum, |
|
|
|
|
IFNULL(round(sum(if(ltcll.start_date < DATE_ADD( ldpl.create_time, INTERVAL #{param.hoursTime} HOUR ),1,0))/count(ltcls.id)*100,2),'0.00') outOnTimeRate, |
|
|
|
|
round(sum(TIMESTAMPDIFF(SECOND, ldpl.create_time, ltcll.start_date))/count(ltcls.id)/3600,1) avgTime |
|
|
|
|
from logpm_distribution_parcel_list ldpl |
|
|
|
|
left join logpm_warehouse_warehouse waw on waw.id = ldpl.warehouse_id |
|
|
|
@ -563,6 +569,7 @@
|
|
|
|
|
and ldpl.conditions != 3 |
|
|
|
|
and ldpl.waybill_id is not null |
|
|
|
|
and ldpl.warehouse_id != ldpl.send_warehouse_id |
|
|
|
|
and ldpl.warehouse_id != ldpl.accept_warehouse_id |
|
|
|
|
<if test="param.businessLineList != null and param.businessLineList.size() > 0"> |
|
|
|
|
and waw.business_line in |
|
|
|
|
<foreach collection="param.businessLineList" item="item" open="(" separator="," close=")"> |
|
|
|
@ -614,6 +621,8 @@
|
|
|
|
|
ldpl.brand_name brand, |
|
|
|
|
sum(ldpl.quantity) incomingNum, |
|
|
|
|
count(ltcls.id) outNum, |
|
|
|
|
sum(ldpl.quantity)-count(ltcls.id) noOutNum, |
|
|
|
|
sum(if(ldpl.order_package_status='20' and now() < DATE_ADD( ldpl.create_time, INTERVAL #{param.hoursTime} HOUR ),1,0 )) noOutOverNum, |
|
|
|
|
sum(if(ltcll.start_date <= DATE_ADD( ldpl.create_time, INTERVAL #{param.hoursTime} HOUR ),1,0)) outOnTimeNum, |
|
|
|
|
IFNULL(concat(round(sum(if(ltcll.start_date <= DATE_ADD( ldpl.create_time, INTERVAL #{param.hoursTime} HOUR ),1,0))/count(ltcls.id)*100,2),'%'),'0.00%') outOnTimeRate, |
|
|
|
|
round(sum(TIMESTAMPDIFF(SECOND, ldpl.create_time, ltcll.start_date))/count(ltcls.id)/3600,1) avgTime |
|
|
|
@ -1088,27 +1097,29 @@
|
|
|
|
|
sum(IFNULL(t.onTimeNum,0)) onTimeArriveNum, |
|
|
|
|
IFNULL(round(sum(IFNULL(t.onTimeNum,0))/sum(lww.total_count)*100,2),'0.00') onTimeArriveRate, |
|
|
|
|
sum(IFNULL(t.oneNum,0)) oneArriveNum, |
|
|
|
|
IFNULL(round(sum(IFNULL(t.oneNum,0))/sum(lww.total_count)*100,2),'0.00') oneArriveRate, |
|
|
|
|
IFNULL(round(sum(IFNULL(t.oneNum,0))/sum(IFNULL(t.totalNum,0))*100,2),'0.00') oneArriveRate, |
|
|
|
|
sum(IFNULL(t.twoNum,0)) twoArriveNum, |
|
|
|
|
IFNULL(round(sum(IFNULL(t.twoNum,0))/sum(lww.total_count)*100,2),'0.00') twoArriveRate, |
|
|
|
|
IFNULL(round(sum(IFNULL(t.twoNum,0))/sum(IFNULL(t.totalNum,0))*100,2),'0.00') twoArriveRate, |
|
|
|
|
sum(IFNULL(t.threeNum,0)) threeArriveNum, |
|
|
|
|
IFNULL(round(sum(IFNULL(t.threeNum,0))/sum(lww.total_count)*100,2),'0.00') threeArriveRate, |
|
|
|
|
IFNULL(round(sum(IFNULL(t.threeNum,0))/sum(IFNULL(t.totalNum,0))*100,2),'0.00') threeArriveRate, |
|
|
|
|
sum(IFNULL(t.fourNum,0)) fourArriveNum, |
|
|
|
|
IFNULL(round(sum(IFNULL(t.fourNum,0))/sum(lww.total_count)*100,2),'0.00') fourArriveRate, |
|
|
|
|
IFNULL(round(sum(IFNULL(t.fourNum,0))/sum(IFNULL(t.totalNum,0))*100,2),'0.00') fourArriveRate, |
|
|
|
|
sum(IFNULL(t.fiveNum,0)) fiveArriveNum, |
|
|
|
|
IFNULL(round(sum(IFNULL(t.fiveNum,0))/sum(lww.total_count)*100,2),'0.00') fiveArriveRate, |
|
|
|
|
IFNULL(round(sum(IFNULL(t.fiveNum,0))/sum(IFNULL(t.totalNum,0))*100,2),'0.00') fiveArriveRate, |
|
|
|
|
sum(IFNULL(t.sixNum,0)) sixArriveNum, |
|
|
|
|
IFNULL(round(sum(IFNULL(t.sixNum,0))/sum(lww.total_count)*100,2),'0.00') sixArriveRate, |
|
|
|
|
IFNULL(round(sum(IFNULL(t.sixNum,0))/sum(IFNULL(t.totalNum,0))*100,2),'0.00') sixArriveRate, |
|
|
|
|
sum(IFNULL(t.sevenNum,0)) sevenArriveNum, |
|
|
|
|
IFNULL(round(sum(IFNULL(t.sevenNum,0))/sum(lww.total_count)*100,2),'0.00') sevenArriveRate, |
|
|
|
|
IFNULL(round(sum(IFNULL(t.sevenNum,0))/sum(IFNULL(t.totalNum,0))*100,2),'0.00') sevenArriveRate, |
|
|
|
|
sum(IFNULL(t.sevenToTenNum,0)) sevenToTenArriveNum, |
|
|
|
|
IFNULL(round(sum(IFNULL(t.sevenToTenNum,0))/sum(lww.total_count)*100,2),'0.00') sevenToTenArriveRate, |
|
|
|
|
IFNULL(round(sum(IFNULL(t.sevenToTenNum,0))/sum(IFNULL(t.totalNum,0))*100,2),'0.00') sevenToTenArriveRate, |
|
|
|
|
sum(IFNULL(t.moreTenNum,0)) moreTenArriveNum, |
|
|
|
|
IFNULL(round(sum(IFNULL(t.moreTenNum,0))/sum(lww.total_count)*100,2),'0.00') moreTenArriveRate |
|
|
|
|
from (select lw.id waybillId, |
|
|
|
|
IFNULL(round(sum(IFNULL(t.moreTenNum,0))/sum(IFNULL(t.totalNum,0))*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 lw.id waybillId, |
|
|
|
|
lrat.hours_time, |
|
|
|
|
sum(ltcls.unload_num) totalNum, |
|
|
|
|
sum(TIMESTAMPDIFF(SECOND,lw.create_time,ltcls.unload_time )) timeSecond, |
|
|
|
|
sum(TIMESTAMPDIFF(SECOND,lw.create_time,ltcls.unload_time )*ltcls.unload_num) 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, |
|
|
|
@ -1152,9 +1163,7 @@
|
|
|
|
|
<if test="param.endTime != null "> |
|
|
|
|
and lw.create_time <= #{param.endTime} |
|
|
|
|
</if> |
|
|
|
|
group by lw.id,lrat.hours_time) t |
|
|
|
|
left join logpm_warehouse_waybill lww on lww.id = t.waybillId |
|
|
|
|
left join logpm_warehouse_warehouse waw on waw.id = lww.departure_warehouse_id |
|
|
|
|
group by lw.id,lrat.hours_time) t on lww.id = t.waybillId |
|
|
|
|
where 1=1 |
|
|
|
|
<if test="param.businessLineList != null and param.businessLineList.size() > 0"> |
|
|
|
|
and waw.business_line in |
|
|
|
@ -1162,6 +1171,30 @@
|
|
|
|
|
#{item} |
|
|
|
|
</foreach> |
|
|
|
|
</if> |
|
|
|
|
<if test="param.brandList != null and param.brandList.size() > 0"> |
|
|
|
|
and lww.brand in |
|
|
|
|
<foreach collection="param.brandList" item="item" open="(" separator="," close=")"> |
|
|
|
|
#{item} |
|
|
|
|
</foreach> |
|
|
|
|
</if> |
|
|
|
|
<if test="param.departureWarehouseIds != null and param.departureWarehouseIds.size() > 0"> |
|
|
|
|
and lww.departure_warehouse_id in |
|
|
|
|
<foreach collection="param.departureWarehouseIds" item="item" open="(" separator="," close=")"> |
|
|
|
|
#{item} |
|
|
|
|
</foreach> |
|
|
|
|
</if> |
|
|
|
|
<if test="param.destinationWarehouseIds != null and param.destinationWarehouseIds.size() > 0"> |
|
|
|
|
and lww.destination_warehouse_id in |
|
|
|
|
<foreach collection="param.destinationWarehouseIds" item="item" open="(" separator="," close=")"> |
|
|
|
|
#{item} |
|
|
|
|
</foreach> |
|
|
|
|
</if> |
|
|
|
|
<if test="param.startTime != null "> |
|
|
|
|
and lww.create_time >= #{param.startTime} |
|
|
|
|
</if> |
|
|
|
|
<if test="param.endTime != null "> |
|
|
|
|
and lww.create_time <= #{param.endTime} |
|
|
|
|
</if> |
|
|
|
|
group by waw.business_line, |
|
|
|
|
lww.departure_warehouse_name, |
|
|
|
|
lww.destination_warehouse_name, |
|
|
|
@ -1183,27 +1216,29 @@
|
|
|
|
|
sum(IFNULL(t.onTimeNum,0)) onTimeArriveNum, |
|
|
|
|
IFNULL(concat(round(sum(IFNULL(t.onTimeNum,0))/sum(lww.total_count)*100,2),'%'),'0.00%') onTimeArriveRate, |
|
|
|
|
sum(IFNULL(t.oneNum,0)) oneArriveNum, |
|
|
|
|
IFNULL(concat(round(sum(IFNULL(t.oneNum,0))/sum(lww.total_count)*100,2),'%'),'0.00%') oneArriveRate, |
|
|
|
|
IFNULL(concat(round(sum(IFNULL(t.oneNum,0))/sum(IFNULL(t.totalNum,0))*100,2),'%'),'0.00%') oneArriveRate, |
|
|
|
|
sum(IFNULL(t.twoNum,0)) twoArriveNum, |
|
|
|
|
IFNULL(concat(round(sum(IFNULL(t.twoNum,0))/sum(lww.total_count)*100,2),'%'),'0.00%') twoArriveRate, |
|
|
|
|
IFNULL(concat(round(sum(IFNULL(t.twoNum,0))/sum(IFNULL(t.totalNum,0))*100,2),'%'),'0.00%') twoArriveRate, |
|
|
|
|
sum(IFNULL(t.threeNum,0)) threeArriveNum, |
|
|
|
|
IFNULL(concat(round(sum(IFNULL(t.threeNum,0))/sum(lww.total_count)*100,2),'%'),'0.00%') threeArriveRate, |
|
|
|
|
IFNULL(concat(round(sum(IFNULL(t.threeNum,0))/sum(IFNULL(t.totalNum,0))*100,2),'%'),'0.00%') threeArriveRate, |
|
|
|
|
sum(IFNULL(t.fourNum,0)) fourArriveNum, |
|
|
|
|
IFNULL(concat(round(sum(IFNULL(t.fourNum,0))/sum(lww.total_count)*100,2),'%'),'0.00%') fourArriveRate, |
|
|
|
|
IFNULL(concat(round(sum(IFNULL(t.fourNum,0))/sum(IFNULL(t.totalNum,0))*100,2),'%'),'0.00%') fourArriveRate, |
|
|
|
|
sum(IFNULL(t.fiveNum,0)) fiveArriveNum, |
|
|
|
|
IFNULL(concat(round(sum(IFNULL(t.fiveNum,0))/sum(lww.total_count)*100,2),'%'),'0.00%') fiveArriveRate, |
|
|
|
|
IFNULL(concat(round(sum(IFNULL(t.fiveNum,0))/sum(IFNULL(t.totalNum,0))*100,2),'%'),'0.00%') fiveArriveRate, |
|
|
|
|
sum(IFNULL(t.sixNum,0)) sixArriveNum, |
|
|
|
|
IFNULL(concat(round(sum(IFNULL(t.sixNum,0))/sum(lww.total_count)*100,2),'%'),'0.00%') sixArriveRate, |
|
|
|
|
IFNULL(concat(round(sum(IFNULL(t.sixNum,0))/sum(IFNULL(t.totalNum,0))*100,2),'%'),'0.00%') sixArriveRate, |
|
|
|
|
sum(IFNULL(t.sevenNum,0)) sevenArriveNum, |
|
|
|
|
IFNULL(concat(round(sum(IFNULL(t.sevenNum,0))/sum(lww.total_count)*100,2),'%'),'0.00%') sevenArriveRate, |
|
|
|
|
IFNULL(concat(round(sum(IFNULL(t.sevenNum,0))/sum(IFNULL(t.totalNum,0))*100,2),'%'),'0.00%') sevenArriveRate, |
|
|
|
|
sum(IFNULL(t.sevenToTenNum,0)) sevenToTenArriveNum, |
|
|
|
|
IFNULL(concat(round(sum(IFNULL(t.sevenToTenNum,0))/sum(lww.total_count)*100,2),'%'),'0.00%') sevenToTenArriveRate, |
|
|
|
|
IFNULL(concat(round(sum(IFNULL(t.sevenToTenNum,0))/sum(IFNULL(t.totalNum,0))*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 (select lw.id waybillId, |
|
|
|
|
IFNULL(concat(round(sum(IFNULL(t.moreTenNum,0))/sum(IFNULL(t.totalNum,0))*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 lw.id waybillId, |
|
|
|
|
lrat.hours_time, |
|
|
|
|
sum(ltcls.unload_num) totalNum, |
|
|
|
|
sum(TIMESTAMPDIFF(SECOND,lw.create_time,ltcls.unload_time )) timeSecond, |
|
|
|
|
sum(TIMESTAMPDIFF(SECOND,lw.create_time,ltcls.unload_time )*ltcls.unload_num) 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, |
|
|
|
@ -1247,9 +1282,7 @@
|
|
|
|
|
<if test="param.endTime != null "> |
|
|
|
|
and lw.create_time <= #{param.endTime} |
|
|
|
|
</if> |
|
|
|
|
group by lw.id,lrat.hours_time) t |
|
|
|
|
left join logpm_warehouse_waybill lww on lww.id = t.waybillId |
|
|
|
|
left join logpm_warehouse_warehouse waw on waw.id = lww.departure_warehouse_id |
|
|
|
|
group by lw.id,lrat.hours_time) t on lww.id = t.waybillId |
|
|
|
|
where 1=1 |
|
|
|
|
<if test="param.businessLineList != null and param.businessLineList.size() > 0"> |
|
|
|
|
and waw.business_line in |
|
|
|
@ -1257,6 +1290,30 @@
|
|
|
|
|
#{item} |
|
|
|
|
</foreach> |
|
|
|
|
</if> |
|
|
|
|
<if test="param.brandList != null and param.brandList.size() > 0"> |
|
|
|
|
and lww.brand in |
|
|
|
|
<foreach collection="param.brandList" item="item" open="(" separator="," close=")"> |
|
|
|
|
#{item} |
|
|
|
|
</foreach> |
|
|
|
|
</if> |
|
|
|
|
<if test="param.departureWarehouseIds != null and param.departureWarehouseIds.size() > 0"> |
|
|
|
|
and lww.departure_warehouse_id in |
|
|
|
|
<foreach collection="param.departureWarehouseIds" item="item" open="(" separator="," close=")"> |
|
|
|
|
#{item} |
|
|
|
|
</foreach> |
|
|
|
|
</if> |
|
|
|
|
<if test="param.destinationWarehouseIds != null and param.destinationWarehouseIds.size() > 0"> |
|
|
|
|
and lww.destination_warehouse_id in |
|
|
|
|
<foreach collection="param.destinationWarehouseIds" item="item" open="(" separator="," close=")"> |
|
|
|
|
#{item} |
|
|
|
|
</foreach> |
|
|
|
|
</if> |
|
|
|
|
<if test="param.startTime != null "> |
|
|
|
|
and lww.create_time >= #{param.startTime} |
|
|
|
|
</if> |
|
|
|
|
<if test="param.endTime != null "> |
|
|
|
|
and lww.create_time <= #{param.endTime} |
|
|
|
|
</if> |
|
|
|
|
group by waw.business_line, |
|
|
|
|
lww.departure_warehouse_name, |
|
|
|
|
lww.destination_warehouse_name, |
|
|
|
|