| 
					
				 | 
			
			
				@@ -48,19 +48,19 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		from activity_evaluation_record aer left join sys_user u on aer.user_id_ = u.id_ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         left join student stu on stu.user_id_ = aer.user_id_ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         left join subject s on s.id_ = stu.subject_id_ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		where aer.activity_id_ = #{activityPlanId} and aer.evaluation_id_ = #{activityEvaluationId} and aer.score_ > 0 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		order by aer.score_ desc,aer.times_ asc, aer.id_ asc  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		where aer.activity_id_ = #{activityPlanId} and aer.evaluation_id_ = #{activityEvaluationId} and aer.score_ >= 0 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		order by aer.score_ desc,aer.times_ asc, aer.id_ asc limit 1000000 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		) a group by userId order by score desc,times asc,id_ asc 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		limit #{limit} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     </select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <select id="queryUserRanking" resultType="com.yonge.cooleshow.biz.dal.vo.ActivityRankingVo"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		select aer.score_ socre,aer.user_id_ userId,u.avatar_ userAvatar,u.username_ username, aer.create_time_ joinDate,s.name_ userSubject,aer.times_ times 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		select aer.score_ score,aer.user_id_ userId,u.avatar_ userAvatar,u.username_ username, aer.create_time_ joinDate,s.name_ userSubject,aer.times_ times 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		from activity_evaluation_record aer left join sys_user u on aer.user_id_ = u.id_ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         left join student stu on stu.user_id_ = aer.user_id_ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         left join subject s on s.id_ = stu.subject_id_ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		where aer.id_ in (select * from ( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		select aer.id_ from activity_evaluation_record aer where aer.activity_id_ = #{activityPlanId} and aer.evaluation_id_ = #{activityEvaluationId} and aer.user_id_ = #{userId} and aer.score_ > 0 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		select aer.id_ from activity_evaluation_record aer where aer.activity_id_ = #{activityPlanId} and aer.evaluation_id_ = #{activityEvaluationId} and aer.user_id_ = #{userId} and aer.score_ >= 0 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		order by aer.score_ desc,aer.times_ asc, aer.id_ asc limit 1) a 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		)  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     </select> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -68,6 +68,6 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <select id="queryLastestRecord" resultMap="BaseResultMap"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		select t.* 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		from activity_evaluation_record t  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		where t.activity_id_ = #{activityPlanId} and t.user_id_ = #{userId} and t.score_ > 0 order by id_ desc limit 1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		where t.activity_id_ = #{activityPlanId} and t.user_id_ = #{userId} and t.score_ >= 0 order by id_ desc limit 1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     </select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 </mapper> 
			 |