|
@@ -15,8 +15,8 @@
|
|
|
|
|
|
<select id="getkeyword" resultType="com.caimei365.manager.entity.caimei.ReturnEntity">
|
|
|
select
|
|
|
- id,
|
|
|
- keyword as value
|
|
|
+ id,
|
|
|
+ keyword as value
|
|
|
from cm_keyword_info
|
|
|
where parentLabel = 1
|
|
|
and delFlag = 1
|
|
@@ -27,8 +27,8 @@
|
|
|
|
|
|
<select id="getPageType" resultType="com.caimei365.manager.entity.caimei.CmPageType">
|
|
|
select
|
|
|
- id,
|
|
|
- pageType
|
|
|
+ id,
|
|
|
+ pageType
|
|
|
from cm_page_type
|
|
|
<where>
|
|
|
<if test="pageLabels != null and pageLabels != ''">
|
|
@@ -76,7 +76,8 @@
|
|
|
AND cbri.IP = #{ip}
|
|
|
</if>
|
|
|
<if test="corporateName != null and corporateName != ''">
|
|
|
- AND (cbri.corporateName like concat('%',#{corporateName},'%') OR cbri.consultName LIKE concat('%',#{corporateName},'%') or cbri.contacts like concat('%',#{corporateName},'%'))
|
|
|
+ AND (cbri.corporateName like concat('%',#{corporateName},'%') OR cbri.consultName LIKE
|
|
|
+ concat('%',#{corporateName},'%') or cbri.contacts like concat('%',#{corporateName},'%'))
|
|
|
</if>
|
|
|
<if test="companyType != null and companyType != ''">
|
|
|
AND cbri.companyType = #{companyType}
|
|
@@ -85,7 +86,8 @@
|
|
|
AND cbri.accessClient =#{accessClient}
|
|
|
</if>
|
|
|
<if test="contacts != null and contacts != ''">
|
|
|
- AND (cbri.corporateName like concat('%',#{contacts},'%') or cbri.contacts like concat('%',#{contacts},'%'))
|
|
|
+ AND (cbri.corporateName like concat('%',#{contacts},'%') or cbri.contacts like
|
|
|
+ concat('%',#{contacts},'%'))
|
|
|
</if>
|
|
|
<if test="phoneNumber != null and phoneNumber != ''">
|
|
|
AND cbri.phoneNumber = #{phoneNumber}
|
|
@@ -101,10 +103,10 @@
|
|
|
</if>
|
|
|
<if test="relevanceShop != null and relevanceShop != ''">
|
|
|
AND (cbri.relevanceShop like concat('%',#{relevanceShop},'%')
|
|
|
- <if test="behaviorType == 2">
|
|
|
- or cbri.behaviorType = #{behaviorType}
|
|
|
- </if>
|
|
|
- )
|
|
|
+ <if test="behaviorType == 2">
|
|
|
+ or cbri.behaviorType = #{behaviorType}
|
|
|
+ </if>
|
|
|
+ )
|
|
|
</if>
|
|
|
<if test="labels != null and labels.size > 0">
|
|
|
AND
|
|
@@ -115,7 +117,7 @@
|
|
|
<if test="pageLabels != null and pageLabels != ''">
|
|
|
AND cbri.pageLabels like concat('%', #{pageLabels}, '%')
|
|
|
</if>
|
|
|
- <if test="pageTypes != null and pageTypes != ''">
|
|
|
+ <if test="pageTypes != null and pageTypes != ''">
|
|
|
AND cbri.pageTypes like concat('%', #{pageTypes}, '%')
|
|
|
</if>
|
|
|
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
|
@@ -170,7 +172,8 @@
|
|
|
AND cbrt.IP = #{ip}
|
|
|
</if>
|
|
|
<if test="corporateName != null and corporateName != ''">
|
|
|
- AND (cbrt.corporateName like concat('%',#{corporateName},'%') OR cbrt.consultName LIKE concat('%',#{corporateName},'%') or cbrt.contacts like concat('%',#{corporateName},'%'))
|
|
|
+ AND (cbrt.corporateName like concat('%',#{corporateName},'%') OR cbrt.consultName LIKE
|
|
|
+ concat('%',#{corporateName},'%') or cbrt.contacts like concat('%',#{corporateName},'%'))
|
|
|
</if>
|
|
|
<if test="companyType != null and companyType != ''">
|
|
|
AND cbrt.companyType = #{companyType}
|
|
@@ -179,7 +182,8 @@
|
|
|
AND cbrt.accessClient =#{accessClient}
|
|
|
</if>
|
|
|
<if test="contacts != null and contacts != ''">
|
|
|
- AND (cbrt.corporateName like concat('%',#{contacts},'%') or cbrt.contacts like concat('%',#{contacts},'%'))
|
|
|
+ AND (cbrt.corporateName like concat('%',#{contacts},'%') or cbrt.contacts like
|
|
|
+ concat('%',#{contacts},'%'))
|
|
|
</if>
|
|
|
<if test="phoneNumber != null and phoneNumber != ''">
|
|
|
AND cbrt.phoneNumber = #{phoneNumber}
|
|
@@ -221,7 +225,9 @@
|
|
|
ORDER BY cbrt.accessTime DESC
|
|
|
</select>
|
|
|
<select id="selRegion" resultType="com.caimei365.manager.entity.caimei.CmBehaviorRecord">
|
|
|
- SELECT * FROM cm_behavior_record_ref where accessTime like concat('%',#{accessDate},'%')
|
|
|
+ SELECT *
|
|
|
+ FROM cm_behavior_record_ref
|
|
|
+ where accessTime like concat('%', #{accessDate}, '%')
|
|
|
</select>
|
|
|
<select id="recordList" resultType="com.caimei365.manager.entity.caimei.CmBehaviorRecord">
|
|
|
SELECT
|
|
@@ -247,7 +253,7 @@
|
|
|
LEFT JOIN product p ON b.productID = p.productID
|
|
|
LEFT JOIN cm_page_type pt ON b.pageType = pt.id
|
|
|
<where>
|
|
|
- b.accessDate = #{accessDate} AND b.IP != '106.55.202.118' AND b.delFlag = 0
|
|
|
+ b.accessDate = #{accessDate} AND b.IP != '106.55.202.118' AND b.delFlag = 0
|
|
|
<if test="userId != null">
|
|
|
AND b.userID = #{userId} AND b.IP = #{ip}
|
|
|
</if>
|
|
@@ -255,15 +261,53 @@
|
|
|
ORDER BY accessTime DESC
|
|
|
</select>
|
|
|
<select id="searchList" resultType="com.caimei365.manager.entity.caimei.ReturnEntity">
|
|
|
- SELECT cusf.id , cusf.keyword AS VALUE
|
|
|
+ SELECT cusf.id, cusf.keyword AS VALUE
|
|
|
FROM cm_user_search_frequency cusf
|
|
|
- LEFT JOIN cm_shop_label csl ON csl.keywordId = cusf.id
|
|
|
- LEFT JOIN cm_shop_relevance csr ON csr.id = csl.relevanceId
|
|
|
+ LEFT JOIN cm_shop_label csl ON csl.keywordId = cusf.id
|
|
|
+ LEFT JOIN cm_shop_relevance csr ON csr.id = csl.relevanceId
|
|
|
WHERE cusf.trueStatus = 1
|
|
|
AND csl.delFlag = 0
|
|
|
AND csr.delFlag = 0
|
|
|
</select>
|
|
|
<select id="behaviorShopNameList" resultType="com.caimei365.manager.entity.caimei.CmBehaviorRecord">
|
|
|
- SELECT cbs.recordID, cbs.shopID, s.name FROM cm_behavior_shopId cbs LEFT JOIN shop s ON cbs.shopID = s.shopID
|
|
|
+ SELECT cbs.recordID, cbs.shopID, s.name
|
|
|
+ FROM cm_behavior_shopId cbs
|
|
|
+ LEFT JOIN shop s ON cbs.shopID = s.shopID
|
|
|
+ </select>
|
|
|
+ <select id="getProductCountList" resultType="com.caimei365.manager.entity.caimei.CmBehaviorRecord">
|
|
|
+ SELECT cbr.productId,COUNT(cbr.productId) AS productCount,p.mainImage as productImage,p.name as productName
|
|
|
+ FROM cm_behavior_record_index cbr
|
|
|
+ LEFT JOIN product p ON cbr.productId = p.productId
|
|
|
+ WHERE cbr.productId > 0
|
|
|
+ <if test="productId != null">
|
|
|
+ AND cbr.productId = #{productId}
|
|
|
+ </if>
|
|
|
+ <if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''">
|
|
|
+ AND cbr.accessDate between #{beginTime} and #{endTime}
|
|
|
+ </if>
|
|
|
+ GROUP BY cbr.productId
|
|
|
+ ORDER BY productCount DESC
|
|
|
+ </select>
|
|
|
+ <select id="getProductCountDetail" resultType="com.caimei365.manager.entity.caimei.CmBehaviorRecord">
|
|
|
+ SELECT cbr.ip,
|
|
|
+ IF(userId = 0, '', cbr.region) AS region,
|
|
|
+ cbr.userId,
|
|
|
+ cbr.contacts,
|
|
|
+ cbr.phoneNumber,
|
|
|
+ cbr.spName,
|
|
|
+ cbr.lastAccessTime,
|
|
|
+ cbr.accessDate,
|
|
|
+ cbr.corporateName,
|
|
|
+ (CASE
|
|
|
+ WHEN cbr.accessClient = 1 THEN '小程序'
|
|
|
+ ELSE '网站' END) AS accessClient,
|
|
|
+ (CASE
|
|
|
+ WHEN cbr.companyType = 1 THEN '游客'
|
|
|
+ WHEN cbr.companyType = 2 THEN '机构'
|
|
|
+ ELSE '供应商' END) AS companyType,
|
|
|
+ SUM(cbr.accessDuration) AS accessDuration
|
|
|
+ FROM cm_behavior_record_index cbr
|
|
|
+ WHERE cbr.productId = #{productId}
|
|
|
+ GROUP BY cbr.userId
|
|
|
</select>
|
|
|
</mapper>
|