首页查询优化
This commit is contained in:
@@ -4,8 +4,9 @@
|
||||
|
||||
<!--查找指定短剧的目录 按照顺序数字升序-->
|
||||
<select id="findByCourseId" resultType="com.sqx.modules.course.entity.CourseDetails">
|
||||
select c.*,
|
||||
cc.isGood
|
||||
select
|
||||
c.*,
|
||||
ifnull(cc.isGood,0) as isGood
|
||||
from course_details c
|
||||
left join (select course_details_id,count(*) isGood from course_collect where user_id=#{userId} and classify=2 group by course_details_id) cc on c.course_details_id = c.course_details_id
|
||||
where c.course_id=#{id} order by c.sort asc
|
||||
@@ -37,7 +38,7 @@
|
||||
c.advertising,
|
||||
c.view_count as viewCount,
|
||||
c.play_complete_count as playCompleteCount,
|
||||
cc.isGood
|
||||
ifnull(cc.isGood,0) as isGood
|
||||
from course_details c
|
||||
left join (select course_details_id,count(*) as isGood from course_collect where user_id=#{userId} and classify=2 group by course_details_id) cc on cc.course_details_id = c.course_details_id
|
||||
where c.course_id=#{id} order by c.sort asc
|
||||
|
||||
Reference in New Issue
Block a user