|
@@ -116,7 +116,7 @@
|
|
|
<select id="exportBalancedRelationshipMusicSubCourse"
|
|
|
resultType="com.ym.mec.biz.dal.dto.ExportWrapper$ExportBalancedRelationshipMusicSubCourse">
|
|
|
select o.name_ 'organName',mgpscd.music_group_id_ 'musicGroupId',mg.name_ 'musicGroupName',mgpc.batch_no_ 'paymentBatchNo',
|
|
|
- spo.actual_amount_ + spo.coupon_remit_fee_ 'paymentAmount',mgpscd.user_id_ 'studentId',
|
|
|
+ spo.paymentAmount,mgpscd.user_id_ 'studentId',
|
|
|
SUM(CASE WHEN mgpscd.course_type_ = 'CLASSROOM' THEN mgpscd.total_course_minutes_ ELSE 0 END) AS 'classroom'
|
|
|
,SUM(CASE WHEN mgpscd.course_type_ = 'COMPREHENSIVE' THEN mgpscd.total_course_minutes_ ELSE 0 END) AS 'comprehensive'
|
|
|
,SUM(CASE WHEN mgpscd.course_type_ = 'HIGH' THEN mgpscd.total_course_minutes_ ELSE 0 END) AS 'high'
|
|
@@ -129,7 +129,9 @@
|
|
|
left join music_group mg ON mg.id_ = mgpscd.music_group_id_
|
|
|
left join organization o ON o.id_ = mg.organ_id_
|
|
|
left join music_group_payment_calender mgpc ON mgpc.id_ = mgpscd.music_group_payment_calender_id_
|
|
|
- left join student_payment_order spo ON spo.calender_id_ = mgpscd.music_group_payment_calender_id_ AND mgpscd.user_id_ = spo.user_id_ AND spo.status_ = 'SUCCESS'
|
|
|
+ left join (select user_id_,calender_id_,SUM(spo.actual_amount_ + spo.coupon_remit_fee_) paymentAmount from student_payment_order spo
|
|
|
+ where create_time_ >= CONCAT(#{month},'-01 00:00:00') AND status_ = 'SUCCESS' AND group_type_ = 'MUSIC' AND calender_id_ IS NOT NULL
|
|
|
+ group by user_id_,calender_id_) spo ON spo.calender_id_ = mgpscd.music_group_payment_calender_id_ AND mgpscd.user_id_ = spo.user_id_
|
|
|
where mgpc.create_time_ >= CONCAT(#{month},'-01 00:00:00')
|
|
|
<if test="organIds != null and organIds != ''">
|
|
|
AND FIND_IN_SET(mg.organ_id_,#{organIds})
|