Commit e9c91c11 authored by Mindfaker's avatar Mindfaker

fix

parent 09efb476
......@@ -230,12 +230,13 @@ public interface SpecialSqlMapper {
@Param("classId") Integer classId, @Param("startTime") String startTime, @Param("endTime") String endTime,
@Param("page") Integer page, @Param("limit") Integer limit, @Param("sort") String sort, @Param("order") String order);
/**
* 随机选择一个的学生
* @param classId
* @return
*/
@Select("SELECT * FROM (SELECT * FROM student_info WHERE deleted = FALSE AND class_id = ${classId}) a1 LEFT JOIN ( SELECT (RAND() * max(id) ) as nid FROM student_info WHERE deleted = FALSE AND class_id = ${classId}) a2 ON a1.id > a2.nid LIMIT 1")
@Select("SELECT * FROM student_info WHERE deleted = FALSE AND class_id = ${classId} ORDER BY RAND() LIMIT 1")
Map<String, Object> selectRandomStudentInfo(@Param("classId") Integer classId);
@Select("<script> " +
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment