diff --git a/renren-admin/src/main/java/io/renren/common/controller/CensusControllerV2.java b/renren-admin/src/main/java/io/renren/common/controller/CensusControllerV2.java index c0658802..9495a5e3 100644 --- a/renren-admin/src/main/java/io/renren/common/controller/CensusControllerV2.java +++ b/renren-admin/src/main/java/io/renren/common/controller/CensusControllerV2.java @@ -292,7 +292,7 @@ public class CensusControllerV2 { }); }); CompletableFuture allKnowledgeVisitsAmount = CompletableFuture.supplyAsync(() -> { // 获取平台知识库浏览量 - return jdbcTemplate.queryForObject("SELECT SUM(visits) visits FROM tb_data_resource WHERE type ='知识库' AND del_flag = 0;", Long.class); + return jdbcTemplate.queryForObject("SELECT IFNULL(SUM(visits),0) visits FROM tb_data_resource WHERE type ='知识库' AND del_flag = 0;", Long.class); }).thenAccept(sum -> { result.add(new HashMap() { { @@ -434,7 +434,7 @@ public class CensusControllerV2 { List lists = JSON.parseArray(ja, Map.class); ArrayList list = new ArrayList<>(); lists.forEach(item -> { - list.add(new HashMap(){{ + list.add(new HashMap() {{ put("服务名称", item.get("zyname")); put("申请次数", item.get("syqk")); }});