|
@@ -1,88 +1,16 @@
|
|
|
-<!--<?xml version="1.0" encoding="UTF-8"?>-->
|
|
|
-<!--<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">-->
|
|
|
-<!--<mapper namespace="com.qizhen.healsphere.repository.mapper.KgCountInfoMapper">-->
|
|
|
+<?xml version="1.0" encoding="UTF-8"?>
|
|
|
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
+<mapper namespace="com.qizhen.healsphere.repository.mapper.KgCountInfoMapper">
|
|
|
|
|
|
-<!-- <!– 通用查询映射结果 –>-->
|
|
|
-<!-- <resultMap id="BaseResultMap" type="com.qizhen.healsphere.repository.mapper.entity.KgCountInfo">-->
|
|
|
-<!-- <id column="id" property="id" />-->
|
|
|
-<!-- <result column="gmt_create" property="gmtCreate" />-->
|
|
|
-<!-- <result column="gmt_modified" property="gmtModified" />-->
|
|
|
-<!-- <result column="node_type" property="nodeType" />-->
|
|
|
-<!-- <result column="node_num" property="nodeNum" />-->
|
|
|
-<!-- <result column="node_prop_num" property="nodePropNum" />-->
|
|
|
-<!-- <result column="relation_type" property="relationType" />-->
|
|
|
-<!-- <result column="relation_num" property="relationNum" />-->
|
|
|
-<!-- </resultMap>-->
|
|
|
-
|
|
|
-<!-- <select id="getCountList" resultMap="BaseResultMap">-->
|
|
|
-<!-- select * from kg_count_info limit #{pageSize} offset #{offset}-->
|
|
|
-<!-- </select>-->
|
|
|
-
|
|
|
-<!-- <select id="count" resultType="java.lang.Integer">-->
|
|
|
-<!-- select count(*) from kg_count_info-->
|
|
|
-<!-- </select>-->
|
|
|
-
|
|
|
-<!-- <!– 按照节点类型统计详细信息 –>-->
|
|
|
-<!-- <select id="calculateDetailInfo" resultMap="BaseResultMap">-->
|
|
|
-<!-- SELECT -->
|
|
|
-<!-- n.category as node_type,-->
|
|
|
-<!-- COUNT(DISTINCT n.id) as node_num,-->
|
|
|
-<!-- COALESCE(SUM(prop_counts.prop_num), 0) as node_prop_num,-->
|
|
|
-<!-- COUNT(DISTINCT edge_counts.type) as relation_type,-->
|
|
|
-<!-- COALESCE(SUM(edge_counts.relation_count), 0) as relation_num-->
|
|
|
-<!-- FROM kg_nodes n-->
|
|
|
-<!-- LEFT JOIN (-->
|
|
|
-<!-- SELECT -->
|
|
|
-<!-- ref_id,-->
|
|
|
-<!-- COUNT(*) as prop_num-->
|
|
|
-<!-- FROM kg_props-->
|
|
|
-<!-- GROUP BY ref_id-->
|
|
|
-<!-- ) prop_counts ON n.id = prop_counts.ref_id-->
|
|
|
-<!-- LEFT JOIN (-->
|
|
|
-<!-- SELECT -->
|
|
|
-<!-- src_id as node_id,-->
|
|
|
-<!-- name as type,-->
|
|
|
-<!-- COUNT(*) as relation_count-->
|
|
|
-<!-- FROM kg_edges-->
|
|
|
-<!-- GROUP BY src_id, name-->
|
|
|
-<!-- UNION ALL-->
|
|
|
-<!-- SELECT -->
|
|
|
-<!-- dest_id as node_id,-->
|
|
|
-<!-- name as type,-->
|
|
|
-<!-- COUNT(*) as relation_count-->
|
|
|
-<!-- FROM kg_edges-->
|
|
|
-<!-- GROUP BY dest_id, name-->
|
|
|
-<!-- ) edge_counts ON n.id = edge_counts.node_id-->
|
|
|
-<!-- GROUP BY n.category-->
|
|
|
-<!-- </select>-->
|
|
|
-
|
|
|
-<!-- <!– 清空统计表 –>-->
|
|
|
-<!-- <delete id="clearTable">-->
|
|
|
-<!-- DELETE FROM kg_count_info-->
|
|
|
-<!-- </delete>-->
|
|
|
-
|
|
|
-<!-- <!– 批量插入统计数据 –>-->
|
|
|
-<!-- <insert id="batchInsert" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">-->
|
|
|
-<!-- INSERT INTO kg_count_info (-->
|
|
|
-<!-- gmt_create,-->
|
|
|
-<!-- gmt_modified,-->
|
|
|
-<!-- node_type,-->
|
|
|
-<!-- node_num,-->
|
|
|
-<!-- node_prop_num,-->
|
|
|
-<!-- relation_type,-->
|
|
|
-<!-- relation_num-->
|
|
|
-<!-- ) VALUES -->
|
|
|
-<!-- <foreach collection="list" item="item" separator=",">-->
|
|
|
-<!-- (-->
|
|
|
-<!-- now(),-->
|
|
|
-<!-- now(),-->
|
|
|
-<!-- #{item.nodeType},-->
|
|
|
-<!-- #{item.nodeNum},-->
|
|
|
-<!-- #{item.nodePropNum},-->
|
|
|
-<!-- #{item.relationType},-->
|
|
|
-<!-- #{item.relationNum}-->
|
|
|
-<!-- )-->
|
|
|
-<!-- </foreach>-->
|
|
|
-<!-- </insert>-->
|
|
|
-
|
|
|
-<!--</mapper>-->
|
|
|
+ <!-- 通用查询映射结果 -->
|
|
|
+ <resultMap id="BaseResultMap" type="com.qizhen.healsphere.repository.mapper.entity.KgCountInfo">
|
|
|
+ <id column="id" property="id" />
|
|
|
+ <result column="gmt_create" property="gmtCreate" />
|
|
|
+ <result column="gmt_modified" property="gmtModified" />
|
|
|
+ <result column="node_type" property="nodeType" />
|
|
|
+ <result column="node_num" property="nodeNum" />
|
|
|
+ <result column="node_prop_num" property="nodePropNum" />
|
|
|
+ <result column="relation_type" property="relationType" />
|
|
|
+ <result column="relation_num" property="relationNum" />
|
|
|
+ </resultMap>
|
|
|
+</mapper>
|