Browse Source

feat:服务指标明细

Joburgess 4 years ago
parent
commit
f38c0da4ef

+ 7 - 8
mec-biz/src/main/resources/config/mybatis/IndexBaseMonthDataMapper.xml

@@ -740,16 +740,15 @@
     <select id="getAttendanceError" resultType="int">
 		SELECT COUNT(DISTINCT c.id_) FROM (SELECT cs.id_ FROM course_schedule cs
 		LEFT JOIN teacher_attendance ta ON ta.course_schedule_id_ = cs.id_
-		LEFT JOIN student_attendance sa ON sa.course_schedule_id_ = cs.id_
+		LEFT JOIN course_schedule_student_payment cssp ON cssp.course_schedule_id_ = cs.id_
+		LEFT JOIN student_attendance sa ON sa.course_schedule_id_ = cssp.course_schedule_id_ AND cssp.user_id_ = sa.user_id_
 		WHERE ta.teacher_id_ = cs.actual_teacher_id_
-		AND cs.status_ = 'OVER' AND cs.del_flag_ = 0 AND cs.class_date_>='2021-02-01'
-		AND (ta.sign_in_status_ != 1 OR ta.sign_out_status_ != 1 OR sa.status_ != 'NORMAL') AND ta.dispose_content_ IS NULL
+		AND cs.status_ = 'OVER' AND cs.del_flag_ = 0 AND cs.class_date_ >= '2021-02-01'
+		AND (((ta.sign_in_status_ = 0 OR ta.sign_out_status_ = 0) AND ta.dispose_content_ IS NULL) OR (sa.id_ IS NULL OR (sa.status_ != 'NORMAL' AND sa.visit_flag_ = 0)))
+		AND (ta.dispose_content_ IS NOT NULL OR (ta.sign_in_status_ IS NOT NULL AND ta.sign_out_status_ IS NOT NULL))
 		AND (cs.new_course_id_ IS NULL OR cs.new_course_id_=cs.id_)
-		<if test="organIds!=null and organIds.size() > 0">
-			AND cs.organ_id_ IN
-			<foreach collection="organIds" item="organId" open="(" close=")" separator=",">
-				#{organId}
-			</foreach>
+		<if test="organIds != null and organIds != ''">
+			AND FIND_IN_SET(cs.organ_id_,#{organIds})
 		</if>
 		GROUP BY cs.id_) c
 	</select>