id, title, properties, image_path, tag, description, category_id, category_ids, comment, subscribe,
clicks, weight, status, create_by, create_time, update_by, update_time,show_time
select
a.id aid,
a.title,
a.properties,
a.image_path imagePath,
a.tag,
a.description,
a.category_id categoryId,
a.category_ids categoryIds,
a.comment,
a.subscribe,
a.clicks,
a.weight,
a.status,
a.create_by createBy,
a.create_time createTime,
a.update_by updateBy,
a.update_time updateTime,
a.show_time showTime,
CASE WHEN a.category_id = '-1' THEN '顶级栏目' ELSE c.cnname END AS categoryCnName,
CASE WHEN a.category_id = '-1' THEN 'Top Column' ELSE c.enname END AS categoryEnName
, f.*
from system_archives a
left join system_category c on a.category_id = c.id
LEFT JOIN `${tableName}` f ON a.id = f.aid
where 1 = 1
and a.category_ids like concat(#{cascade,jdbcType=VARCHAR},'%')
and c.code = #{cid,jdbcType=VARCHAR}
and a.properties like concat(concat('%',#{flag,jdbcType=VARCHAR}),'%')
and a.status = #{status,jdbcType=INTEGER}
order by
a.${sortBy} ${sortWay},
a.update_time desc
select
from system_archives
where tag like concat('%',concat(#{tag,jdbcType=VARCHAR},'%'))
select
a.id
, a.title
, a.properties
, a.image_path imagePath
, a.tag
, a.description
, a.category_id categoryId
, a.category_ids categoryIds
, a.comment
, a.subscribe
, a.clicks
, a.weight
, a.status
, a.create_by createBy
, a.create_time createTime
, a.update_by updateBy
, a.update_time updateTime
, CASE WHEN a.category_id = '-1' THEN '顶级栏目' ELSE c.cnname END AS categoryCnName
, CASE WHEN a.category_id = '-1' THEN 'Top Column' ELSE c.enname END AS categoryEnName
from system_archives a
LEFT JOIN system_category c ON a.category_id = c.id
where 1 = 1
and a.title like concat('%',concat(#{keywords,jdbcType=VARCHAR},'%'))
and a.status = #{status,jdbcType=INTEGER}
and c.code in
#{item}
and a.tag like concat('%',concat(#{tag,jdbcType=VARCHAR},'%'))
SELECT a.id aid,
a.title title,
a.properties properties,
a.image_path imagePath,
a.tag tag,
a.description description,
a.category_id categoryId,
a.category_ids categoryIds,
a.comment `comment`,
a.subscribe subscribe,
a.clicks clicks,
a.weight weight,
a.status `status`,
a.create_by createBy,
a.create_time createTime,
a.update_by updateBy,
a.update_time updateTime,
f.*,
c.cnname categoryCnName,
c.enname categoryEnName,
u.username as createUserName,
u.realname as createRealName
FROM `system_archives` a
LEFT JOIN system_category c ON a.category_id = c.id
LEFT JOIN system_user u ON a.create_by = u.id
LEFT JOIN `${tableName}` f ON a.id = f.aid
WHERE a.id = #{id,jdbcType=VARCHAR}
INSERT INTO `${tableName}` (
`${key}`
) VALUES(
#{value}
)
UPDATE `${tableName}` SET
`${key}` = #{value}
WHERE id = #{id,jdbcType=VARCHAR}
DELETE
FROM `${tableName}`
WHERE id = #{id,jdbcType=VARCHAR}
update system_archives
set tag = #{tag,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
SELECT * FROM (
SELECT @rownum:=@rownum+1 AS rownum,t.* FROM (SELECT @rownum:=0) r,system_archives t
WHERE 1 = 1
and t.category_id = #{categoryId,jdbcType=VARCHAR}
) t1
where 1 = 1
and t1.id = #{arcid,jdbcType=VARCHAR}
and t1.rownum = #{privNum,jdbcType=VARCHAR}
and t1.rownum = #{nextNum,jdbcType=VARCHAR}
and t1.status = #{status,jdbcType=INTEGER}
SELECT t1.id,
t1.title,
t1.properties,
t1.image_path imagePath,
t1.tag,
t1.description,
t1.category_id categoryId,
t1.category_ids categoryIds,
t1.comment,
t1.subscribe,
t1.clicks,
t1.weight,
t1.status,
t1.create_by createBy,
t1.create_time createTime,
t1.update_by updateBy,
t1.update_time updateTime,
CASE WHEN t1.category_id = '-1' THEN '顶级栏目' ELSE c.cnname END AS categoryCnName,
CASE WHEN t1.category_id = '-1' THEN 'Top Column' ELSE c.enname END AS categoryEnName
FROM system_archives t1
LEFT JOIN system_category c ON t1.category_id = c.id
INNER JOIN (SELECT keywords
FROM system_search
GROUP BY keywords
order by count(keywords) desc
limit 0,5) t2 ON INSTR(t1.title, t2.keywords) > 0
GROUP BY t1.id
SELECT *
FROM system_archives
ORDER BY create_time DESC
LIMIT 0,10
SELECT
FROM system_archives
WHERE category_id = #{categoryId,jdbcType=VARCHAR}
SELECT
FROM system_archives
WHERE category_id = '83d306aaf1654e81aaef795fc2f9e5b4' and status=1 order by show_time desc