|
@@ -127,7 +127,7 @@
|
|
|
|
|
|
|
|
|
|
<select id="getVideoByHome" resultMap="videoMap">
|
|
<select id="getVideoByHome" resultMap="videoMap">
|
|
- select <include refid="baseColumn" />,
|
|
|
|
|
|
+ select DISTINCT <include refid="baseColumn" />,
|
|
(select count(*) from video_like_intermediate where superior_id=v.ID )+v.dummy_like_frequency like_frequency,
|
|
(select count(*) from video_like_intermediate where superior_id=v.ID )+v.dummy_like_frequency like_frequency,
|
|
(select count(*) from video_statistics_intermediate where superior_id=v.ID and Type=7 )+v.dummy_frequency_of_play frequency_of_play,
|
|
(select count(*) from video_statistics_intermediate where superior_id=v.ID and Type=7 )+v.dummy_frequency_of_play frequency_of_play,
|
|
(select count(*) from video_statistics_intermediate where superior_id=v.ID and Type=6 )+v.dummy_share_frequency share_frequency,
|
|
(select count(*) from video_statistics_intermediate where superior_id=v.ID and Type=6 )+v.dummy_share_frequency share_frequency,
|
|
@@ -152,13 +152,16 @@
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="countVideoByHome" resultType="java.lang.Integer">
|
|
<select id="countVideoByHome" resultType="java.lang.Integer">
|
|
- select count(*)
|
|
|
|
|
|
+ SELECT COUNT(1) FROM
|
|
|
|
+ (
|
|
|
|
+ select DISTINCT v.id
|
|
from video v
|
|
from video v
|
|
- left join doctor d on (case when v.doctor_id='' then null else v.doctor_id::uuid = d.id end)
|
|
|
|
- left join video_statistics_intermediate si on v.id=si.superior_id and si.type=7 and si.subordinate_id= #{userId}
|
|
|
|
- left join video_user_attention ua on v.doctor_id=ua.superior_id and ua.subordinate_id= #{userId}
|
|
|
|
- left join video_like_intermediate li on v.id=li.superior_id and li.subordinate_id= #{userId}
|
|
|
|
|
|
+ left join doctor d on (case when v.doctor_id='' then null else v.doctor_id::uuid = d.id end)
|
|
|
|
+ left join video_statistics_intermediate si on v.id=si.superior_id and si.type=7 and si.subordinate_id= #{userId}
|
|
|
|
+ left join video_user_attention ua on v.doctor_id=ua.superior_id and ua.subordinate_id= #{userId}
|
|
|
|
+ left join video_like_intermediate li on v.id=li.superior_id and li.subordinate_id= #{userId}
|
|
where 1=1 ${filterSql}
|
|
where 1=1 ${filterSql}
|
|
|
|
+ ) T
|
|
</select>
|
|
</select>
|
|
|
|
|
|
</mapper>
|
|
</mapper>
|