|
@@ -151,44 +151,54 @@
|
|
|
AND (u.registerTime < #{endTime} OR u.registerTime = #{endTime})
|
|
|
</if>
|
|
|
<if test="startLoginTime != null and startLoginTime != ''">
|
|
|
- AND (u.loginTime > #{startLoginTime} OR u.loginTime = #{startLoginTime} OR a.clubId= (select aa.clubId
|
|
|
- FROM ((select
|
|
|
- c.clubId
|
|
|
+ AND (u.loginTime >= DATE_SUB(CURRENT_DATE, INTERVAL 6 MONTH) OR a.clubId in (select a.clubId
|
|
|
+ FROM ((
|
|
|
+ select
|
|
|
+ c.clubId,ccr.addTime AS time,c.spID
|
|
|
FROM club c
|
|
|
+ LEFT JOIN user u ON u.userID = c.userID
|
|
|
LEFT JOIN cm_club_remarks ccr ON ccr.clubId = c.clubId
|
|
|
LEFT JOIN serviceprovider sp ON sp.serviceProviderID = c.spID
|
|
|
where c.status=90 and sp.status=90
|
|
|
and ccr.addTime >= DATE_SUB(CURRENT_DATE, INTERVAL 6 MONTH)
|
|
|
+ GROUP BY c.clubId
|
|
|
)UNION(
|
|
|
- select c.clubId
|
|
|
+ select c.clubId,cr.orderTime AS time,c.spID
|
|
|
FROM club c
|
|
|
+ LEFT JOIN user u ON u.userID = c.userID
|
|
|
LEFT JOIN cm_order cr ON cr.clubId = c.clubId
|
|
|
LEFT JOIN serviceprovider sp ON sp.serviceProviderID = c.spID
|
|
|
- where c.status=90 and sp.status=90
|
|
|
+ where c.status=90 and sp.status=90
|
|
|
and cr.orderTime >= DATE_SUB(CURRENT_DATE, INTERVAL 6 MONTH)
|
|
|
- )) aa
|
|
|
- where aa.clubId=a.clubId
|
|
|
- GROUP BY aa.clubId LIMIT 0,1))
|
|
|
+ GROUP BY c.clubId
|
|
|
+ )) a where a.time is not null
|
|
|
+ and a.spID=#{spID}
|
|
|
+ GROUP BY a.clubId ))
|
|
|
</if>
|
|
|
<if test="endLoginTime != null and endLoginTime != ''">
|
|
|
- AND (u.loginTime < #{endLoginTime} OR u.loginTime = #{endLoginTime} OR a.clubId != (select aa.clubId
|
|
|
- FROM ((select
|
|
|
- c.clubId
|
|
|
+ AND (u.loginTime <![CDATA[ < ]]> DATE_SUB(CURRENT_DATE, INTERVAL 6 MONTH) or u.loginTime is null) and a.clubId not in (select a.clubId
|
|
|
+ FROM ((
|
|
|
+ select
|
|
|
+ c.clubId,ccr.addTime AS time,c.spID
|
|
|
FROM club c
|
|
|
+ LEFT JOIN user u ON u.userID = c.userID
|
|
|
LEFT JOIN cm_club_remarks ccr ON ccr.clubId = c.clubId
|
|
|
LEFT JOIN serviceprovider sp ON sp.serviceProviderID = c.spID
|
|
|
- where c.status=90 and sp.status=90
|
|
|
+ where c.status=90 and sp.status=90
|
|
|
and ccr.addTime >= DATE_SUB(CURRENT_DATE, INTERVAL 6 MONTH)
|
|
|
+ GROUP BY c.clubId
|
|
|
)UNION(
|
|
|
- select c.clubId
|
|
|
+ select c.clubId,cr.orderTime AS time,c.spID
|
|
|
FROM club c
|
|
|
+ LEFT JOIN user u ON u.userID = c.userID
|
|
|
LEFT JOIN cm_order cr ON cr.clubId = c.clubId
|
|
|
LEFT JOIN serviceprovider sp ON sp.serviceProviderID = c.spID
|
|
|
where c.status=90 and sp.status=90
|
|
|
and cr.orderTime >= DATE_SUB(CURRENT_DATE, INTERVAL 6 MONTH)
|
|
|
- )) aa
|
|
|
- where aa.clubId=a.clubId
|
|
|
- GROUP BY aa.clubId LIMIT 0,1))
|
|
|
+ GROUP BY c.clubId
|
|
|
+ )) a where a.time is not null
|
|
|
+ and a.spID=#{spID}
|
|
|
+ GROUP BY a.clubId )
|
|
|
</if>
|
|
|
<if test="userIdentity != null and userIdentity != '' and userIdentity != '8'.toString()">
|
|
|
AND u.userIdentity = #{userIdentity}
|