|
@@ -505,10 +505,80 @@
|
|
|
AND c.clubId =#{clubId}
|
|
|
</if>
|
|
|
and b.pageType in(6,8,11)
|
|
|
- and DATE(b.accessTime) = DATE(#{accessTime})
|
|
|
+ and DATE(b.accessTime) = DATE(DATE_SUB(#{accessTime}, INTERVAL 1 day))
|
|
|
+ GROUP BY b.pageLabel LIMIT 10) as a
|
|
|
+ </select>
|
|
|
+ <select id="getBehaviorRecordMinutePageLabel" resultType="string">
|
|
|
+ SELECT GROUP_CONCAT(a.pageLabel)
|
|
|
+ FROM (SELECT b.pageLabel
|
|
|
+ FROM cm_behavior_record b
|
|
|
+ LEFT JOIN club c ON b.userID = c.userID
|
|
|
+ LEFT JOIN serviceprovider sp ON b.headUserId = sp.userID
|
|
|
+ WHERE sp.status=90 and sp.serviceProviderID=#{spId}
|
|
|
+ and b.pageType in (69,70,71)
|
|
|
+ and b.accessTime between DATE_SUB(#{accessTime}, INTERVAL 5 Minute) and #{accessTime}
|
|
|
+ <if test="clubId != null">
|
|
|
+ AND c.clubId =#{clubId}
|
|
|
+ </if>
|
|
|
GROUP BY b.pageLabel LIMIT 10) as a
|
|
|
</select>
|
|
|
<select id="getBehaviorRecordYesterdayClubFrom" resultType="com.caimei365.user.model.vo.CmBehaviorRecordVo">
|
|
|
+ SELECT
|
|
|
+ b.recordID,
|
|
|
+ b.userID,
|
|
|
+ b.pagePath,
|
|
|
+ b.pageType,
|
|
|
+ b.pageLabel,
|
|
|
+ b.productID,
|
|
|
+ b.accessTime,
|
|
|
+ b.accessDuration,
|
|
|
+ b.accessDate,
|
|
|
+ b.referer,
|
|
|
+ b.accessClient,
|
|
|
+ b.isReckon,
|
|
|
+ b.region,
|
|
|
+ c.name,c.linkMan,c.contractMobile,c.clubId,u.image
|
|
|
+ FROM cm_behavior_record b
|
|
|
+ LEFT JOIN club c ON b.userID = c.userID
|
|
|
+ LEFT JOIN user u ON u.userID = c.userID
|
|
|
+ WHERE b.userId !=0
|
|
|
+ and c.spId=#{spId}
|
|
|
+ and c.clubId=#{clubId}
|
|
|
+ and b.pageType in(6,11)
|
|
|
+ and DATE(b.accessTime) = DATE(DATE_SUB(#{accessTime}, INTERVAL 1 day))
|
|
|
+ </select>
|
|
|
+ <select id="getBehaviorRecordMinuteClubFrom" resultType="com.caimei365.user.model.vo.CmBehaviorRecordVo">
|
|
|
+ SELECT
|
|
|
+ b.recordID,
|
|
|
+ b.userID,
|
|
|
+ b.pagePath,
|
|
|
+ b.pageType,
|
|
|
+ b.pageLabel,
|
|
|
+ b.productID,
|
|
|
+ b.accessTime,
|
|
|
+ b.accessDuration,
|
|
|
+ b.accessDate,
|
|
|
+ b.referer,
|
|
|
+ b.accessClient,
|
|
|
+ b.isReckon,
|
|
|
+ b.region,
|
|
|
+ (select cpaf.fileName from cm_product_archive_content cpac
|
|
|
+ left join cm_product_archive_file cpaf on cpaf.archiveContentId=cpac.id
|
|
|
+ where cpac.id=b.productArchiveId limit 1)as title,
|
|
|
+ ifnull(c.name,b.IP),
|
|
|
+ c.linkMan,c.contractMobile,c.clubId,u.image
|
|
|
+ FROM cm_behavior_record b
|
|
|
+ LEFT JOIN club c ON b.userID = c.userID
|
|
|
+ LEFT JOIN user u ON u.userID = c.userID
|
|
|
+ LEFT JOIN serviceprovider sp ON b.headUserId = sp.userID
|
|
|
+ WHERE sp.status=90 and sp.serviceProviderID=#{spId}
|
|
|
+ and b.pageType in (69,70,71)
|
|
|
+ and b.accessTime between DATE_SUB(#{accessTime}, INTERVAL 5 Minute) and #{accessTime}
|
|
|
+ <if test="clubId != null">
|
|
|
+ AND c.clubId =#{clubId}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+ <select id="getBehaviorRecordYesterdayClub" resultType="com.caimei365.user.model.vo.CmBehaviorRecordVo">
|
|
|
SELECT b.recordID,
|
|
|
b.userID,
|
|
|
b.pagePath,
|
|
@@ -522,21 +592,17 @@
|
|
|
b.accessClient,
|
|
|
b.isReckon,
|
|
|
b.region,
|
|
|
- c.name,
|
|
|
- c.linkMan,
|
|
|
- c.contractMobile,
|
|
|
- c.clubId,
|
|
|
- u.image
|
|
|
+ c.name,c.linkMan,c.contractMobile,c.clubId,u.image
|
|
|
FROM cm_behavior_record b
|
|
|
LEFT JOIN club c ON b.userID = c.userID
|
|
|
LEFT JOIN user u ON u.userID = c.userID
|
|
|
- WHERE b.userId != 0
|
|
|
- and c.spId = #{spId}
|
|
|
- and c.clubId = #{clubId}
|
|
|
- and b.pageType in (6, 11)
|
|
|
- and DATE(b.accessTime) = DATE(#{accessTime})
|
|
|
+ WHERE b.userId !=0
|
|
|
+ and c.spId=#{spId}
|
|
|
+ and b.pageType in(6,8,11)
|
|
|
+ and DATE(b.accessTime) = DATE(DATE_SUB(#{accessTime}, INTERVAL 1 day))
|
|
|
+ GROUP BY c.clubId
|
|
|
</select>
|
|
|
- <select id="getBehaviorRecordYesterdayClub" resultType="com.caimei365.user.model.vo.CmBehaviorRecordVo">
|
|
|
+ <select id="getBehaviorRecordMinuteClub" resultType="com.caimei365.user.model.vo.CmBehaviorRecordVo">
|
|
|
SELECT b.recordID,
|
|
|
b.userID,
|
|
|
b.pagePath,
|
|
@@ -550,28 +616,23 @@
|
|
|
b.accessClient,
|
|
|
b.isReckon,
|
|
|
b.region,
|
|
|
- c.name,
|
|
|
- c.linkMan,
|
|
|
- c.contractMobile,
|
|
|
- c.clubId,
|
|
|
- u.image
|
|
|
+ ifnull(c.name,b.region)
|
|
|
+ ,c.linkMan,c.contractMobile,c.clubId,u.image
|
|
|
FROM cm_behavior_record b
|
|
|
LEFT JOIN club c ON b.userID = c.userID
|
|
|
LEFT JOIN user u ON u.userID = c.userID
|
|
|
- WHERE b.userId != 0
|
|
|
- and c.spId = #{spId}
|
|
|
- and b.pageType in (6, 8, 11)
|
|
|
- and DATE(b.accessTime) = DATE(#{accessTime})
|
|
|
- GROUP BY c.clubId
|
|
|
+ LEFT JOIN serviceprovider sp ON b.headUserId = sp.userID
|
|
|
+ WHERE sp.status=90 and sp.serviceProviderID=#{spId}
|
|
|
+ and b.pageType in (69,70,71)
|
|
|
+ and b.accessTime between DATE_SUB(#{accessTime}, INTERVAL 5 Minute) and #{accessTime}
|
|
|
+ GROUP BY b.region
|
|
|
</select>
|
|
|
|
|
|
<select id="getClubAccessDate" resultType="com.caimei365.user.model.vo.RetuenDataVo">
|
|
|
select cbr.accessDate
|
|
|
from cm_behavior_record cbr
|
|
|
- LEFT JOIN club c ON cbr.userID = c.userID
|
|
|
- where c.clubID = #{clubId}
|
|
|
- group by cbr.accessDate
|
|
|
- order by cbr.accessDate desc
|
|
|
+ LEFT JOIN club c ON cbr.userID = c.userID
|
|
|
+ where c.clubID = #{clubId} group by cbr.accessDate order by cbr.accessDate desc
|
|
|
</select>
|
|
|
<select id="getClubKeynoteRecord" resultType="com.caimei365.user.model.vo.BehaviorRecodeVo">
|
|
|
SELECT
|
|
@@ -588,68 +649,60 @@
|
|
|
b.accessClient,
|
|
|
b.isReckon,
|
|
|
b.region,
|
|
|
- p.name AS productName,
|
|
|
+ p.name AS productName,
|
|
|
p.mainImage AS productImage
|
|
|
FROM cm_behavior_record b
|
|
|
LEFT JOIN club c ON b.userID = c.userID
|
|
|
LEFT JOIN product p ON b.productID = p.productID
|
|
|
LEFT JOIN cm_page_type pt ON b.pageType = pt.id
|
|
|
WHERE c.clubID = #{clubId}
|
|
|
- and b.pageType IN (6,11)
|
|
|
- <if test="accessDateList.size()>0">
|
|
|
- and
|
|
|
- <foreach collection="accessDateList" item="accessDate" open="(" separator="or" close=")">
|
|
|
- b.accessTime like concat('%', #{accessDate}, '%')
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
+ and b.pageType IN (6,11)
|
|
|
+ <if test="accessDateList.size()>0">
|
|
|
+ and
|
|
|
+ <foreach collection="accessDateList" item="accessDate" open="(" separator="or" close=")">
|
|
|
+ b.accessTime like concat('%', #{accessDate}, '%')
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
order by b.accessTime desc
|
|
|
</select>
|
|
|
|
|
|
<select id="getUnActiveClub" resultType="com.caimei365.user.model.vo.ClubVo">
|
|
|
- SELECT c.clubID as clubId,
|
|
|
- c.userID as userId,
|
|
|
+ SELECT c.clubID as clubId,
|
|
|
+ c.userID as userId,
|
|
|
c.name,
|
|
|
- c.sname as shortName,
|
|
|
+ c.sname as shortName,
|
|
|
c.contractMobile,
|
|
|
- c.contractEmail as contractEmail,
|
|
|
+ c.contractEmail as contractEmail,
|
|
|
c.contractPhone,
|
|
|
c.linkMan,
|
|
|
- c.provinceID as proviceId,
|
|
|
- c.cityID as cityId,
|
|
|
- c.townID as townId,
|
|
|
+ c.provinceID as proviceId,
|
|
|
+ c.cityID as cityId,
|
|
|
+ c.townID as townId,
|
|
|
c.address,
|
|
|
- c.headpic as shopPhoto,
|
|
|
- c.businessLicenseImage as businessLicense,
|
|
|
+ c.headpic as shopPhoto,
|
|
|
+ c.businessLicenseImage as businessLicense,
|
|
|
c.socialCreditCode,
|
|
|
c.firstClubType,
|
|
|
c.secondClubType,
|
|
|
c.department,
|
|
|
c.medicalPracticeLicenseImg as medicalPracticeLicense,
|
|
|
- c.mainpro as mainProduct,
|
|
|
+ c.mainpro as mainProduct,
|
|
|
c.fax,
|
|
|
- c.info as profile,
|
|
|
- c.spID as serviceProviderId,
|
|
|
- c.addTime,
|
|
|
- c.status,
|
|
|
+ c.info as profile,
|
|
|
+ c.spID as serviceProviderId,
|
|
|
+ c.addTime, c.status,
|
|
|
c.lastCheckOrderDate,
|
|
|
u.userIdentity,
|
|
|
- c.newDeal as newDeal,
|
|
|
- IF(r.id IS NOT NULL, 1, 0) AS recordCount,
|
|
|
- sp.name AS serviceName,
|
|
|
- coas.activeState AS activeState,
|
|
|
- covs.customerValue AS customerValue
|
|
|
- from club c
|
|
|
- left join user u on c.userID = u.userID
|
|
|
- LEFT JOIN record_link r ON r.`clubId` = c.`clubID`
|
|
|
- LEFT JOIN (SELECT userId, activeState, activeStatus
|
|
|
- FROM cm_organ_active_system
|
|
|
- WHERE stage = 0
|
|
|
- AND delType = 1) AS coas ON coas.userId = c.userId
|
|
|
- LEFT JOIN (SELECT userId, customerValue
|
|
|
- FROM cm_organ_value_system
|
|
|
- WHERE stage = 0
|
|
|
- AND delType = 1) AS covs ON covs.userId = c.userId
|
|
|
- LEFT JOIN serviceprovider sp ON c.spID = sp.serviceProviderID
|
|
|
+ c.newDeal as newDeal,IF(r.id IS NOT NULL,1,0) AS recordCount,
|
|
|
+ sp.name AS serviceName,
|
|
|
+ coas.activeState AS activeState,
|
|
|
+ covs.customerValue AS customerValue
|
|
|
+ from club c
|
|
|
+ left join user u on c.userID = u.userID
|
|
|
+ LEFT JOIN record_link r ON r.`clubId`=c.`clubID`
|
|
|
+ LEFT JOIN (SELECT userId, activeState, activeStatus FROM cm_organ_active_system WHERE stage = 0 AND delType = 1) AS coas ON coas.userId = c.userId
|
|
|
+ LEFT JOIN (SELECT userId, customerValue FROM cm_organ_value_system WHERE stage = 0 AND delType = 1) AS covs ON covs.userId = c.userId
|
|
|
+ LEFT JOIN serviceprovider sp ON c.spID = sp.serviceProviderID
|
|
|
WHERE coas.activeStatus = 1
|
|
|
AND sp.serviceProviderID = #{serviceProviderId}
|
|
|
GROUP BY covs.userID
|