select a.id,
a.name,
a.sort
from info_type a
where a.enabledStatus = 1
order by a.sort desc
select IFNULL(clickRate, 1)
from info_label
where hotLabelStatus = 1
order by clickRate desc
limit 1
select id,name,clickRate as sort,link,jumpStatus as typeId
from info_label
where hotLabelStatus = 1
order by recommendLabelStatus desc, hotLabelStatus desc, createDate desc
limit 30
select a.id,
a.title,
a.guidanceImage as image
from info a
where a.recommendStatus = 1
and a.enabledStatus = 1
and NOW() >= a.pubdate
and a.typeId = #{typeId}
order by a.pubdate desc
select
a.id as id,
a.title as title,
a.guidanceImage as image,
a.publisher as publisher,
a.pubdate as publish_date,
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
a.label like CONCAT(CONCAT('%', #{label}), '%')
and a.id != #{id}
and NOW() >= a.pubdate
and a.enabledStatus = 1
order by a.pubdate desc
select a.id, a.serviceObject as title, a.guidanceImage as image, a.link
from info_ad a
where a.location = 2
and a.enabledStatus = 1
order by a.createDate desc
limit 3
update info_ad
set clickRate = IFNULL(clickRate, 0) + 1,
updateDate = NOW()
where id = #{id}
update info_label
set clickRate = IFNULL(clickRate, 0) + 1,
updateDate = NOW()
where id = #{id}
UPDATE info_praise
SET num = num+1
WHERE infoId = #{infoId}
UPDATE info_praise
SET pv = pv+1
WHERE infoId = #{infoId}
SELECT
a.id AS id,
a.title AS title,
a.guidanceImage AS image,
a.publisher AS publisher,
a.pubdate AS publish_date,
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,
a.keyword AS keyword,
a.recommendContent AS recommendContent,
a.source AS source,
IFNULL((c.num + a.basePraise), 0) AS likes
FROM
info AS a
LEFT JOIN info_praise c ON a.id = c.infoId
WHERE
a.id = #{id}
AND a.enabledStatus = 1
select id
from info_label
where infoLabelStatus = 1
and name in
#{label}
group by name
order by clickRate desc