|
@@ -5,6 +5,7 @@ import com.gis.common.base.mapper.IBaseMapper;
|
|
|
import com.gis.cms.entity.po.QuestionUserEntity;
|
|
|
import org.apache.ibatis.annotations.Mapper;
|
|
|
import org.apache.ibatis.annotations.Select;
|
|
|
+import org.apache.ibatis.annotations.Update;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.util.List;
|
|
@@ -14,8 +15,12 @@ import java.util.List;
|
|
|
public interface QuestionUserMapper extends IBaseMapper<QuestionUserEntity, Long> {
|
|
|
|
|
|
// @Select("select distinct a.user_id, a.score, a.id, b.real_name as realName from tb_question_user a left join sys_user b on b.id=a.user_id where a.is_delete=0 AND a.question_group_id=#{questionGroupId} order by a.score desc limit 10")
|
|
|
- @Select("SELECT DISTINCT a.user_id, max(a.score) as score ,a.id, b.real_name as realName " +
|
|
|
+ @Select("SELECT DISTINCT a.user_id, max(a.score) as score ,a.id, b.real_name as realName, a.time, a.question_group_id " +
|
|
|
"FROM tb_question_user a left join sys_user b on b.id=a.user_id WHERE question_group_id=#{questionGroupId} " +
|
|
|
- "GROUP BY user_id ORDER BY a.score desc limit 10")
|
|
|
+ "GROUP BY user_id ORDER BY a.score desc, a.time limit 10")
|
|
|
List<QuestionUserEntity> ranking(Long questionGroupId);
|
|
|
+
|
|
|
+
|
|
|
+ @Update("update tb_question_group set visit = visit + 1 , update_time = NOW() where is_delete = 0 and id= #{questionGroupId}")
|
|
|
+ void addVisit(Long questionGroupId);
|
|
|
}
|