SELECT
    roundtime AS `Round Time`,
    sActual_Dest_ID AS Lane,
    COALESCE(Total_count, 0) AS `Total Count`,
    CONCAT(COALESCE(DestFull_perc, 0), '%') AS DestFull_perc
FROM (
    SELECT
        FROM_UNIXTIME(
            FLOOR(UNIX_TIMESTAMP(t_stamp) / 
                CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0)
            ) * 
            CEIL(TIMESTAMPDIFF(SECOND, :starttime, :endtime) / 24.0)
        ) AS roundtime,
        sActual_Dest_ID,
        COUNT(*) AS Total_count,
        CASE 
            WHEN COUNT(*) = 0 THEN 0
            ELSE ROUND((SUM(CASE WHEN adiSort_Code_0 = 5 THEN 1 ELSE 0 END) * 100.0) / COUNT(*), 2)
        END AS DestFull_perc
    FROM item_data
    WHERE t_stamp BETWEEN :starttime AND :endtime
        AND (sActual_Dest_ID LIKE CONCAT(:lane, '%') OR :lane IS NULL OR :lane = '')
    GROUP BY roundtime, sActual_Dest_ID
    ORDER BY roundtime ASC
) basa
WHERE COALESCE(DestFull_perc, 0) > 0