zouxuan 5 years ago
parent
commit
a27da2cc2e

+ 3 - 1
mec-biz/src/main/resources/config/mybatis/CourseScheduleRewardsMapper.xml

@@ -154,11 +154,13 @@
 		LEFT JOIN course_schedule cs ON vg.id_ = cs.music_group_id_
 		LEFT JOIN class_group cg ON cg.id_ = cs.class_group_id_
 		LEFT JOIN course_schedule_teacher_salary csts ON csts.course_schedule_id_ = cs.id_
-		WHERE cs.group_type_ = 'VIP' AND csts.settlement_time_ IS NOT NULL AND cs.teach_mode_ = 'OFFLINE'
+		LEFT JOIN vip_group_activity vga ON vga.id_ = vg.vip_group_activity_id_
+		WHERE cs.group_type_ = 'VIP' AND csts.settlement_time_ IS NOT NULL
 		AND cs.class_date_ >= #{firstDayOfMonth} AND cs.class_date_ <= #{lastDayOfMonth}
 		AND FIND_IN_SET(cs.actual_teacher_id_,csrr.teacher_id_)
 		AND FIND_IN_SET(cg.subject_id_list_,csrr.subject_id_)
 		AND csts.user_id_ = cs.actual_teacher_id_
+		AND ((vga.offline_class_join_gradient_rewards_ = 1 AND cs.teach_mode_ = 'OFFLINE') OR (vga.online_class_join_gradient_rewards_ = 1 AND cs.teach_mode_ = 'ONLINE'))
 		GROUP BY cs.actual_teacher_id_,csrr.id_
 	</select>
 	<select id="findByIds" resultMap="CourseScheduleRewardsRules">