WITH LANES AS (
	SELECT
		DATE_FORMAT(MIN(s04_timestamp), "%Y-%m-%d %H:%i:00") AS time,
		COUNT(*) AS total
	FROM package_history
	WHERE s04_timestamp BETWEEN :startDate AND :endDate
      AND destination_act = :lane
	GROUP BY DATE_FORMAT(s04_timestamp, "%Y-%m-%d %H:%i:00")
    ORDER BY DATE_FORMAT(s04_timestamp, "%Y-%m-%d %H:%i:00")
)
SELECT
	time,
	/* Counts: */
	total AS total_count,
	/* PPH: */
	ROUND(total*60) AS total_pph
	/* Percents: */
FROM LANES;