|
@@ -190,6 +190,27 @@
|
|
|
</if>
|
|
|
</update>
|
|
|
|
|
|
+ <update id="updateStudentServiceTag">
|
|
|
+ UPDATE student
|
|
|
+ <set>
|
|
|
+ <if test="serviceTag != null">
|
|
|
+ service_tag_ = #{serviceTag},
|
|
|
+ </if>
|
|
|
+ update_time_ = NOW()
|
|
|
+ </set>
|
|
|
+ WHERE
|
|
|
+ service_tag_=0
|
|
|
+ <if test="studentId!=null">
|
|
|
+ AND user_id_ = #{studentId}
|
|
|
+ </if>
|
|
|
+ <if test="studentIds!=null and studentIds.size()>0">
|
|
|
+ AND user_id_ IN
|
|
|
+ <foreach collection="studentIds" item="studentId" open="(" close=")" separator=",">
|
|
|
+ #{studentId}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </update>
|
|
|
+
|
|
|
<resultMap id="student4operating" type="com.ym.mec.biz.dal.dto.Student4operating">
|
|
|
<result column="organ_name_" property="organName"/>
|
|
|
<result column="organ_id_" property="organId"/>
|
|
@@ -201,6 +222,7 @@
|
|
|
<result column="vip_times_" property="vipTimes"/>
|
|
|
<result column="free_practice_times_" property="freePracticeTimes"/>
|
|
|
<result column="buy_practice_times_" property="buyPracticeTimes"/>
|
|
|
+ <result column="music_netWork_times_" property="musicNetWorkTimes"/>
|
|
|
<result column="student_num_" property="studentNum"/>
|
|
|
</resultMap>
|
|
|
|
|
@@ -214,6 +236,7 @@
|
|
|
s.operating_tag_,
|
|
|
a.vip_times_,
|
|
|
a.buy_practice_times_,
|
|
|
+ a.music_netWork_times_,
|
|
|
p.free_practice_times_
|
|
|
FROM student s
|
|
|
LEFT JOIN sys_user su ON s.user_id_ = su.id_
|
|
@@ -222,7 +245,8 @@
|
|
|
LEFT JOIN (
|
|
|
SELECT cssp.user_id_,
|
|
|
SUM(case when (cs.group_type_ = 'VIP' AND cs.teach_mode_='ONLINE') then 1 ELSE 0 END) vip_times_,
|
|
|
- SUM(case when (pg.type_='CHARGE') then 1 ELSE 0 END) buy_practice_times_
|
|
|
+ SUM(case when (pg.type_='CHARGE') then 1 ELSE 0 END) buy_practice_times_,
|
|
|
+ SUM(case when (pg.type_='MUSIC_NETWORK') then 1 ELSE 0 END) music_netWork_times_
|
|
|
FROM course_schedule_student_payment cssp
|
|
|
LEFT JOIN course_schedule cs ON cs.id_ = cssp.course_schedule_id_
|
|
|
LEFT JOIN practice_group pg ON pg.`id_` = cs.`music_group_id_` AND cs.`group_type_` = 'PRACTICE'
|
|
@@ -247,7 +271,8 @@
|
|
|
LEFT JOIN (
|
|
|
SELECT cssp.user_id_,
|
|
|
SUM(case when (cs.group_type_ = 'VIP' AND cs.teach_mode_='ONLINE') then 1 ELSE 0 END) vip_times_,
|
|
|
- SUM(case when (pg.type_='CHARGE') then 1 ELSE 0 END) buy_practice_times_
|
|
|
+ SUM(case when (pg.type_='CHARGE') then 1 ELSE 0 END) buy_practice_times_,
|
|
|
+ SUM(case when (pg.type_='MUSIC_NETWORK') then 1 ELSE 0 END) music_netWork_times_
|
|
|
FROM course_schedule_student_payment cssp
|
|
|
LEFT JOIN course_schedule cs ON cs.id_ = cssp.course_schedule_id_
|
|
|
LEFT JOIN practice_group pg ON pg.`id_` = cs.`music_group_id_` AND cs.`group_type_` = 'PRACTICE'
|
|
@@ -297,6 +322,12 @@
|
|
|
<if test='hasBuyPractice != null and hasBuyPractice=="0"'>
|
|
|
AND (a.buy_practice_times_ =0 OR a.buy_practice_times_ IS NULL)
|
|
|
</if>
|
|
|
+ <if test='hasMusicNetWork != null and hasMusicNetWork=="1"'>
|
|
|
+ AND a.music_netWork_times_ >=1
|
|
|
+ </if>
|
|
|
+ <if test='hasMusicNetWork != null and hasMusicNetWork=="0"'>
|
|
|
+ AND (a.music_netWork_times_ =0 OR a.music_netWork_times_ IS NULL)
|
|
|
+ </if>
|
|
|
</where>
|
|
|
</sql>
|
|
|
|