|
@@ -1336,27 +1336,50 @@
|
|
|
<select id="exportBalancedRelationshipMusicNoCourse"
|
|
|
resultType="com.ym.mec.biz.dal.dto.ExportWrapper$ExportBalancedRelationshipMusicNoCourse">
|
|
|
select o.name_ organName,mg.name_ musicGroupName,cgtm.user_id_,cgsm.class_group_id_ classId,
|
|
|
- mgpscd.music_group_id_ musicGroupId,cg.name_ className,cg.type_ classType,cgtm.user_id_ teacherId,
|
|
|
- mgpscd.course_type_ courseType,SUM(mgpscd.sub_course_current_price_) totalCoursePrice,
|
|
|
+ mgpscd.music_group_id_ musicGroupId,cg.name_ className,cgtm.user_id_ teacherId,
|
|
|
+ CASE WHEN cg.type_ = 'NORMAL' THEN '声部班'
|
|
|
+ WHEN cg.type_ = 'MIX' THEN '合奏班'
|
|
|
+ WHEN cg.type_ = 'HIGH' THEN '基础技能班'
|
|
|
+ WHEN cg.type_ = 'VIP' THEN 'vip课'
|
|
|
+ WHEN cg.type_ = 'DEMO' THEN '试听课'
|
|
|
+ WHEN cg.type_ = 'PRACTICE' THEN '网管课'
|
|
|
+ WHEN cg.type_ = 'SNAP' THEN '临时班'
|
|
|
+ WHEN cg.type_ = 'COMM' THEN '对外课程'
|
|
|
+ WHEN cg.type_ = 'HIGH_ONLINE' THEN '线上基础技能班'
|
|
|
+ WHEN cg.type_ = 'MUSIC_NETWORK' THEN '乐团网管课'
|
|
|
+ WHEN cg.type_ = 'LIVE' THEN '直播课' END classType,
|
|
|
+ CASE WHEN mgpscd.course_type_ = 'SINGLE' THEN '声部课'
|
|
|
+ WHEN mgpscd.course_type_ = 'MIX' THEN '合奏课'
|
|
|
+ WHEN mgpscd.course_type_ = 'HIGH' THEN '基础技能课'
|
|
|
+ WHEN mgpscd.course_type_ = 'VIP' THEN 'vip课'
|
|
|
+ WHEN mgpscd.course_type_ = 'DEMO' THEN '试听课'
|
|
|
+ WHEN mgpscd.course_type_ = 'COMPREHENSIVE' THEN '综合课'
|
|
|
+ WHEN mgpscd.course_type_ = 'PRACTICE' THEN '网管课'
|
|
|
+ WHEN mgpscd.course_type_ = 'ENLIGHTENMENT' THEN '启蒙课'
|
|
|
+ WHEN mgpscd.course_type_ = 'TRAINING_SINGLE' THEN '集训声部课'
|
|
|
+ WHEN mgpscd.course_type_ = 'TRAINING_MIX' THEN '集训合奏课'
|
|
|
+ WHEN mgpscd.course_type_ = 'CLASSROOM' THEN '课堂课'
|
|
|
+ WHEN mgpscd.course_type_ = 'COMM' THEN '对外课程'
|
|
|
+ WHEN mgpscd.course_type_ = 'HIGH_ONLINE' THEN '线上基础技能课'
|
|
|
+ WHEN mgpscd.course_type_ = 'MUSIC_NETWORK' THEN '乐团网管课'
|
|
|
+ WHEN mgpscd.course_type_ = 'LIVE' THEN '直播课' END courseType,
|
|
|
+ SUM(mgpscd.sub_course_current_price_) totalCoursePrice,
|
|
|
SUM(mgpscd.sub_course_minutes_) subCourseMinutes,COUNT(DISTINCT cgsm.user_id_) studentNum
|
|
|
from music_group_payment_student_course_detail mgpscd
|
|
|
left join class_group_student_mapper cgsm ON cgsm.music_group_id_ = mgpscd.music_group_id_ and cgsm.user_id_ = mgpscd.user_id_ AND cgsm.status_ = 'NORMAL'
|
|
|
left join class_group cg ON cg.id_ = cgsm.class_group_id_
|
|
|
- left join music_group mg ON mg.id_ = cg.music_group_id
|
|
|
- left join organization o ON o.id_ = mg.organ_id__
|
|
|
+ left join music_group mg ON mg.id_ = cg.music_group_id_
|
|
|
+ left join organization o ON o.id_ = mg.organ_id_
|
|
|
left join class_group_teacher_mapper cgtm ON cgtm.class_group_id_ = cg.id_ AND cgtm.teacher_role_ = 'BISHOP'
|
|
|
where mgpscd.sub_course_current_price_ > 0 AND mgpscd.sub_course_minutes_ > 0
|
|
|
AND (cg.type_ = mgpscd.course_type_ OR
|
|
|
(cg.type_ = 'NORMAL' AND mgpscd.course_type_ IN ('SINGLE','TRAINING_SINGLE')) OR
|
|
|
(cg.type_ = 'MIX' AND mgpscd.course_type_ IN ('MIX','TRAINING_MIX')) OR cg.type_ = 'SNAP')
|
|
|
<if test="month != null and month != ''">
|
|
|
- AND mgpscd.create_time_ $lt; #{month}
|
|
|
+ AND mgpscd.create_time_ < #{month}
|
|
|
</if>
|
|
|
- <if test="organIds != null and organIds.size > 0">
|
|
|
- AND mg.organ_id_ IN
|
|
|
- <foreach collection="organIds" item="organId" open="(" close=")" separator=",">
|
|
|
- #{organId}
|
|
|
- </foreach>
|
|
|
+ <if test="organIds != null and organIds != ''">
|
|
|
+ AND FIND_IN_SET(mg.organ_id_,#{organIds})
|
|
|
</if>
|
|
|
group by mg.organ_id_,cgsm.class_group_id_,mgpscd.course_type_
|
|
|
order by mg.organ_id_,cgsm.class_group_id_,mgpscd.course_type_
|
|
@@ -1371,15 +1394,15 @@
|
|
|
(cgsm.type_ = 'NORMAL' AND mgpscd.course_type_ IN ('SINGLE','TRAINING_SINGLE')) OR
|
|
|
(cgsm.type_ = 'MIX' AND mgpscd.course_type_ IN ('MIX','TRAINING_MIX')) OR cgsm.type_ = 'SNAP')
|
|
|
where mgpscd.sub_course_current_price_ > 0 AND mgpscd.sub_course_minutes_ > 0
|
|
|
- AND mgpscd.create_time_ $lt;= #{month} AND cgsm.class_group_id_ IS NULL;
|
|
|
+ AND mgpscd.create_time_ <= #{month} AND cgsm.class_group_id_ IS NULL;
|
|
|
</select>
|
|
|
<select id="exportBalancedRelationshipMusicCourseSum"
|
|
|
resultType="com.ym.mec.biz.dal.dto.ExportWrapper$ExportBalancedRelationshipMusicCourseSum">
|
|
|
select
|
|
|
- first_month_pre_amount_ firstMonthPreAmount, first_month_sub_course_num_ firstMonthSubCourseNum,
|
|
|
- first_month_course_salary_ firstMonthCourseSalary, current_month_consume_course_num_ currentMonthConsume, current_month_course_salary_ currentMonthConsumeReward,
|
|
|
- current_month_course_amount_ currentMonthCourseAmount, last_month_pre_amount_ lastMonthPreAmount,
|
|
|
- last_month_sub_course_num_ lastMonthSubCourseNum, last_month_course_salary_ lastMonthCourseSalary
|
|
|
+ SUM(first_month_pre_amount_) firstMonthPreAmount, SUM(first_month_sub_course_num_) firstMonthSubCourseNum,
|
|
|
+ SUM(first_month_course_salary_) firstMonthCourseSalary, SUM(current_month_consume_course_num_) currentMonthConsume, SUM(current_month_course_salary_) currentMonthConsumeReward,
|
|
|
+ SUM(current_month_course_amount_) currentMonthCourseAmount, SUM(last_month_pre_amount_) lastMonthPreAmount,
|
|
|
+ SUM(last_month_sub_course_num_) lastMonthSubCourseNum, SUM(last_month_course_salary_) lastMonthCourseSalary
|
|
|
from month_music_class_report_statis mm
|
|
|
where mm.month_ = #{month}
|
|
|
</select>
|