select sum(ifnull(dataNumber,0)) sum_num,from_unixtime(unix_timestamp(),'yyyy-MM-dd HH:mm:ss') update_time,'day' time_limit from s_interfacelog where dt='20200717' and time>'2020-07-17 00:00:00' select r.organization_id,sum(ifnull(s.traffic,0.0)) traffic,'day' time_limit,from_unixtime(unix_timestamp(),'yyyy-MM-dd HH:mm:ss') update_time from s_interfacelog s,resources_catalogue_test r where s.dt='20200717' and s.resourceid=r.id and s.time >= '2020-07-17 00:00:00' group by r.organization_id select r.id resource_id,r.resource_name,r.organization_id,r.organization_name,a.con con,from_unixtime(unix_timestamp(),'yyyy-MM-dd HH:mm:ss') update_time from (select resourceid,count(1) con from s_interfacelog where dt='20200717' and time>'2020-07-17 00:00:00' group by resourceid) a,resources_catalogue_test r where a.resourceid=r.id