|
@@ -67,15 +67,13 @@
|
|
|
|
|
|
<select id="getTourTravelNotesTopicListByName" resultType="com.tourism.webadmin.app.website.model.TourShortTopic" parameterType="String">
|
|
<select id="getTourTravelNotesTopicListByName" resultType="com.tourism.webadmin.app.website.model.TourShortTopic" parameterType="String">
|
|
SELECT
|
|
SELECT
|
|
- tnt.name AS topic_name,
|
|
|
|
- SUM(tntp.page_view_count) AS total_view_count
|
|
|
|
|
|
+ tnt.NAME AS topic_name,
|
|
|
|
+ COALESCE(SUM(tntp.page_view_count), 0) AS total_view_count
|
|
FROM
|
|
FROM
|
|
- tour_travel_notes_topic tnt
|
|
|
|
- JOIN
|
|
|
|
- tour_travel_notes_topic_relation tnttr ON tnt.id = tnttr.topic_id
|
|
|
|
- JOIN
|
|
|
|
- tour_tourism_project_travel_notes tntp ON tnttr.travel_notes_id = tntp.id
|
|
|
|
- where tnt.enable = 1 and tnt.data_state = 1 and tntp.data_state = 1
|
|
|
|
|
|
+ tour_travel_notes_topic tnt
|
|
|
|
+ LEFT JOIN tour_travel_notes_topic_relation tnttr ON tnt.id = tnttr.topic_id
|
|
|
|
+ LEFT JOIN tour_tourism_project_travel_notes tntp ON tnttr.travel_notes_id = tntp.id
|
|
|
|
+ where tnt.enable = 1 and tnt.data_state = 1
|
|
<where>
|
|
<where>
|
|
<if test="name != null and name != ''">
|
|
<if test="name != null and name != ''">
|
|
and tnt.name LIKE CONCAT('%', #{name}, '%')
|
|
and tnt.name LIKE CONCAT('%', #{name}, '%')
|
|
@@ -84,6 +82,6 @@
|
|
GROUP BY
|
|
GROUP BY
|
|
tnt.name
|
|
tnt.name
|
|
ORDER BY
|
|
ORDER BY
|
|
- total_view_count DESC;
|
|
|
|
|
|
+ total_view_count DESC
|
|
</select>
|
|
</select>
|
|
</mapper>
|
|
</mapper>
|