|  | @@ -272,7 +272,8 @@
 | 
	
		
			
				|  |  |          </if>
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  |      <select id="checkCourseTimes" resultType="integer">
 | 
	
		
			
				|  |  | -        SELECT COUNT(DISTINCT mgpscd.course_type_) >= COUNT(DISTINCT mgpscd.total_course_minutes_) FROM music_group_payment_student_course_detail mgpscd
 | 
	
		
			
				|  |  | +        SELECT SUM(c.a) >= SUM(c.b) FROM (
 | 
	
		
			
				|  |  | +        SELECT COUNT(DISTINCT mgpscd.course_type_) a,COUNT(DISTINCT mgpscd.total_course_minutes_) b FROM music_group_payment_student_course_detail mgpscd
 | 
	
		
			
				|  |  |          LEFT JOIN music_group_payment_calender mgpc ON mgpscd.music_group_payment_calender_id_ = mgpc.id_
 | 
	
		
			
				|  |  |          WHERE mgpc.music_group_id_ = #{musicGroupId} AND mgpscd.used_course_minutes_ = 0
 | 
	
		
			
				|  |  |          AND mgpscd.course_type_ IN
 | 
	
	
		
			
				|  | @@ -282,6 +283,6 @@
 | 
	
		
			
				|  |  |          AND mgpscd.user_id_ IN
 | 
	
		
			
				|  |  |          <foreach collection="studentIds" item="studentId" open="(" close=")" separator=",">
 | 
	
		
			
				|  |  |              #{studentId}
 | 
	
		
			
				|  |  | -        </foreach>
 | 
	
		
			
				|  |  | +        </foreach>)c
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  |  </mapper>
 |