|
@@ -418,13 +418,14 @@
|
|
|
LEFT JOIN vip_group_category vgc ON aum.category_id_ = vgc.id_
|
|
|
<if test="userId != null">
|
|
|
left join student_teacher_mapper stm ON stm.student_id_ = aum.user_id_
|
|
|
+ left join student st ON st.user_id_ = aum.user_id_
|
|
|
</if>
|
|
|
<if test="organIds != null and organIds != ''">
|
|
|
LEFT JOIN sys_user su ON su.id_ = aum.user_id_
|
|
|
</if>
|
|
|
<where>
|
|
|
<if test="userId != null">
|
|
|
- AND stm.teacher_id_ = #{userId} AND aum.type_ = stm.teacher_type_
|
|
|
+ AND ((stm.teacher_id_ = #{userId} AND aum.type_ = stm.teacher_type_) OR st.course_teacher_ = #{userId})
|
|
|
</if>
|
|
|
<if test="organIds != null and organIds != ''">
|
|
|
AND FIND_IN_SET(su.organ_id_,#{organIds})
|
|
@@ -484,7 +485,7 @@
|
|
|
AND FIND_IN_SET(sj.id_,#{queryInfo.subjectIds})
|
|
|
</if>
|
|
|
<if test="queryInfo.teacherId != null">
|
|
|
- AND stm.teacher_id_ = #{queryInfo.teacherId} AND aum.type_ = stm.teacher_type_
|
|
|
+ AND ((stm.teacher_id_ = #{queryInfo.teacherId} AND aum.type_ = stm.teacher_type_) OR s.course_teacher_ = #{queryInfo.teacherId})
|
|
|
</if>
|
|
|
<if test="queryInfo.studentIds != null and queryInfo.studentIds.size > 0">
|
|
|
AND aum.user_id_ IN
|
|
@@ -501,6 +502,7 @@
|
|
|
left join sys_user su on su.id_ = aum.user_id_
|
|
|
<if test="queryInfo.teacherId != null">
|
|
|
left join student_teacher_mapper stm ON stm.student_id_ = aum.user_id_
|
|
|
+ LEFT JOIN student s ON s.user_id_ = aum.user_id_
|
|
|
</if>
|
|
|
where aum.return_fee_ = 0 and aum.total_course_num_ > 0
|
|
|
<if test="queryInfo.categoryId != null">
|
|
@@ -510,7 +512,8 @@
|
|
|
AND aum.category_id_ IS NULL
|
|
|
</if>
|
|
|
<if test="queryInfo.teacherId != null">
|
|
|
- AND stm.teacher_id_ = #{queryInfo.teacherId} AND stm.teacher_type_ = case when category_id_ IS NULL THEN 'PRACTICE' ELSE 'VIP' END
|
|
|
+ AND ((stm.teacher_id_ = #{queryInfo.teacherId} AND stm.teacher_type_ = case when category_id_ IS NULL THEN 'PRACTICE' ELSE 'VIP' END)
|
|
|
+ OR s.course_teacher_ = #{queryInfo.teacherId})
|
|
|
</if>
|
|
|
<if test="queryInfo.organIds != null and queryInfo.organIds != ''">
|
|
|
AND FIND_IN_SET(su.organ_id_,#{queryInfo.organIds})
|
|
@@ -520,6 +523,7 @@
|
|
|
left join sys_user su on su.id_ = aum.user_id_
|
|
|
<if test="queryInfo.teacherId != null">
|
|
|
left join student_teacher_mapper stm ON stm.student_id_ = aum.user_id_
|
|
|
+ LEFT JOIN student s ON s.user_id_ = aum.user_id_
|
|
|
</if>
|
|
|
where aum.return_fee_ = 0 and aum.sub_give_course_num_ > 0
|
|
|
<if test="queryInfo.categoryId != null">
|
|
@@ -529,7 +533,8 @@
|
|
|
AND aum.give_category_id_ IS NULL
|
|
|
</if>
|
|
|
<if test="queryInfo.teacherId != null">
|
|
|
- AND stm.teacher_id_ = #{queryInfo.teacherId} AND stm.teacher_type_ = case when give_category_id_ IS NULL THEN 'PRACTICE' ELSE 'VIP' END
|
|
|
+ AND ((stm.teacher_id_ = #{queryInfo.teacherId} AND stm.teacher_type_ = case when category_id_ IS NULL THEN 'PRACTICE' ELSE 'VIP' END)
|
|
|
+ OR s.course_teacher_ = #{queryInfo.teacherId})
|
|
|
</if>
|
|
|
<if test="queryInfo.organIds != null and queryInfo.organIds != ''">
|
|
|
AND FIND_IN_SET(su.organ_id_,#{queryInfo.organIds})
|