insert into vod_video_post
(`video_id`,`video_file_id`,`channel_id`,`title`,`description`,`category_pid`,`category_id`,`cover_url`,`scope`,`status`,`horizontal`,`duration`,`quality`,`codec`,`publish_at`,`publish_by`)
values
(#{videoId},#{videoFileId},#{channelId},#{title},#{description},#{categoryPid},#{categoryId},#{coverUrl},#{scope},#{status},#{horizontal},#{duration},#{quality},#{codec},#{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(),video_file_id=#{videoInfo.videoFileId},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(),`status`=#{status}
where video_id=#{videoId}
update vod_video_post
set update_time=now(),video_file_id=#{videoInfo.videoFileId},duration=#{videoInfo.duration},quality=#{videoInfo.quality},channel_id=#{channelId},`status`=2
where video_id=#{videoId}
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 duration <= #{duration}
and horizontal=#{horizontal}
group by publish_by
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.duration <= #{videoQuery.duration}
and post.horizontal=#{videoQuery.horizontal}
group by post.publish_by
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.video_file_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 video_file_id=#{videoFileId}
select *
from vod_video_post
where category_id=6
select *
from vod_video_post
where deleted=0 and category_id=4 and id > #{nextId}
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 category_id as id,count(*) total
from vod_video_post
where deleted=0
group by category_id
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 t1.*
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.duration<=120 and t1.`status`=2 and t1.scope in
#{id}
ORDER BY t1.id
LIMIT 1