|
@@ -62,13 +62,17 @@
|
|
|
|
|
|
<!-- 查找下月排课小于基准课酬的老师-->
|
|
|
<select id="findUserByWarringSalary" resultMap="TeacherCourseStatistics"><![CDATA[
|
|
|
- SELECT SUM(csts.expect_salary_) expect_total_salary_, csts.user_id_,t.organ_id_,t.subject_id_ subject_id_list_,
|
|
|
+ SELECT SUM(csts.expect_salary_) expect_total_salary_, t.id_ user_id_,t.organ_id_,t.subject_id_ subject_id_list_,
|
|
|
ROUND(AVG(TIMESTAMPDIFF(MINUTE,start_class_time_,end_class_time_)),0) average_class_minutes_
|
|
|
- FROM course_schedule_teacher_salary csts
|
|
|
+ FROM teacher t
|
|
|
+ LEFT JOIN sys_user su ON t.id_=su.id_
|
|
|
+ LEFT JOIN course_schedule_teacher_salary csts ON csts.user_id_=t.id_
|
|
|
LEFT JOIN course_schedule cs ON cs.id_ = csts.course_schedule_id_
|
|
|
- LEFT JOIN teacher t on t.id_ = csts.user_id_
|
|
|
WHERE cs.class_date_ >= #{startDate} AND cs.class_date_ <= #{endDate} AND csts.group_type_ IN ('VIP','MUSIC', 'PRACTICE')
|
|
|
- AND cs.del_flag_ != 1 AND t.organ_id_ IS NOT NULL
|
|
|
+ AND cs.del_flag_ != 1
|
|
|
+ AND su.del_flag_ != 1
|
|
|
+ AND t.demission_date_ IS NULL
|
|
|
+ AND t.organ_id_ IS NOT NULL
|
|
|
GROUP BY csts.user_id_
|
|
|
]]>
|
|
|
</select>
|
|
@@ -109,6 +113,9 @@
|
|
|
</if>
|
|
|
<if test="userId != null">
|
|
|
AND tcs.user_id_ = #{userId}
|
|
|
+ </if>minSalary
|
|
|
+ <if test="minSalary != null">
|
|
|
+ AND tcs.expect_total_salary_ >= #{minSalary}
|
|
|
</if>
|
|
|
<if test="maxSalary != null">
|
|
|
AND tcs.expect_total_salary_ <= #{maxSalary}
|