@@ -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') >= #{firstDay}
+ and TO_CHAR(pl.CREATE_TIME_,'yyyy-mm-dd') <= #{lastDay}
+ </if>
+ and MODULE = '知识专辑' and SUB_MODULE = '详情'
+ </where>
group by USSD,ai.NAME
order by value desc
</select>