|
@@ -65,7 +65,6 @@
|
|
|
and a.auditStatus = 2
|
|
|
</where>
|
|
|
order by a.pubdate desc
|
|
|
- limit 3
|
|
|
</select>
|
|
|
<select id="getLastestInfoADs" resultType="com.caimei.www.pojo.page.ImageLink">
|
|
|
select a.id, a.serviceObject as title, a.guidanceImage as image, a.link
|
|
@@ -141,5 +140,35 @@
|
|
|
<select id="getLabelById" resultType="java.lang.String">
|
|
|
SELECT label FROM info WHERE id=#{id}
|
|
|
</select>
|
|
|
+ <select id="getArticleRelatedLimit" resultType="com.caimei.www.pojo.page.Article">
|
|
|
+ select
|
|
|
+ a.id as id,
|
|
|
+ a.title as title,
|
|
|
+ a.guidanceImage as image,
|
|
|
+ a.publisher as publisher,
|
|
|
+ a.pubdate as publishDate,
|
|
|
+ a.recommendContent as intro,
|
|
|
+ a.infoContent as content,
|
|
|
+ (IFNULL(c.pv, 0) + IFNULL(a.basePv, 0) + IFNULL((c.num + a.basePraise), 0)) as pv,
|
|
|
+ a.label as label,
|
|
|
+ a.typeId as typeId
|
|
|
+ from info as a
|
|
|
+ left join info_praise c on a.id = c.infoId
|
|
|
+ <where>
|
|
|
+ <if test="labels != null and labels != ''">
|
|
|
+ <foreach collection="labels" item="label" open="(" close=")" index="index" separator="OR">
|
|
|
+ a.label like CONCAT(CONCAT('%', #{label}), '%')
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="id != null and id != ''">
|
|
|
+ and a.id != #{id}
|
|
|
+ </if>
|
|
|
+ and NOW() >= a.pubdate
|
|
|
+ and a.enabledStatus = 1
|
|
|
+ and a.auditStatus = 2
|
|
|
+ </where>
|
|
|
+ order by a.pubdate desc
|
|
|
+ limit 3
|
|
|
+ </select>
|
|
|
|
|
|
</mapper>
|