|
@@ -318,6 +318,7 @@
|
|
|
GROUP BY aum.user_id_)c
|
|
|
</select>
|
|
|
<select id="getActivityStudentCanCourseNum" resultMap="ActivityWaitCourseStudentNumDto">
|
|
|
+ SELECT * FROM (
|
|
|
SELECT COUNT(CASE WHEN aum.vip_flag_ = 1 THEN 1 ELSE NULL END) vip_num_,
|
|
|
COUNT(CASE WHEN aum.practice_flag_ = 1 THEN 1 ELSE NULL END) practice_num_,
|
|
|
COUNT(CASE WHEN aum.give_vip_flag_ = 1 THEN 1 ELSE NULL END) give_vip_num_,
|
|
@@ -332,7 +333,41 @@
|
|
|
<if test="search != null and search != ''">
|
|
|
AND (aum.user_id_ = #{search} OR su.username_ LIKE CONCAT('%',#{search},'%') OR su.phone_ LIKE CONCAT('%',#{search},'%'))
|
|
|
</if>
|
|
|
- GROUP BY aum.user_id_
|
|
|
+ GROUP BY aum.user_id_) c
|
|
|
+ <where>
|
|
|
+ <if test="giveFlag != null and giveFlag == 1">
|
|
|
+ AND c.give_vip_num_ > 0 OR c.give_practice_num_ > 0
|
|
|
+ </if>
|
|
|
+ <if test="giveFlag != null and giveFlag == 0">
|
|
|
+ AND c.vip_num_ > 0 OR c.practice_num_ > 0
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ <include refid="global.limit"/>
|
|
|
+ </select>
|
|
|
+ <select id="countActivityStudentCanCourseNum" resultType="int">
|
|
|
+ SELECT COUNT(c.user_id_) FROM (
|
|
|
+ SELECT COUNT(CASE WHEN aum.vip_flag_ = 1 THEN 1 ELSE NULL END) vip_num_,
|
|
|
+ COUNT(CASE WHEN aum.practice_flag_ = 1 THEN 1 ELSE NULL END) practice_num_,
|
|
|
+ COUNT(CASE WHEN aum.give_vip_flag_ = 1 THEN 1 ELSE NULL END) give_vip_num_,
|
|
|
+ COUNT(CASE WHEN aum.give_practice_flag_ = 1 THEN 1 ELSE NULL END) give_practice_num_,aum.user_id_
|
|
|
+ FROM activity_user_mapper aum
|
|
|
+ LEFT JOIN sys_user su ON su.id_ = aum.user_id_
|
|
|
+ WHERE aum.return_fee_ = 0 AND aum.activity_id_ = #{activityId}
|
|
|
+ <if test="userId != null">
|
|
|
+ AND aum.teacher_id_ = #{userId}
|
|
|
+ </if>
|
|
|
+ <if test="search != null and search != ''">
|
|
|
+ AND (aum.user_id_ = #{search} OR su.username_ LIKE CONCAT('%',#{search},'%') OR su.phone_ LIKE CONCAT('%',#{search},'%'))
|
|
|
+ </if>
|
|
|
+ GROUP BY aum.user_id_) c
|
|
|
+ <where>
|
|
|
+ <if test="giveFlag != null and giveFlag == 1">
|
|
|
+ AND c.give_vip_num_ > 0 OR c.give_practice_num_ > 0
|
|
|
+ </if>
|
|
|
+ <if test="giveFlag != null and giveFlag == 0">
|
|
|
+ AND c.vip_num_ > 0 OR c.practice_num_ > 0
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
</select>
|
|
|
<resultMap id="DoubleEleven2021ActivityDto" type="com.ym.mec.biz.dal.dto.DoubleEleven2021ActivityDto">
|
|
|
<result property="buyNum" column="buy_num_"/>
|