资源提供方应用领域分词

This commit is contained in:
wangliwen 2022-05-25 09:44:09 +08:00
parent 08bde6f597
commit 05ad116e04
2 changed files with 15 additions and 7 deletions

View File

@ -192,7 +192,7 @@ public class CensusController {
List<CompletableFuture> completableFutures =
temp.stream().mapToLong(index -> Long.valueOf(index.get("dept_id").toString())).mapToObj(deptId -> {
CompletableFuture<Void> task =
CompletableFuture.supplyAsync(() -> { // 获取资源汇聚总量
CompletableFuture.supplyAsync(() -> { // 获取部门提供能力
List<String> db = resourceService.selectDeptProvide(deptId);
Set<String> type =
db.stream().flatMap(index_ -> Arrays.stream(index_.split(";"))).filter(index_ -> StringUtils.isNotEmpty(index_)).filter(index_ -> !"其他".equals(index_)).collect(Collectors.toSet());

View File

@ -528,15 +528,23 @@
</select>
<select id="selectDeptProvideCount" resultType="java.util.Map">
SELECT
COUNT(
DISTINCT any_value ( tda.attr_value )) count,
COUNT( DISTINCT temp.value_ ) count,
any_value ( tdr.dept_id ) dept_id
FROM
tb_data_attr tda
INNER JOIN tb_data_resource tdr ON tda.data_resource_id = tdr.id
AND tdr.dept_id IS NOT NULL
(
SELECT
SUBSTRING_INDEX( SUBSTRING_INDEX( tdav.attr_value, ';', b.help_topic_id + 1 ), ';',- 1 ) AS value_,
tdav.data_resource_id AS resourceId
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
tda.attr_type = '应用领域'
1 = 1
AND tdav.attr_type = '应用领域'
AND tdav.del_flag = 0
) temp
INNER JOIN tb_data_resource tdr ON temp.resourceId = tdr.id
AND tdr.dept_id IS NOT NULL
GROUP BY
tdr.dept_id
ORDER BY