select a.id,a.device_name,value,b.date as data_time from (select id, device_name, ifnull(`value`,0) as value,data_time from diffusion_tower_data and device_name LIKE "%"#{deviceName}"%" ) a right join (select DATE_FORMAT(date_add(#{startDate}, interval row +1 SECOND),'%Y-%m-%d %H:%i:%s') date from ( SELECT @row := @row + 10 as row FROM (select 0 union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) t, (select 0 union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) t2, (select 0 union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) t3, (select 0 union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) t4, (select 0 union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) t5, (SELECT @row:=-1) r ) se where date_add(#{startDate}, interval row SECOND ) < #{endDate}) b on a.data_time=b.date order by b.date asc
京公网安备 11010502049817号