|
@ -1,8 +1,10 @@
|
|
|
package com.yihu.iot.service.company;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
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 +1159,25 @@ public class IotCompanyService extends BaseJpaService<IotCompanyDO,IotCompanyDao
|
|
|
return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_create);
|
|
|
|
|
|
}
|
|
|
|
|
|
public JSONObject getAppService(){
|
|
|
JSONObject object = new JSONObject();
|
|
|
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";
|
|
|
|
|
|
String str1 = "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 limit 0,3";
|
|
|
List<AppServiceCount> counts = jdbcTemplate.query(str,new BeanPropertyRowMapper<>(AppServiceCount.class));
|
|
|
List<AppServiceCount> counts1 = jdbcTemplate.query(str1,new BeanPropertyRowMapper<>(AppServiceCount.class));
|
|
|
object.put("appcount",counts.size());
|
|
|
object.put("sortList",counts1);
|
|
|
return object;
|
|
|
}
|
|
|
|
|
|
}
|