fix: 只推荐有内容的小说

This commit is contained in:
xiongxiaoyang 2024-02-21 19:27:48 +08:00
parent 2d218076c4
commit 34d211afbf

View File

@ -34,35 +34,41 @@
</select> </select>
<update id="addVisitCount" > <update id="addVisitCount">
update book set visit_count = visit_count + ${visitCount} update book
set visit_count = visit_count + ${visitCount}
where id = #{bookId} where id = #{bookId}
</update> </update>
<select id="listRecBookByCatId" parameterType="int" resultType="com.java2nb.novel.entity.Book"> <select id="listRecBookByCatId" parameterType="int" resultType="com.java2nb.novel.entity.Book">
select id,pic_url,book_name,book_desc select id, pic_url, book_name, book_desc
from book from book
where cat_id = #{catId} where cat_id = #{catId}
and word_count > 0
order by RAND() LIMIT 4 order by RAND() LIMIT 4
</select> </select>
<update id="addCommentCount" parameterType="long"> <update id="addCommentCount" parameterType="long">
update book set comment_count = comment_count+1 update book
where id = #{bookId} set comment_count = comment_count + 1
where id = #{bookId}
</update> </update>
<select id="queryNetworkPicBooks" resultType="com.java2nb.novel.entity.Book"> <select id="queryNetworkPicBooks" resultType="com.java2nb.novel.entity.Book">
select select id,
id,pic_url from book pic_url
from book
where pic_url like 'http%' where pic_url like 'http%'
and pic_url not like concat('%',#{localPicPrefix},'%') and pic_url not like concat('%', #{localPicPrefix}, '%')
limit #{limit} limit #{limit}
</select> </select>
<select id="selectIdsByScoreAndRandom" parameterType="int" resultType="com.java2nb.novel.entity.Book"> <select id="selectIdsByScoreAndRandom" parameterType="int" resultType="com.java2nb.novel.entity.Book">
select id,book_name,author_name,pic_url,book_desc,score from book ORDER BY score,RAND() LIMIT #{limit}; select id, book_name, author_name, pic_url, book_desc, score
</select> from book
ORDER BY score, RAND() LIMIT #{limit};
</select>
</mapper> </mapper>