123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- <?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.PvLogMapper">
- <resultMap id="PvLog" type="com.redxun.knowledge.analysis.entity.dao.PvLog">
- <id property="pkId" column="PK_ID" jdbcType="VARCHAR"/>
- <result property="module" column="MODULE" jdbcType="VARCHAR"/>
- <result property="subModule" column="SUB_MODULE" jdbcType="VARCHAR"/>
- <result property="userId" column="USER_ID" jdbcType="VARCHAR"/>
- <result property="companyId" column="COMPANY_ID" jdbcType="VARCHAR"/>
- <result property="page" column="PAGE" jdbcType="VARCHAR"/>
- <result property="platform" column="PLATFORM" jdbcType="VARCHAR"/>
- <result property="ussd" column="USSD" jdbcType="VARCHAR"/>
- <result property="companyId" column="COMPANY_ID_" jdbcType="VARCHAR"/>
- <result property="createDepId" column="CREATE_DEP_ID_" jdbcType="VARCHAR"/>
- <result property="tenantId" column="TENANT_ID_" jdbcType="VARCHAR"/>
- <result property="createBy" column="CREATE_BY_" jdbcType="VARCHAR"/>
- <result property="createTime" column="CREATE_TIME_" jdbcType="DATE"/>
- <result property="updateBy" column="UPDATE_BY_" jdbcType="VARCHAR"/>
- <result property="updateTime" column="UPDATE_TIME_" jdbcType="DATE"/>
- </resultMap>
- <select id="query" resultType="com.redxun.knowledge.analysis.entity.dao.PvLog" parameterType="java.util.Map">
- select
- PK_ID,MODULE,SUB_MODULE,USER_ID,COMPANY_ID,PAGE,PLATFORM,USSD,COMPANY_ID_,CREATE_DEP_ID_,TENANT_ID_,CREATE_BY_,CREATE_TIME_,UPDATE_BY_,UPDATE_TIME_
- from KM_PV_LOG
- <where>
- <if test="@rx.Ognl@isNotEmpty(w.whereSql)">
- ${w.whereSql}
- </if>
- </where>
- <if test="@rx.Ognl@isNotEmpty(w.orderBySql)">
- ORDER BY ${w.orderBySql}
- </if>
- <if test="@rx.Ognl@isEmpty(w.orderBySql)">
- ORDER BY PK_ID DESC
- </if>
- </select>
- <insert id="insert">
- insert into KM_PV_LOG (PK_ID, MODULE, SUB_MODULE, USER_ID, COMPANY_ID, PAGE, PLATFORM, USSD, COMPANY_ID_,
- CREATE_DEP_ID_, TENANT_ID_, CREATE_BY_, CREATE_TIME_, UPDATE_BY_, UPDATE_TIME_)
- values (#{pkId}, #{module}, #{subModule}, #{userId}, #{companyId}, #{page}, #{platform}, #{ussd}, #{companyId},
- #{createDepId},
- #{tenantId},
- #{createBy},
- #{createTime},
- #{updateBy},
- #{updateTime})
- </insert>
- <select id="selectYearTotal" resultType="int">
- select count(*) from KM_PV_LOG
- where
- TO_CHAR(CREATE_TIME_,'yyyy-mm-dd') >= #{firstYearDate}
- and TO_CHAR(CREATE_TIME_,'yyyy-mm-dd') <= #{lastYearDate}
- </select>
- <select id="selectSearchVisitHistogramByMonth" resultType="int">
- select count(*)
- from KM_PV_LOG
- <where>
- TO_CHAR(CREATE_TIME_,'yyyy-mm-dd') >= #{firstOfMonth}
- and TO_CHAR(CREATE_TIME_,'yyyy-mm-dd') <= #{lastOfMonth}
- <if test="platform != null">
- and PLATFORM = #{platform}
- </if>
- </where>
- </select>
- <select id="albumDetailVisits" resultType="com.redxun.knowledge.analysis.entity.vo.AlbumDetailVisitsVo">
- select USSD,count(*) as value,ai.NAME as name
- from KM_PV_LOG pl
- join KM_ALBUM_INFO ai
- on USSD = ai.PK_ID and ai.IS_DEL = 0
- where MODULE = '知识专辑' and SUB_MODULE = '详情'
- group by USSD,ai.NAME
- order by value desc
- </select>
- </mapper>
|