refactor: 更改子查询为join

This commit is contained in:
张松
2024-12-30 20:05:04 +08:00
parent dd59c4577e
commit e2ae91bcd6
3 changed files with 131 additions and 6 deletions

View File

@@ -136,7 +136,6 @@
</select>
<select id="queryCourseOrder" resultType="com.sqx.modules.app.response.CourseOrderResponse">
select * from (
select c.course_id as courseId,sum(o.pay_money) as 'coursemoney' ,count(*) as 'coursenum',any_value(c.title) as 'coursename'
from orders o
left join course c on o.course_id=c.course_id
@@ -154,8 +153,7 @@
and date_format(o.create_time,'%Y')=date_format(#{date},'%Y')
</if>
group by c.course_id
) a
order by a.coursenum desc
order by coursenum desc
</select>
<select id="userMessage" resultType="int">
select count(*) from tb_user t
@@ -335,4 +333,4 @@
</update>
</mapper>
</mapper>