yonge 3 年之前
父節點
當前提交
3299dc1af4

+ 4 - 4
cooleshow-user/user-biz/src/main/resources/config/mybatis/ActivityEvaluationRecordMapper.xml

@@ -48,7 +48,7 @@
 		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}
+		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 
 		) a group by userId
 		limit #{limit}
@@ -60,14 +60,14 @@
         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 aer.id_ from activity_evaluation_record aer where aer.activity_id_ = #{activityPlanId} and aer.evaluation_id_ = #{activityEvaluationId} and aer.user_id_ = #{userId} 
+		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
 		) 
     </select>
 
     <select id="queryLastestRecord" resultMap="BaseResultMap">
 		select <include refid="baseColumns"/>
-		from activity_evaluation_record aer 
-		where aer.activity_id_ = #{activityPlanId} and aer.user_id_ = #{userId} order by id_ desc limit 1
+		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
     </select>
 </mapper>