Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
O
online-edu-backend
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
online-edu
online-edu-backend
Commits
f8c06074
Commit
f8c06074
authored
Jun 17, 2021
by
liuyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
101b2ce6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
6 deletions
+13
-6
CourseConsumeRecordController.java
...ata/biz/web/controller/CourseConsumeRecordController.java
+2
-0
course_consume_recordMapper.xml
...ources/mappers/management/course_consume_recordMapper.xml
+11
-6
No files found.
src/main/java/com/qkdata/biz/web/controller/CourseConsumeRecordController.java
View file @
f8c06074
...
...
@@ -41,6 +41,7 @@ public class CourseConsumeRecordController {
CourseConsumeRecordPO
cacheModel
=
(
CourseConsumeRecordPO
)
redisTemplate
.
opsForHash
().
get
(
BizConstants
.
CACHE_KE_CONSUME_RECORD
,
model
.
getUuid
());
cacheModel
.
setWatchTime
(
model
.
getLearnDuration
());
cacheModel
.
setVideoTime
(
model
.
getVideoDuration
());
cacheModel
.
setUpdateTime
(
LocalDateTime
.
now
());
redisTemplate
.
opsForHash
().
put
(
BizConstants
.
CACHE_KE_CONSUME_RECORD
,
cacheModel
.
getId
(),
cacheModel
);
}
else
{
CourseConsumeRecordPO
po
=
new
CourseConsumeRecordPO
();
...
...
@@ -51,6 +52,7 @@ public class CourseConsumeRecordController {
po
.
setWatchTime
(
model
.
getLearnDuration
());
po
.
setVideoTime
(
model
.
getVideoDuration
());
po
.
setCreateTime
(
model
.
getStartTime
());
po
.
setUpdateTime
(
model
.
getStartTime
());
redisTemplate
.
opsForHash
().
put
(
BizConstants
.
CACHE_KE_CONSUME_RECORD
,
po
.
getId
(),
po
);
}
...
...
src/main/resources/mappers/management/course_consume_recordMapper.xml
View file @
f8c06074
...
...
@@ -21,7 +21,7 @@
WHERE r.is_del = 0
and r.user_id = #{userId}
and r.course_id = #{courseId}
ORDER BY
c
.update_time DESC
ORDER BY
r
.update_time DESC
LIMIT 1
</select>
<select
id=
"queryUserRecordPage"
resultType=
"com.qkdata.biz.web.vo.CourseConsumeRecordModel"
>
...
...
@@ -38,15 +38,20 @@
res.video_id
FROM (
SELECT *
from
(
SELECT *
from course_consume_record
GROUP BY user_id,course_id
HAVING MAX(update_time)
WHERE user_id = #{userId}
and is_del = 0
ORDER BY update_time desc,course_id ASC LIMIT 100000
) t
GROUP BY course_id
HAVING max(update_time)
) r
INNER JOIN course c on r.course_id = c.id
INNER JOIN course_chapter chapter on chapter.id = r.chapter_id
INNER JOIN resource res ON res.id = chapter.resource_id
WHERE r.is_del = 0
and r.user_id = #{p.userId}
ORDER BY r.update_time DESC
ORDER BY r.update_time DESC;
</select>
</mapper>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment