Merge branch 'master' into docker_package

This commit is contained in:
wangliwen 2022-06-30 16:00:39 +08:00
commit da41776d98
1 changed files with 13 additions and 20 deletions

View File

@ -150,21 +150,11 @@ public class CensusControllerV3 {
@ApiImplicitParam(name = "resourceType",value = "资源类型(组件服务、应用资源、基础设施、数据资源、知识库)", paramType = "query", dataType = "String")
})
public Result<List<Map<String, Object>>> assemblerScoreInfo(@ApiIgnore @RequestParam Map<String, Object> params){
Object[] args = {params.get("resourceType"),params.get("id")};
List<Map<String, Object>> maps = jdbcTemplate.queryForList("SELECT COUNT(a.score) as scoreNum,a.score FROM \n" +
"tb_resource_score a\n" +
"INNER JOIN \n" +
"tb_data_resource b\n" +
"ON \n" +
"a.resource_id = b.id\n" +
"WHERE \n" +
"b.type = ?\n" +
"AND\n" +
"b.dept_id = ?\n" +
"AND\n" +
"a.score is not null\n" +
"AND a.del_flag = 0\n" +
"GROUP BY a.score", args);
Object[] args = {params.get("resourceType"),params.get("id"),params.get("id")};
List<Map<String, Object>> maps = jdbcTemplate.queryForList("SELECT COUNT(a.score) as scoreNum,a.score FROM tb_resource_score a INNER JOIN tb_data_resource b\n" +
"ON a.resource_id = b.id INNER JOIN sys_dept c ON b.dept_id = c.id\n" +
"WHERE a.del_flag = 0 AND a.score is not null AND b.type = ? AND b.del_flag = 0\n" +
"AND c.id = ? OR INSTR(c.pids,?) GROUP BY a.score", args);
return new Result<List<Map<String, Object>>>().ok(maps);
}
@ -376,11 +366,14 @@ public class CensusControllerV3 {
@GetMapping("/applicationUsedCapabilityNum")
@ApiOperation("贡献组件分别被多少应用使用")
@LogOperation("贡献组件分别被多少应用使用")
@ApiImplicitParam(name = "keyId", value = "应用id", paramType = "query", required = true, dataType = "long")
public Result<List<Map<String,Object>>> applicationUsedCapabilityNum(Long keyId){
Object[] ps = {keyId};
List<Map<String, Object>> maps = jdbcTemplate.queryForList("select count(b.id) as useNum,c.name from (select reference_id from tb_data_resource_rel where del_flag = 0 and key_id = ? ) a inner join tb_data_resource_rel b on a.reference_id = b.reference_id inner join tb_data_resource c\n" +
"on a.reference_id = c.id where c.del_flag = 0 group by c.name", ps);
@ApiImplicitParam(name = "id", value = "部门id", paramType = "query", required = true, dataType = "long")
public Result<List<Map<String,Object>>> applicationUsedCapabilityNum(Long id){
Object[] ps = {id,id};
List<Map<String, Object>> maps = jdbcTemplate.queryForList("SELECT COUNT(distinct(a.key_id)) as appNum,c.attr_value FROM (\n" +
"SELECT a.key_id ,a.reference_id FROM tb_data_resource_rel a INNER JOIN tb_data_resource b ON a.key_id = b.id INNER JOIN sys_dept c on b.dept_id = c.id WHERE a.del_flag = 0 AND c.id = ? OR INSTR(c.pids,?) ORDER BY a.key_id \n" +
") a \n" +
"INNER JOIN tb_data_resource b ON a.reference_id = b.id INNER JOIN tb_data_attr c \tON a.reference_id = c.data_resource_id \n" +
"WHERE c.attr_type = '组件类型' GROUP BY c.attr_value", ps);
return new Result<List<Map<String,Object>>>().ok(maps);
}