能力统计-资源图谱

This commit is contained in:
dinggang 2022-05-25 11:13:25 +08:00
parent 2a6e4959b3
commit 3444868612
5 changed files with 104 additions and 10 deletions

View File

@ -320,6 +320,13 @@ public class CensusController {
return new Result().ok(resourceService.applicationAreaCapabilitySet()); return new Result().ok(resourceService.applicationAreaCapabilitySet());
} }
@GetMapping("/selectResourceListByAppArea")
@ApiOperation("资源图谱-应用领域-能力集-根据应用领域查能力")
@LogOperation("资源图谱-应用领域-能力集-根据应用领域查能力")
public Result selectResourceListByAppArea(@RequestParam String appArea) {
return new Result().ok(resourceService.selectResourceListByAppArea(appArea));
}
@GetMapping("/selectResourceListByType") @GetMapping("/selectResourceListByType")
@ApiOperation("资源图谱-能力类型-能力集-根据类型查能力") @ApiOperation("资源图谱-能力类型-能力集-根据类型查能力")
@LogOperation("资源图谱-能力类型-能力集-根据类型查能力") @LogOperation("资源图谱-能力类型-能力集-根据类型查能力")

View File

@ -99,4 +99,11 @@ public interface ResourceDao extends BaseDao<ResourceEntity> {
List<Map> selectByType(@Param("type") String s); List<Map> selectByType(@Param("type") String s);
List<Map> selectTypeCountList(); List<Map> selectTypeCountList();
List<String> selectMaxAppArea();
List<Map> selectByAppArea(@Param("type") String s);
List<Map> selectAppAreaCountList();
} }

View File

@ -72,4 +72,6 @@ public interface ResourceService extends CrudService<ResourceEntity, ResourceDTO
Object applicationAreaCapabilitySet(); Object applicationAreaCapabilitySet();
Object selectResourceListByType(String type); Object selectResourceListByType(String type);
Object selectResourceListByAppArea(String appArea);
} }

View File

@ -513,22 +513,22 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
maxdeptMap.put("resourceList", resourceList); maxdeptMap.put("resourceList", resourceList);
maxdeptMap.put("typeName", types.get(0)); maxdeptMap.put("typeName", types.get(0));
resultMap.put("maxDept", maxdeptMap); resultMap.put("maxDept", maxdeptMap);
List<Map> deptList = resourceDao.selectTypeCountList(); List<Map> typeList = resourceDao.selectTypeCountList();
resultMap.put("typeList", deptList); resultMap.put("typeList", typeList);
return resultMap; return resultMap;
} }
@Override @Override
public Object applicationAreaCapabilitySet() { public Object applicationAreaCapabilitySet() {
HashMap<String, Object> resultMap = new HashMap<>(); HashMap<String, Object> resultMap = new HashMap<>();
//List<String> types = resourceDao.selectMaxAppArea(); List<String> types = resourceDao.selectMaxAppArea();
//List<Map> resourceList = resourceDao.selectByApparea(types.get(0)); List<Map> resourceList = resourceDao.selectByAppArea(types.get(0));
//HashMap<String, Object> maxdeptMap = new HashMap<>(); HashMap<String, Object> maxAppAreaMap = new HashMap<>();
//maxdeptMap.put("resourceList", resourceList); maxAppAreaMap.put("resourceList", resourceList);
//maxdeptMap.put("typeName", types.get(0)); maxAppAreaMap.put("typeName", types.get(0));
//resultMap.put("maxDept", maxdeptMap); resultMap.put("maxAppArea", maxAppAreaMap);
//List<Map> deptList = resourceDao.selectTypeCountList(); List<Map> appAreaList = resourceDao.selectAppAreaCountList();
//resultMap.put("typeList", deptList); resultMap.put("appAreaList", appAreaList);
return resultMap; return resultMap;
} }
@ -537,4 +537,9 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
return resourceDao.selectByType(type); return resourceDao.selectByType(type);
} }
@Override
public Object selectResourceListByAppArea(String appArea) {
return resourceDao.selectByAppArea(appArea);
}
} }

View File

@ -792,4 +792,77 @@
total DESC total DESC
</select> </select>
<select id="selectMaxAppArea" resultType="java.lang.String">
SELECT
type
FROM
(
SELECT
SUBSTRING_INDEX( SUBSTRING_INDEX( tdav.attr_value, ';', b.help_topic_id + 1 ), ';',- 1 ) AS "type",
COUNT( tdav.data_resource_id ) AS "count"
FROM
tb_data_attr tdav
JOIN mysql.help_topic b ON b.help_topic_id &lt; ( LENGTH( tdav.attr_value ) - LENGTH( REPLACE ( tdav.attr_value, ';', '' ) ) + 1 )
WHERE
1 = 1
AND tdav.attr_type = '应用领域'
AND tdav.del_flag = 0
AND SUBSTRING_INDEX( SUBSTRING_INDEX( tdav.attr_value, ';', b.help_topic_id + 1 ), ';',- 1 ) != ''
GROUP BY
type
) temp1
WHERE
temp1.count = (
SELECT
MAX( count ) AS "total"
FROM
(
SELECT
SUBSTRING_INDEX( SUBSTRING_INDEX( tdav.attr_value, ';', b.help_topic_id + 1 ), ';',- 1 ) AS "type",
COUNT( tdav.data_resource_id ) AS "count"
FROM
tb_data_attr tdav
JOIN mysql.help_topic b ON b.help_topic_id &lt; ( LENGTH( tdav.attr_value ) - LENGTH( REPLACE ( tdav.attr_value, ';', '' ) ) + 1 )
WHERE
1 = 1
AND tdav.attr_type = '应用领域'
AND tdav.del_flag = 0
AND SUBSTRING_INDEX( SUBSTRING_INDEX( tdav.attr_value, ';', b.help_topic_id + 1 ), ';',- 1 ) != ''
GROUP BY
type
) temp2
)
</select>
<select id="selectByAppArea" resultType="java.util.Map">
SELECT
tdr.id,
tdr.name
FROM
tb_data_resource tdr,
tb_data_attr tda
WHERE
1 = 1
AND tdr.del_flag = 0
AND tda.del_flag = 0
AND tdr.id = tda.data_resource_id
AND attr_value LIKE CONCAT('%', #{type}, '%')
</select>
<select id="selectAppAreaCountList" resultType="java.util.Map">
SELECT
SUBSTRING_INDEX( SUBSTRING_INDEX( tdav.attr_value, ';', b.help_topic_id + 1 ), ';',- 1 ) AS "type",
COUNT( tdav.data_resource_id ) AS "total"
FROM
tb_data_attr tdav
JOIN mysql.help_topic b ON b.help_topic_id &lt; ( LENGTH( tdav.attr_value ) - LENGTH( REPLACE ( tdav.attr_value, ';', '' ) ) + 1 )
WHERE
1 = 1
AND tdav.attr_type = '应用领域'
AND tdav.del_flag = 0
AND SUBSTRING_INDEX( SUBSTRING_INDEX( tdav.attr_value, ';', b.help_topic_id + 1 ), ';',- 1 ) != ''
GROUP BY
type
</select>
</mapper> </mapper>