123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158 |
- <?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.redxun.knowledge.analysis.mapper.AnalysisCommonMapper">
- <select id="knowledgeTotalAmount" resultType="int">
- select count(*) from KM_KNOWLEDGE where APPROVAL_STATUS = 5
- </select>
- <select id="mapTotalAmount" resultType="int">
- select count(*) from KM_MAP
- </select>
- <select id="albumTotalAmount" resultType="int">
- select count(distinct ALBUM_ID) from KM_ALBUM_VERSION where APPROVAL_STATE = 5
- </select>
- <select id="knowledgeTotalByType" resultType="int">
- select count(*)
- from KM_KNOWLEDGE
- where APPROVAL_STATUS = 5 and TYPE = #{type}
- </select>
- <select id="searchParticipleWordCloud"
- resultType="com.redxun.knowledge.analysis.entity.vo.SearchParticipleWordCloudVo">
- select PARTICIPLE as participle, count(PARTICIPLE) as frequency
- from KM_SEARCH_PARTICIPLE_LOG
- group by participle
- order by frequency desc
- </select>
- <select id="knowledgeTypeVisitProportion" resultType="string">
- select USSD from KM_PV_LOG
- <where>
- MODULE = '知识仓库' and SUB_MODULE = '详情'
- <if test="firstDay != null and lastDay != null">
- and TO_CHAR(CREATE_TIME_,'yyyy-mm-dd') >= #{firstDay}
- and TO_CHAR(CREATE_TIME_,'yyyy-mm-dd') <= #{lastDay}
- </if>
- </where>
- </select>
- <select id="level1Knowledge" resultType="string">
- select PK_ID
- from KM_KNOWLEDGE_CATEGORY
- where PARENT = '0' and IS_DEL = 0
- </select>
- <select id="level1KnowledgeHistogram" resultType="int">
- select type
- from KM_KNOWLEDGE
- <where>
- CATEGORY_ID IN (
- SELECT c.PK_ID FROM KM_KNOWLEDGE_CATEGORY c START WITH c.PK_ID = #{categoryId} CONNECT BY PRIOR c.PK_ID =
- c.PARENT
- )
- <if test="firstDay != null and lastDay != null">
- and TO_CHAR(CREATE_TIME_,'yyyy-mm-dd') >= #{firstDay}
- and TO_CHAR(CREATE_TIME_,'yyyy-mm-dd') <= #{lastDay}
- </if>
- and IS_DRAFT = 1
- </where>
- </select>
- <select id="selectCategoryName" resultType="string">
- select NAME from KM_KNOWLEDGE_CATEGORY where PK_ID = #{pkId}
- </select>
- <resultMap id="info" type="com.redxun.knowledge.analysis.entity.dao.KnowledgeDao">
- <result column="name" property="companyId"/>
- <collection property="counts" ofType="map">
- <result column="type" property="type"/>
- <result column="count" property="count"/>
- </collection>
- </resultMap>
- <select id="organizationKnowledges" resultMap="info">
- select NAME_ as name,count(*) as count,TYPE as type
- from KM_KNOWLEDGE ai
- join LEARNING_USER_DEV.OS_USER users on ai.CREATE_BY_ = users.USER_ID_
- join LEARNING_USER_DEV.OS_GROUP groups on users.COMPANY_ID_ = groups.GROUP_ID_
- <where>
- <if test="firstDay != null and lastDay != null">
- TO_CHAR(ai.CREATE_TIME_,'yyyy-mm-dd') >= #{firstDay}
- and TO_CHAR(ai.CREATE_TIME_,'yyyy-mm-dd') <= #{lastDay}
- </if>
- </where>
- group by users.COMPANY_ID_,TYPE,NAME_
- </select>
- <select id="organizationVisit" resultMap="info">
- select count(*) as count,TYPE as type
- from KM_KNOWLEDGE
- <where>
- <if test="organizationId != null">
- CREATE_DEP_ID_ in (
- select GROUP_ID_ from LEARNING_USER_DEV.OS_GROUP where GROUP_ID_ in(
- SELECT GROUP_ID_ FROM LEARNING_USER_DEV.OS_GROUP c
- START WITH c.GROUP_ID_ = #{organizationId} CONNECT BY PRIOR c.GROUP_ID_ = c.PARENT_ID_
- )
- )
- </if>
- <if test="firstDay != null and lastDay != null">
- and TO_CHAR(CREATE_TIME_,'yyyy-mm-dd') >= #{firstDay}
- and TO_CHAR(CREATE_TIME_,'yyyy-mm-dd') <= #{lastDay}
- </if>
- and IS_DRAFT = 1
- </where>
- group by TYPE
- </select>
- <select id="personKnowledgeValue" resultType="int">
- select type
- from KM_KNOWLEDGE
- <where>
- <if test="round == 1">
- CREATE_BY_ = #{id}
- </if>
- <if test="round == 2">
- CREATE_DEP_ID_ in (
- select GROUP_ID_ from LEARNING_USER_DEV.OS_GROUP where GROUP_ID_ in(
- SELECT GROUP_ID_ FROM LEARNING_USER_DEV.OS_GROUP c
- START WITH c.GROUP_ID_ = #{id} CONNECT BY PRIOR c.GROUP_ID_ = c.PARENT_ID_
- )
- )
- </if>
- <if test="firstDay != null and lastDay != null">
- and TO_CHAR(CREATE_TIME_,'yyyy-mm-dd') >= #{firstDay}
- and TO_CHAR(CREATE_TIME_,'yyyy-mm-dd') <= #{lastDay}
- </if>
- and IS_DRAFT = 1
- </where>
- </select>
- <select id="knowledgeSum" resultType="int">
- select count(*)
- from KM_KNOWLEDGE
- <where>
- APPROVAL_STATUS = 5
- <if test="userId != null">
- and CREATE_BY_ = #{userId}
- </if>
- </where>
- </select>
- <select id="yelpSum" resultType="int">
- select count(*)
- from KM_ALBUM_YELP
- <where>
- APPROVAL_STATE = 5
- <if test="userId != null">
- and CREATE_BY_ = #{userId}
- </if>
- </where>
- </select>
- </mapper>
|