首页查询优化

This commit is contained in:
谭凯凯
2024-12-30 18:45:50 +08:00
committed by Tankaikai
parent dd59c4577e
commit 0223eccd04

View File

@@ -38,11 +38,11 @@
c.wx_show as wxShow, c.wx_show as wxShow,
c.dy_show as dyShow, c.dy_show as dyShow,
c.sort, c.sort,
0 as goodNum, round(10000*rand(),0) as goodNum,
(select count(*) from course_details d where d.course_id=c.course_id ) as courseDetailsCount, (select count(*) from course_details d where d.course_id=c.course_id ) as courseDetailsCount,
null AS courseDetailsName, null AS courseDetailsName,
null AS courseDetailsId, null AS courseDetailsId,
0 as weekGoodNum, round(10000*rand(),0) as weekGoodNum,
0 as isRecommend 0 as isRecommend
FROM FROM
course AS c course AS c
@@ -93,10 +93,8 @@
<if test="dyCourse!=null"> <if test="dyCourse!=null">
and c.dy_status=4 and c.dy_status=4
</if> </if>
order by c.sort asc,c.create_time desc
<!--
<if test="sort==null"> <if test="sort==null">
order by c.sort asc order by c.sort asc,c.create_time desc
</if> </if>
<if test="sort!=null and sort==1"> <if test="sort!=null and sort==1">
order by goodNum desc order by goodNum desc
@@ -104,7 +102,6 @@
<if test="sort!=null and sort==2"> <if test="sort!=null and sort==2">
order by weekGoodNum desc order by weekGoodNum desc
</if> </if>
-->
</select> </select>
<select id="selectCourseAdmin" resultType="Map"> <select id="selectCourseAdmin" resultType="Map">