|
@@ -111,6 +111,7 @@
|
|
|
max(if(vcr.vip_type_ = 'VIP', vcr.end_time_, null)) vipEndTime,
|
|
|
max(if(vcr.vip_type_ = 'SVIP' and vcr.type_ = 'PERPETUAL', vcr.end_time_ , null)) perSvipEndTime,
|
|
|
max(if(vcr.vip_type_ = 'SVIP', vcr.end_time_, null)) svipEndTime,
|
|
|
+ max(vcr.end_time_) currentVipEndTime,
|
|
|
(case when isnull(u.id_card_no_) then 0 else 1 end) as isReal,
|
|
|
(case when isnull(b.user_id_) then 0 else 1 end) as isBank,
|
|
|
(case when t.tenant_id_ = -1 then '平台' else ti.name_ end) as tenantName
|
|
@@ -120,7 +121,7 @@
|
|
|
select distinct user_id_ from user_bank_card where del_flag_ = 0
|
|
|
) b on t.user_id_ = b.user_id_
|
|
|
left join tenant_info ti on t.tenant_id_ = ti.id_
|
|
|
- left join vip_card_record vcr on t.user_id_ = vcr.user_id_ and vcr.efficient_flag_ = 1 and (vcr.vip_type_ = 'VIP' or vcr.vip_type_ = 'SVIP') and vcr.client_type_='STUDENT'
|
|
|
+ left join vip_card_record vcr on t.user_id_ = vcr.user_id_ and vcr.efficient_flag_ = 1 and vcr.client_type_='STUDENT'
|
|
|
left join vip_card_record vcr2 on t.user_id_ = vcr2.user_id_ and vcr2.efficient_flag_ = 1 and vcr2.end_time_ > now() and now() >= vcr2.start_time_ and vcr2.client_type_='STUDENT'
|
|
|
<where>
|
|
|
<if test="null != param.search and '' != param.search">
|
|
@@ -209,7 +210,8 @@
|
|
|
</where>
|
|
|
group by t.user_id_
|
|
|
<if test="param.vipStartTime != null and param.vipEndTime != null">
|
|
|
- having ((vipEndTime >= #{param.vipStartTime} and #{param.vipEndTime}> vipEndTime) or (svipEndTime >= #{param.vipStartTime} and #{param.vipEndTime}> svipEndTime))
|
|
|
+<!-- having ((vipEndTime >= #{param.vipStartTime} and #{param.vipEndTime}> vipEndTime) or (svipEndTime >= #{param.vipStartTime} and #{param.vipEndTime}> svipEndTime))-->
|
|
|
+ having currentVipEndTime >= #{param.vipStartTime} and #{param.vipEndTime}> currentVipEndTime
|
|
|
</if>
|
|
|
<choose>
|
|
|
<when test="param.orderBy != null and param.orderBy.trim() != ''">
|