1、修改能力统计列表和详情-部分查询的条件限制

This commit is contained in:
yitonglei 2022-06-30 17:56:40 +08:00
parent 9d04ba4113
commit 274b11639f
2 changed files with 10 additions and 10 deletions

View File

@ -249,9 +249,9 @@ public class CensusControllerV3 {
@ApiImplicitParam(name = "resourceType",value = "资源类型(组件服务、应用资源、基础设施、数据资源、知识库)", paramType = "query", dataType = "String") @ApiImplicitParam(name = "resourceType",value = "资源类型(组件服务、应用资源、基础设施、数据资源、知识库)", paramType = "query", dataType = "String")
}) })
public Result<List<Map<String, Object>>> assemblerUseInfo(@ApiIgnore @RequestParam Map<String, Object> params){ public Result<List<Map<String, Object>>> assemblerUseInfo(@ApiIgnore @RequestParam Map<String, Object> params){
Object[] ps = {params.get("id"),params.get("resourceType")}; Object[] ps = {params.get("id"),params.get("id"),params.get("resourceType")};
List<Map<String, Object>> maps = jdbcTemplate.queryForList("SELECT count(d.id) as num,d.attr_value 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 INNER JOIN tb_data_attr d ON c.id = d.data_resource_id\n" + List<Map<String, Object>> maps = jdbcTemplate.queryForList("SELECT count(d.id) as num,d.attr_value 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 INNER JOIN tb_data_attr d ON c.id = d.data_resource_id INNER JOIN sys_dept e ON b.dept_id = e.id\n" +
"WHERE a.del_flag = 0 AND b.dept_id = ? AND c.type = ? AND d.attr_type = '组件类型' \n" + " WHERE a.del_flag = 0 AND (e.id = ? OR INSTR(e.pids,?)) AND c.type = ? AND d.attr_type = '组件类型' \n" +
"GROUP BY d.attr_value", ps); "GROUP BY d.attr_value", ps);
return new Result<List<Map<String,Object>>>().ok(maps); return new Result<List<Map<String,Object>>>().ok(maps);
@ -297,10 +297,10 @@ public class CensusControllerV3 {
@ApiImplicitParam(name = "resourceType",value = "资源类型(组件服务、应用资源、基础设施、数据资源、知识库)", paramType = "query", dataType = "String") @ApiImplicitParam(name = "resourceType",value = "资源类型(组件服务、应用资源、基础设施、数据资源、知识库)", paramType = "query", dataType = "String")
}) })
public Result<List<Map<String, Object>>> assemblerUseScoreTopInfo(@ApiIgnore @RequestParam Map<String, Object> params){ public Result<List<Map<String, Object>>> assemblerUseScoreTopInfo(@ApiIgnore @RequestParam Map<String, Object> params){
Object[] ps = {params.get("resourceType"),params.get("id")}; 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" + 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_user c on a.user_id = c.id \n" + "INNER JOIN sys_dept c ON b.dept_id = c.id\n" +
"where a.del_flag = 0 and b.type = ? and c.dept_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); "group by b.name order by score desc limit 5", ps);
return new Result<List<Map<String,Object>>>().ok(maps); return new Result<List<Map<String,Object>>>().ok(maps);

View File

@ -1076,9 +1076,9 @@
COUNT( tdav.data_resource_id ) AS total COUNT( tdav.data_resource_id ) AS total
FROM FROM
( select a.* from tb_data_attr a inner join tb_data_resource d on a.data_resource_id = d.id ( select a.* from tb_data_attr a inner join tb_data_resource d on a.data_resource_id = d.id
inner join tb_data_resource_rel e on e.reference_id = d.id inner join sys_user f on e.creator = f.id where inner join tb_data_resource_rel e on e.reference_id = d.id inner join sys_user f on e.creator = f.id
d.type=#{resourceType} inner join sys_dept g on f.dept_id = g.id
and f.dept_id = #{id} where d.type=#{resourceType} and (g.id = #{id} OR instr(g.pids,#{id}))
) tdav ) tdav
JOIN mysql.help_topic b ON b.help_topic_id &lt; ( LENGTH( tdav.attr_value ) - LENGTH( REPLACE ( tdav.attr_value, JOIN mysql.help_topic b ON b.help_topic_id &lt; ( LENGTH( tdav.attr_value ) - LENGTH( REPLACE ( tdav.attr_value,
';', '' ) ) + 1 ) ';', '' ) ) + 1 )