| 
					
				 | 
			
			
				@@ -1438,7 +1438,8 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		<result property="organName" column="organ_name_"/> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	</resultMap> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	<select id="queryStudentErrorLeave" resultMap="StudentErrorLeaveDto"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		SELECT * FROM (SELECT cs.organ_id_,o.name_ organ_name_,sa.user_id_,su.username_,su.phone_,COUNT(sa.id_) total_num_, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		SELECT organ_id_,organ_name_,user_id_,username_,phone_,total_num_,MIN(current_num_) current_num_,class_date_ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		FROM (SELECT cs.organ_id_,o.name_ organ_name_,sa.user_id_,su.username_,su.phone_,COUNT(sa.id_) total_num_, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		COUNT(CASE WHEN DATE_FORMAT(cs.class_date_,'%Y-%m') = #{currentMonth} THEN 1 ELSE NULL END) current_num_,cs.class_date_ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		FROM student_attendance sa 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		LEFT JOIN course_schedule cs ON cs.id_ = sa.course_schedule_id_ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1458,7 +1459,7 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			AND (sa.user_id_ = #{search} OR su.username_ LIKE CONCAT('%',#{search},'%') OR su.phone_ LIKE CONCAT('%',#{search},'%')) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		GROUP BY sa.user_id_,DATE_FORMAT(cs.class_date_,'%Y-%m') HAVING COUNT(sa.id_) > 1 AND COUNT(sa.id_) > SUM(sa.leave_visit_flag_))c 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		WHERE DATE_FORMAT(c.class_date_ ,'%Y-%m') = #{currentMonth} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		GROUP BY c.user_id_ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		<include refid="global.limit"/> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	</select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	<select id="countStudentLeaveCourseList" resultType="java.lang.Integer"> 
			 |