diff --git a/renren-admin/src/main/java/io/renren/common/controller/CensusControllerV3.java b/renren-admin/src/main/java/io/renren/common/controller/CensusControllerV3.java index 6d204c1f..e552f0e0 100644 --- a/renren-admin/src/main/java/io/renren/common/controller/CensusControllerV3.java +++ b/renren-admin/src/main/java/io/renren/common/controller/CensusControllerV3.java @@ -234,10 +234,14 @@ public class CensusControllerV3 { @ApiImplicitParam(name = "resourceType",value = "资源类型(组件服务、应用资源、基础设施、数据资源、知识库)", paramType = "query", dataType = "String") }) public Result>> assemblerUseTopInfo(@ApiIgnore @RequestParam Map params){ - Object[] ps = {params.get("resourceType"),params.get("id"),params.get("id")}; - List> maps = jdbcTemplate.queryForList("SELECT b.name,count(a.id) AS useNum FROM tb_data_resource_rel a INNER JOIN tb_data_resource b ON a.reference_id = b.id \n" + - "inner join sys_user d on a.creator = d.id\n" + - "INNER JOIN sys_dept c ON d.dept_id = c.id WHERE a.del_flag = 0 AND b.type = ? AND (c.id = ? OR INSTR(c.pids,?)) GROUP BY b.name ORDER BY useNum desc LIMIT 5", ps); + Object[] ps = {params.get("id"),params.get("id"),params.get("resourceType")}; + List> maps = jdbcTemplate.queryForList("SELECT COUNT(c.id) as useNum,c.name FROM \n" + + "(\n" + + "\tSELECT a.id FROM tb_data_resource a INNER JOIN sys_dept b ON a.dept_id = b.id \n" + + "\tWHERE a.del_flag = 0 AND a.type='应用资源' AND (b.id = ? OR INSTR(b.pids,?))\n" + + ") a \n" + + "INNER JOIN tb_data_resource_rel b ON a.id = b.key_id INNER JOIN tb_data_resource c ON b.reference_id = c.id\n" + + "WHERE b.del_flag = 0 AND c.type = ? AND c.del_flag = 0 GROUP BY c.name ORDER BY useNum desc limit 5", ps); return new Result>>().ok(maps); } diff --git a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java index 75c11e50..7bef8b8e 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java @@ -1424,7 +1424,7 @@ public class ResourceServiceImpl extends CrudServiceImpl voidCompletableFuture02 = CompletableFuture.runAsync(() -> { maps.forEach(m -> { paraMap.put("id", m.get("deptId")); diff --git a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml index 9325b95a..e516a300 100644 --- a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml +++ b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml @@ -1295,16 +1295,19 @@