|
@@ -53,29 +53,31 @@
|
|
|
<select id="findList" resultType="com.caimei365.manager.entity.caimei.KeyWord">
|
|
|
SELECT cusf.id AS id, cusf.frequency, cusf.keyword as keyword, cusf.addTime, cusf.linkageStatus,
|
|
|
cusf.searchTime as searchTime,cusf.trueStatus as labelStatus,cusf.fromSearch as fromSearch,
|
|
|
- cusf.dynamicStatus, s.linkMan as name
|
|
|
- ,IFNULL((select sum(c.pv) from cm_praise_statistics c where c.delFlag = 0 and c.type = 6 and cusf.id = c.authorId <if test="beginTime != null and beginTime !=''">AND c.createTime >= #{beginTime} </if><if test="endTime != null and endTime !=''">AND c.createTime <![CDATA[ <= ]]> #{endTime} </if>), 0) as pv
|
|
|
+ cusf.dynamicStatus, s.linkMan as name,
|
|
|
+ IFNULL(SUM(c.pv), 0) as pv
|
|
|
FROM cm_user_search_frequency cusf
|
|
|
left join serviceprovider s on cusf.serviceProviderId = s.serviceProviderID
|
|
|
+ LEFT JOIN cm_praise_statistics c ON cusf.id = c.authorId
|
|
|
WHERE cusf.delStatus = 1
|
|
|
+ <if test="beginTime != null and beginTime !=''">
|
|
|
+ AND c.createTime >= #{beginTime}
|
|
|
+ </if>
|
|
|
+ <if test="endTime != null and endTime !=''">
|
|
|
+ AND c.createTime <![CDATA[ <= ]]> #{endTime}
|
|
|
+ </if>
|
|
|
<!-- <if test="beginTime !=null and beginTime !=''">-->
|
|
|
<!-- AND (cusf.searchTime BETWEEN #{beginTime} AND #{endTime} or cusf.searchTime IS NULL)-->
|
|
|
<!-- </if>-->
|
|
|
<if test="keyword !=null and keyword !=''">
|
|
|
AND cusf.keyword LIKE CONCAT('%',#{keyword},'%')
|
|
|
</if>
|
|
|
- <if test="labelStatus == 1">
|
|
|
- AND cusf.dynamicStatus = 0
|
|
|
- </if>
|
|
|
- <if test="labelStatus == null">
|
|
|
- AND (cusf.dynamicStatus not in (0, 1) or (cusf.dynamicStatus IS NULL))
|
|
|
- </if>
|
|
|
<if test="labelStatus !=null">
|
|
|
AND cusf.trueStatus = #{labelStatus}
|
|
|
</if>
|
|
|
<if test="fromSearch != null">
|
|
|
AND cusf.fromSearch = #{fromSearch}
|
|
|
</if>
|
|
|
+ GROUP BY cusf.id
|
|
|
ORDER BY cusf.frequency DESC, cusf.searchTime DESC
|
|
|
</select>
|
|
|
|