|
@ -3,6 +3,7 @@ package com.yihu.iot.service.company;
|
|
|
import com.yihu.iot.dao.company.*;
|
|
|
import com.yihu.iot.dao.platform.IotCompanyAppInterfaceDao;
|
|
|
import com.yihu.iot.dao.platform.IotInterfaceLogDao;
|
|
|
import com.yihu.iot.model.AppServiceCount;
|
|
|
import com.yihu.iot.service.useragent.UserAgent;
|
|
|
import com.yihu.jw.entity.iot.company.*;
|
|
|
import com.yihu.jw.entity.iot.platform.IotCompanyAppInterfaceDO;
|
|
@ -1157,4 +1158,18 @@ public class IotCompanyService extends BaseJpaService<IotCompanyDO,IotCompanyDao
|
|
|
return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_create);
|
|
|
|
|
|
}
|
|
|
|
|
|
public List<AppServiceCount> getAppService(Integer size){
|
|
|
String str = "SELECT SUM(b.count) count,b.app_name appName\n" +
|
|
|
"FROM (SELECT COUNT(id) fali,app_name,interface_name FROM xmiot.iot_interface_log WHERE state=0 GROUP BY app_name,interface_name) c\n" +
|
|
|
"RIGHT JOIN (SELECT count(id) count,app_name,interface_name,work_type FROM xmiot.iot_interface_log WHERE app_name IS NOT NULL\n" +
|
|
|
"GROUP BY app_name,interface_name) b ON c.app_name=b.app_name AND c.interface_name=b.interface_name\n" +
|
|
|
"GROUP BY b.app_name ORDER BY count DESC";
|
|
|
if (size > 0){
|
|
|
str += " LIMIT 0,3";
|
|
|
}
|
|
|
List<AppServiceCount> counts = jdbcTemplate.query(str,new BeanPropertyRowMapper<>(AppServiceCount.class));
|
|
|
return counts;
|
|
|
}
|
|
|
|
|
|
}
|