commit
e20d575436
11 changed files with 134 additions and 23 deletions
@ -0,0 +1,32 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
<mapper namespace="com.teaching.backend.mapper.records.CourseLearningRecordMapper"> |
||||
<select id="selectNewRecord" resultType="com.teaching.backend.model.entity.records.CourseLearningRecord"> |
||||
SELECT |
||||
* |
||||
FROM |
||||
course_learning_record clr |
||||
WHERE |
||||
clr.user_id = #{student} |
||||
ORDER BY |
||||
times |
||||
DESC LIMIT 1; |
||||
</select> |
||||
<select id="selectMaxNumber" resultType="java.lang.String"> |
||||
SELECT |
||||
cln.course_id courseId |
||||
FROM |
||||
course_learning_number cln |
||||
ORDER BY |
||||
number |
||||
DESC LIMIT 4; |
||||
</select> |
||||
<select id="selectMaxCourseId" resultType="java.lang.String" parameterType="java.lang.String"> |
||||
SELECT course_id, COUNT(*) as frequency |
||||
FROM course_learning_record |
||||
WHERE user_id = #{userId} |
||||
GROUP BY course_id |
||||
ORDER BY frequency DESC |
||||
LIMIT 4; |
||||
</select> |
||||
</mapper> |
Loading…
Reference in new issue