1、修改能力统计列表和详情-组件服务-使用情况统计-使用组件评分TOP5的sql

This commit is contained in:
yitonglei 2022-07-01 14:38:11 +08:00
parent fa9f22628b
commit c72f598780
1 changed files with 4 additions and 4 deletions

View File

@ -299,10 +299,10 @@ public class CensusControllerV3 {
})
public Result<List<Map<String, Object>>> assemblerUseScoreTopInfo(@ApiIgnore @RequestParam Map<String, Object> params){
Object[] ps = {params.get("resourceType"),params.get("id"),params.get("id")};
List<Map<String, Object>> maps = jdbcTemplate.queryForList("SELECT AVG(a.score) as score,b.name FROM tb_resource_score a INNER JOIN tb_data_resource b on a.resource_id = b.id\n" +
"INNER JOIN sys_dept c ON b.dept_id = c.id\n" +
"WHERE a.del_flag = 0 AND b.type = ? AND (c.id = ? OR INSTR(c.pids,?))\n" +
"group by b.name order by score desc limit 5", ps);
List<Map<String, Object>> maps = jdbcTemplate.queryForList("SELECT SUM(IFNULL(e.score,0)) as score,c.name FROM tb_data_resource_rel a INNER JOIN sys_user b ON a.creator = b.id INNER JOIN tb_data_resource c ON a.reference_id = c.id\n" +
"INNER JOIN sys_dept d ON b.dept_id = d.id INNER JOIN tb_resource_score e ON a.reference_id = e.resource_id \n" +
"WHERE a.del_flag = 0 AND c.type = ? AND c.del_flag = 0 AND (d.id = ? OR INSTR(d.pids,?)) AND e.del_flag = 0\n" +
"group by c.name order by score desc limit 5", ps);
return new Result<List<Map<String,Object>>>().ok(maps);
}