|
@@ -77,8 +77,8 @@
|
|
, t.degree_flag_ as "degreeFlag"
|
|
, t.degree_flag_ as "degreeFlag"
|
|
, t.teacher_flag_ as "teacherFlag"
|
|
, t.teacher_flag_ as "teacherFlag"
|
|
, t.member_rank_setting_id_ as "memberRankSettingId"
|
|
, t.member_rank_setting_id_ as "memberRankSettingId"
|
|
- , t.membership_start_time_ as "membershipStartTime"
|
|
|
|
- , t.membership_end_time_ as "membershipEndTime"
|
|
|
|
|
|
+<!-- , t.membership_start_time_ as "membershipStartTime"-->
|
|
|
|
+<!-- , t.membership_end_time_ as "membershipEndTime"-->
|
|
, t.browse_ as "browse"
|
|
, t.browse_ as "browse"
|
|
, t.memo_ as "memo"
|
|
, t.memo_ as "memo"
|
|
, t.tag_ as "tag"
|
|
, t.tag_ as "tag"
|
|
@@ -104,9 +104,11 @@
|
|
u.avatar_ as avatar,
|
|
u.avatar_ as avatar,
|
|
u.birthdate_ as birthdate,
|
|
u.birthdate_ as birthdate,
|
|
u.gender_ as gender,
|
|
u.gender_ as gender,
|
|
- (case when t.membership_end_time_ >= now() then 1 else 0 end) isVip,
|
|
|
|
|
|
+<!-- (case when t.membership_end_time_ >= now() then 1 else 0 end) isVip,-->
|
|
<!-- t.tag_ tag,-->
|
|
<!-- t.tag_ tag,-->
|
|
u.del_flag_ as delFlag,
|
|
u.del_flag_ as delFlag,
|
|
|
|
+ ifnull(vcr.vip_type_,'NORMAL') as vipType,
|
|
|
|
+ if(vcr.type_ = 'PERMANENT',null,vcr.end_time_) as membershipEndTime,
|
|
(case when isnull(u.id_card_no_) then 0 else 1 end) as isReal,
|
|
(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 isnull(b.user_id_) then 0 else 1 end) as isBank,
|
|
(case when t.tenant_id_ = -1 then '平台' else ti.name_ end) as tenantName
|
|
(case when t.tenant_id_ = -1 then '平台' else ti.name_ end) as tenantName
|
|
@@ -116,6 +118,8 @@
|
|
select distinct user_id_ from user_bank_card where del_flag_ = 0
|
|
select distinct user_id_ from user_bank_card where del_flag_ = 0
|
|
) b on t.user_id_ = b.user_id_
|
|
) b on t.user_id_ = b.user_id_
|
|
left join tenant_info ti on t.tenant_id_ = ti.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 cvr.client_type_ = 'TEACHER'
|
|
|
|
+ and vcr.efficient_flag_ = 1 and vcr.end_time_ >= now() and now() > vcr.start_time_ and (vcr.vip_type_ = 'VIP' or vcr.vip_type_ = 'SVIP')
|
|
<where>
|
|
<where>
|
|
<if test="null != param.search and '' != param.search">
|
|
<if test="null != param.search and '' != param.search">
|
|
AND (
|
|
AND (
|
|
@@ -139,14 +143,22 @@
|
|
</if>
|
|
</if>
|
|
)
|
|
)
|
|
</if>
|
|
</if>
|
|
- <if test="param.isVip != null">
|
|
|
|
- <if test="param.isVip == 0">
|
|
|
|
- and (t.membership_end_time_ is null or t.membership_end_time_ < now())
|
|
|
|
|
|
+ <if test="param.vipType != null">
|
|
|
|
+ <if test="param.vipType == 'NORMAL'">
|
|
|
|
+ and vcr.id_ is null
|
|
</if>
|
|
</if>
|
|
- <if test="param.isVip == 1">
|
|
|
|
- and t.membership_end_time_ >= now()
|
|
|
|
|
|
+ <if test="param.vipType != 'NORMAL'">
|
|
|
|
+ and vcr.vip_type_ = #{param.vipType}
|
|
</if>
|
|
</if>
|
|
</if>
|
|
</if>
|
|
|
|
+<!-- <if test="param.isVip != null">-->
|
|
|
|
+<!-- <if test="param.isVip == 0">-->
|
|
|
|
+<!-- and (t.membership_end_time_ is null or t.membership_end_time_ < now())-->
|
|
|
|
+<!-- </if>-->
|
|
|
|
+<!-- <if test="param.isVip == 1">-->
|
|
|
|
+<!-- and t.membership_end_time_ >= now()-->
|
|
|
|
+<!-- </if>-->
|
|
|
|
+<!-- </if>-->
|
|
<if test="param.tag != null">
|
|
<if test="param.tag != null">
|
|
and find_in_set(#{param.tag},t.tag_)
|
|
and find_in_set(#{param.tag},t.tag_)
|
|
</if>
|
|
</if>
|
|
@@ -166,10 +178,10 @@
|
|
and t.is_test_user_ = #{param.isTestUser}
|
|
and t.is_test_user_ = #{param.isTestUser}
|
|
</if>
|
|
</if>
|
|
<if test="null != param.vipEndTime">
|
|
<if test="null != param.vipEndTime">
|
|
- and t.membership_end_time_ <= #{param.vipEndTime}
|
|
|
|
|
|
+ and vcr.end_time_ <= #{param.vipEndTime}
|
|
</if>
|
|
</if>
|
|
<if test="null != param.vipStartTime">
|
|
<if test="null != param.vipStartTime">
|
|
- and t.membership_end_time_ >= #{param.vipStartTime}
|
|
|
|
|
|
+ and vcr.end_time_ >= #{param.vipStartTime}
|
|
</if>
|
|
</if>
|
|
<if test="param.trainFlag != null">
|
|
<if test="param.trainFlag != null">
|
|
AND t.train_time_ > 0
|
|
AND t.train_time_ > 0
|
|
@@ -239,6 +251,7 @@
|
|
(!isnull(membership_end_time_) and membership_end_time_ > now()) as isVip,
|
|
(!isnull(membership_end_time_) and membership_end_time_ > now()) as isVip,
|
|
u.real_name_ as realName,
|
|
u.real_name_ as realName,
|
|
u.id_card_no_ as idCardNo,
|
|
u.id_card_no_ as idCardNo,
|
|
|
|
+ if(vcr.type_ = 'PERMANENT',null,vcr.end_time_) as membershipEndTime,
|
|
(case when isnull(b.user_id_) then 0 else 1 end) as isBank,
|
|
(case when isnull(b.user_id_) then 0 else 1 end) as isBank,
|
|
(
|
|
(
|
|
SELECT GROUP_CONCAT(name_ ORDER by locate(id_,t.subject_id_)) FROM subject WHERE FIND_IN_SET(id_,t.subject_id_)
|
|
SELECT GROUP_CONCAT(name_ ORDER by locate(id_,t.subject_id_)) FROM subject WHERE FIND_IN_SET(id_,t.subject_id_)
|
|
@@ -249,6 +262,8 @@
|
|
left join (
|
|
left join (
|
|
select distinct user_id_ from user_bank_card where del_flag_ = 0 and user_id_ = #{userId}
|
|
select distinct user_id_ from user_bank_card where del_flag_ = 0 and user_id_ = #{userId}
|
|
) b on t.user_id_ = b.user_id_
|
|
) b on t.user_id_ = b.user_id_
|
|
|
|
+ left join vip_card_record vcr on t.user_id_ = vcr.user_id_ and cvr.client_type_ = 'TEACHER'
|
|
|
|
+ and vcr.efficient_flag_ = 1 and vcr.end_time_ >= now() and now() > vcr.start_time_ and (vcr.vip_type_ = 'VIP' or vcr.vip_type_ = 'SVIP')
|
|
where u.del_flag_ = 0 and t.user_id_ = #{userId}
|
|
where u.del_flag_ = 0 and t.user_id_ = #{userId}
|
|
</select>
|
|
</select>
|
|
|
|
|
|
@@ -322,7 +337,7 @@
|
|
u.phone_ AS phone,
|
|
u.phone_ AS phone,
|
|
u.birthdate_ AS birthdate,
|
|
u.birthdate_ AS birthdate,
|
|
(SELECT group_concat(name_) FROM `subject` WHERE find_in_set(id_,sr.subject_id_)) AS subjectName,
|
|
(SELECT group_concat(name_) FROM `subject` WHERE find_in_set(id_,sr.subject_id_)) AS subjectName,
|
|
- if(sr.membership_start_time_ <= now() and sr.membership_end_time_ >= now(),1,0) AS isVip
|
|
|
|
|
|
+<!-- if(sr.membership_start_time_ <= now() and sr.membership_end_time_ >= now(),1,0) AS isVip-->
|
|
FROM student_star s
|
|
FROM student_star s
|
|
LEFT JOIN sys_user u ON s.student_id_ = u.id_
|
|
LEFT JOIN sys_user u ON s.student_id_ = u.id_
|
|
LEFT JOIN student sr ON s.student_id_ = sr.user_id_
|
|
LEFT JOIN student sr ON s.student_id_ = sr.user_id_
|