insert into vod_video_post
(`video_id`,`title`,`description`,`category_pid`,`category_id`,`cover_url`,`scope`,`status`,`horizontal`,`duration`,`publish_at`,`publish_by`)
values
(#{videoId},#{title},#{description},#{categoryPid},#{categoryId},#{coverUrl},#{scope},#{status},#{horizontal},#{duration},#{publishAt},#{publishBy})
update vod_video_post
set update_time=now(),scope=#{scope}
where video_id=#{videoId}
update vod_video_post
set update_time=now(),title=#{title},`description`=#{description}
where video_id=#{videoId}
update vod_video_post
set update_time=now(),cover_url=#{coverUrl}
where video_id=#{videoId}
update vod_video_post
set update_time=now(),duration=#{videoInfo.duration},quality=#{videoInfo.quality}
where video_id=#{videoId}
update vod_video_post
set update_time=now(),`status`=#{status}
where video_id=#{videoId}
update vod_video_post
set update_time=now(),`title`=#{title},`description`=#{description},`category_pid`=#{categoryPid},`category_id`=#{categoryId},`cover_url`=#{coverUrl},`scope`=#{scope},`status`=#{status},`publish_at`=#{publishAt}
where video_id=#{videoId}
update vod_video_post
set update_time=now(),duration=#{videoInfo.duration},`status`=2
where video_id=#{videoId}
update vod_video_post
set publish_by=#{newUserId}
where video_id in
#{id}
delete from vod_video_post
where video_id=#{videoId}
select count(*)
from vod_video_post
deleted=0
and `status` in
#{id}
and scope in
#{id}
and category_pid=#{categoryPid}
and category_id=#{categoryId}
and publish_by=#{userId}
and horizontal=#{horizontal}
and video_id=#{videoId}
select *
from vod_video_post post
deleted=0
and post.status in
#{id}
and post.scope in
#{id}
and post.category_pid=#{videoQuery.categoryPid}
and post.category_id=#{videoQuery.categoryId}
and post.publish_by=#{videoQuery.userId}
and post.horizontal=#{videoQuery.horizontal}
order by post.publish_at desc
select post.id,post.video_id,post.title,post.cover_url,post.duration,post.horizontal,post.publish_at,post.publish_by,post.status,
statistic.view,statistic.comment
from vod_video_post post
inner join vod_video_statistic statistic
on statistic.video_id=post.video_id
and post.deleted=0
and post.status in
#{id}
and post.scope in
#{id}
and post.category_pid=#{videoQuery.categoryPid}
and post.category_id=#{videoQuery.categoryId}
and post.publish_by=#{videoQuery.userId}
and post.horizontal=#{videoQuery.horizontal}
and post.duration < #{videoQuery.duration}
order by post.publish_at desc
select count(*)
from vod_video_post
deleted=0
and `status` in
#{id}
and scope in
#{id}
and category_pid=#{categoryPid}
and category_id=#{categoryId}
and publish_by=#{userId}
and horizontal=#{horizontal}
and video_id=#{videoId}
and match(title) against(#{title})
select *
from vod_video_post
deleted=0
and `status` in
#{id}
and scope in
#{id}
and category_pid=#{videoQuery.categoryPid}
and category_id=#{videoQuery.categoryId}
and publish_by=#{videoQuery.userId}
and horizontal=#{videoQuery.horizontal}
and match(title) against(#{videoQuery.title})
order by #{videoQuery.orderBy} #{videoQuery.orderDirection}
select post.id,post.video_id,post.title,post.cover_url,post.duration,post.horizontal,post.publish_at as publish_at,post.publish_by,post.status,
statistic.view,statistic.comment
from vod_video_post post
inner join vod_video_statistic statistic
on post.deleted=0 and statistic.video_id=post.video_id and post.status in (2,5,6,7) and post.video_id in
#{id}
select post.id,post.video_id,post.title,post.cover_url,post.duration,post.horizontal,post.publish_at as publish_at,post.publish_by,post.status,
statistic.view,statistic.comment
from vod_video_post post
inner join vod_video_statistic statistic
on statistic.video_id=post.video_id and post.status in (2,5,6,7) and post.publish_by in
#{id}
where post.deleted=0 and post.id < #{nextId}
order by post.publish_at desc
limit #{pageSize}
select post.publish_by,post.video_id,post.title,post.description,post.cover_url,post.duration,post.publish_at,post.scope,post.status,
statistic.view,statistic.danmaku,statistic.comment,statistic.thumb_up,
statistic.favorite,statistic.share
from vod_video_post post
inner join vod_video_statistic statistic
on statistic.video_id=post.video_id
post.deleted=0
and post.status in
#{id}
and post.scope in
#{id}
and post.video_id=#{videoId}
select tag_name
from video_tags
inner join video_tag
on video_tag.tag_id=video_tags.tag_id and video_tags.video_id=#{videoId}
select post.id,post.video_id,post.title,post.cover_url,post.duration,post.horizontal,post.publish_at,post.publish_by,post.status,
statistic.view,statistic.comment
from vod_video_post post
inner join vod_video_statistic statistic
on statistic.video_id=post.video_id
post.deleted=0
and post.status in
#{id}
and post.scope in
#{id}
and post.publish_by=#{videoQuery.userId}
and post.publish_at > #{publishAt}
order by post.publish_at asc
limit 4
select count(*)
from vod_video_post
deleted=0
and `status` in
#{id}
and scope in
#{id}
and match(title) against(#{title})
select *
from vod_video_post
deleted=0
and status in
#{id}
and scope in
#{id}
and match(title) against(#{searchCriteria.title})
select *
from vod_video_post
where deleted=0 and video_id=#{videoId}
select *
from vod_video_post
where deleted=0 and `status`=2 and category_pid=11
select *
from vod_video_post
where deleted=0 and `status` in (2,5) and id > #{nextId}
order by id asc
limit #{pageSize}
select post.video_id,post.cover_url,post.title
from vod_video_post post
where deleted=0
order by publish_at desc
limit 10
select publish_by as id,count(*) total
from vod_video_post
where deleted=0 and category_pid=11
group by publish_by
order by total desc
select user_id as id,count(*) as total
from image_post
where user_id not in
(
select publish_by
from vod_video_post
where category_pid=11
group by publish_by
)
group by user_id
order by total desc
select publish_by as id,count(*) total
from vod_video_post
where category_pid=11
group by publish_by
order by total desc
SELECT t1.video_id
FROM vod_video_post AS t1
JOIN (SELECT ROUND(RAND()*(SELECT MAX(id) FROM vod_video_post)) AS id) AS t2
WHERE t1.id>=t2.id and t1.scope in
#{id}
ORDER BY t1.id
LIMIT #{size}
SELECT video_id
FROM vod_video_post AS t1
WHERE t1.duration<=120 and t1.`status`=2 and t1.`horizontal`=0 and t1.scope in
#{id}
limit 100000
select *
from vod_video_post
where `deleted`=0 and `status`=2 and category_pid=#{categoryPid}
group by publish_by,category_id
select *
from vod_video_post
where `deleted`=0 and `status`=2 and publish_by=#{publishBy} and category_id=#{categoryId}
order by publish_at desc
limit 1
select *
from vod_video_post
where `deleted`=0 and `status`=2 and category_pid=11 and title like concat(#{title},'%')