瀏覽代碼

作者:张哲
时间:2023/04/12
类型:优化
描述:里程碑(3) 访问专辑详情加入时间限制

zizg 2 年之前
父節點
當前提交
2c32f47068
共有 1 個文件被更改,包括 8 次插入2 次删除
  1. 8 2
      src/main/resources/mapper/knowledge/analysis/PvLogMapper.xml

+ 8 - 2
src/main/resources/mapper/knowledge/analysis/PvLogMapper.xml

@@ -108,8 +108,14 @@
         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 = '详情'
+        on USSD = ai.PK_ID
+        <where>
+            <if test="firstDay != null and lastDay != null">
+                and TO_CHAR(pl.CREATE_TIME_,'yyyy-mm-dd') &gt;= #{firstDay}
+                and TO_CHAR(pl.CREATE_TIME_,'yyyy-mm-dd') &lt;= #{lastDay}
+            </if>
+            and MODULE = '知识专辑' and SUB_MODULE = '详情'
+        </where>
         group by USSD,ai.NAME
         order by value desc
     </select>