|
@@ -3,56 +3,56 @@
|
|
|
|
|
|
|
|
<mapper namespace="cn.reghao.tnb.content.app.vod.db.mapper.VideoPostMapper">
|
|
<mapper namespace="cn.reghao.tnb.content.app.vod.db.mapper.VideoPostMapper">
|
|
|
<insert id="save" useGeneratedKeys="true" keyProperty="id">
|
|
<insert id="save" useGeneratedKeys="true" keyProperty="id">
|
|
|
- insert into video_post
|
|
|
|
|
|
|
+ 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`)
|
|
(`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
|
|
values
|
|
|
(#{videoId},#{videoFileId},#{channelId},#{title},#{description},#{categoryPid},#{categoryId},#{coverUrl},#{scope},#{status},#{horizontal},#{duration},#{quality},#{codec},#{publishAt},#{publishBy})
|
|
(#{videoId},#{videoFileId},#{channelId},#{title},#{description},#{categoryPid},#{categoryId},#{coverUrl},#{scope},#{status},#{horizontal},#{duration},#{quality},#{codec},#{publishAt},#{publishBy})
|
|
|
</insert>
|
|
</insert>
|
|
|
|
|
|
|
|
<update id="updateVideoScope">
|
|
<update id="updateVideoScope">
|
|
|
- update video_post
|
|
|
|
|
|
|
+ update vod_video_post
|
|
|
set update_time=now(),scope=#{scope}
|
|
set update_time=now(),scope=#{scope}
|
|
|
where video_id=#{videoId}
|
|
where video_id=#{videoId}
|
|
|
</update>
|
|
</update>
|
|
|
<update id="updateVideoInfo">
|
|
<update id="updateVideoInfo">
|
|
|
- update video_post
|
|
|
|
|
|
|
+ update vod_video_post
|
|
|
set update_time=now(),title=#{title},`description`=#{description}
|
|
set update_time=now(),title=#{title},`description`=#{description}
|
|
|
where video_id=#{videoId}
|
|
where video_id=#{videoId}
|
|
|
</update>
|
|
</update>
|
|
|
<update id="updateVideoCover">
|
|
<update id="updateVideoCover">
|
|
|
- update video_post
|
|
|
|
|
|
|
+ update vod_video_post
|
|
|
set update_time=now(),cover_url=#{coverUrl}
|
|
set update_time=now(),cover_url=#{coverUrl}
|
|
|
where video_id=#{videoId}
|
|
where video_id=#{videoId}
|
|
|
</update>
|
|
</update>
|
|
|
<update id="updateVideoFile">
|
|
<update id="updateVideoFile">
|
|
|
- update video_post
|
|
|
|
|
|
|
+ update vod_video_post
|
|
|
set update_time=now(),video_file_id=#{videoInfo.videoFileId},duration=#{videoInfo.duration},quality=#{videoInfo.quality}
|
|
set update_time=now(),video_file_id=#{videoInfo.videoFileId},duration=#{videoInfo.duration},quality=#{videoInfo.quality}
|
|
|
where video_id=#{videoId}
|
|
where video_id=#{videoId}
|
|
|
</update>
|
|
</update>
|
|
|
<update id="updateVideoStatus">
|
|
<update id="updateVideoStatus">
|
|
|
- update video_post
|
|
|
|
|
|
|
+ update vod_video_post
|
|
|
set update_time=now(),`status`=#{status}
|
|
set update_time=now(),`status`=#{status}
|
|
|
where video_id=#{videoId}
|
|
where video_id=#{videoId}
|
|
|
</update>
|
|
</update>
|
|
|
<update id="updateVideoPublish">
|
|
<update id="updateVideoPublish">
|
|
|
- update video_post
|
|
|
|
|
|
|
+ update vod_video_post
|
|
|
set update_time=now(),`status`=#{status}
|
|
set update_time=now(),`status`=#{status}
|
|
|
where video_id=#{videoId}
|
|
where video_id=#{videoId}
|
|
|
</update>
|
|
</update>
|
|
|
<update id="updateVideoCached">
|
|
<update id="updateVideoCached">
|
|
|
- update video_post
|
|
|
|
|
|
|
+ update vod_video_post
|
|
|
set update_time=now(),video_file_id=#{videoInfo.videoFileId},duration=#{videoInfo.duration},quality=#{videoInfo.quality},channel_id=#{channelId},`status`=2
|
|
set update_time=now(),video_file_id=#{videoInfo.videoFileId},duration=#{videoInfo.duration},quality=#{videoInfo.quality},channel_id=#{channelId},`status`=2
|
|
|
where video_id=#{videoId}
|
|
where video_id=#{videoId}
|
|
|
</update>
|
|
</update>
|
|
|
|
|
|
|
|
<delete id="deleteByVideoId">
|
|
<delete id="deleteByVideoId">
|
|
|
- delete from video_post
|
|
|
|
|
|
|
+ delete from vod_video_post
|
|
|
where video_id=#{videoId}
|
|
where video_id=#{videoId}
|
|
|
</delete>
|
|
</delete>
|
|
|
|
|
|
|
|
<select id="countByCriteria" resultType="java.lang.Integer">
|
|
<select id="countByCriteria" resultType="java.lang.Integer">
|
|
|
select count(*)
|
|
select count(*)
|
|
|
- from video_post
|
|
|
|
|
|
|
+ from vod_video_post
|
|
|
<where>
|
|
<where>
|
|
|
deleted=0
|
|
deleted=0
|
|
|
<if test="status != null">
|
|
<if test="status != null">
|
|
@@ -86,7 +86,7 @@
|
|
|
</select>
|
|
</select>
|
|
|
<select id="findVideoPostByPage" resultType="cn.reghao.tnb.content.app.vod.model.po.VideoPost">
|
|
<select id="findVideoPostByPage" resultType="cn.reghao.tnb.content.app.vod.model.po.VideoPost">
|
|
|
select *
|
|
select *
|
|
|
- from video_post post
|
|
|
|
|
|
|
+ from vod_video_post post
|
|
|
<where>
|
|
<where>
|
|
|
deleted=0
|
|
deleted=0
|
|
|
<if test="videoQuery.status != null">
|
|
<if test="videoQuery.status != null">
|
|
@@ -119,7 +119,7 @@
|
|
|
<select id="findVideoCardByPage" resultMap="videoPostCard">
|
|
<select id="findVideoCardByPage" resultMap="videoPostCard">
|
|
|
select post.id,post.video_id,post.title,post.cover_url,post.duration,post.horizontal,post.publish_at,post.publish_by,post.status,
|
|
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
|
|
statistic.view,statistic.comment
|
|
|
- from video_post post
|
|
|
|
|
|
|
+ from vod_video_post post
|
|
|
inner join video_statistic statistic
|
|
inner join video_statistic statistic
|
|
|
on statistic.video_id=post.video_id
|
|
on statistic.video_id=post.video_id
|
|
|
<where>
|
|
<where>
|
|
@@ -157,7 +157,7 @@
|
|
|
|
|
|
|
|
<select id="countByCriteriaAndUserGroup" resultType="java.lang.Integer">
|
|
<select id="countByCriteriaAndUserGroup" resultType="java.lang.Integer">
|
|
|
select count(*)
|
|
select count(*)
|
|
|
- from video_post
|
|
|
|
|
|
|
+ from vod_video_post
|
|
|
<where>
|
|
<where>
|
|
|
deleted=0
|
|
deleted=0
|
|
|
<if test="status != null">
|
|
<if test="status != null">
|
|
@@ -190,7 +190,7 @@
|
|
|
<select id="findCriteriaAndUserGroupByPage" resultMap="videoPostCard">
|
|
<select id="findCriteriaAndUserGroupByPage" resultMap="videoPostCard">
|
|
|
select post.id,post.video_id,post.title,post.cover_url,post.duration,post.horizontal,post.publish_at,post.publish_by,post.status,
|
|
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
|
|
statistic.view,statistic.comment
|
|
|
- from video_post post
|
|
|
|
|
|
|
+ from vod_video_post post
|
|
|
inner join video_statistic statistic
|
|
inner join video_statistic statistic
|
|
|
on statistic.video_id=post.video_id
|
|
on statistic.video_id=post.video_id
|
|
|
<where>
|
|
<where>
|
|
@@ -238,7 +238,7 @@
|
|
|
<select id="findVideoCardByVideoIds" resultMap="videoPostCard">
|
|
<select id="findVideoCardByVideoIds" resultMap="videoPostCard">
|
|
|
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,
|
|
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
|
|
statistic.view,statistic.comment
|
|
|
- from video_post post
|
|
|
|
|
|
|
+ from vod_video_post post
|
|
|
inner join video_statistic statistic
|
|
inner join 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
|
|
on post.deleted=0 and statistic.video_id=post.video_id and post.status in (2,5,6,7) and post.video_id in
|
|
|
<foreach collection="list" item="id" index="index" open="(" close=")" separator=",">
|
|
<foreach collection="list" item="id" index="index" open="(" close=")" separator=",">
|
|
@@ -248,7 +248,7 @@
|
|
|
<select id="findByUserIds" resultMap="videoPostCard">
|
|
<select id="findByUserIds" resultMap="videoPostCard">
|
|
|
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,
|
|
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
|
|
statistic.view,statistic.comment
|
|
|
- from video_post post
|
|
|
|
|
|
|
+ from vod_video_post post
|
|
|
inner join video_statistic statistic
|
|
inner join video_statistic statistic
|
|
|
on statistic.video_id=post.video_id and post.status in (2,5,6,7) and post.publish_by in
|
|
on statistic.video_id=post.video_id and post.status in (2,5,6,7) and post.publish_by in
|
|
|
<foreach collection="userIds" item="id" index="index" open="(" close=")" separator=",">
|
|
<foreach collection="userIds" item="id" index="index" open="(" close=")" separator=",">
|
|
@@ -282,7 +282,7 @@
|
|
|
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,
|
|
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.view,statistic.danmaku,statistic.comment,statistic.thumb_up,
|
|
|
statistic.favorite,statistic.share
|
|
statistic.favorite,statistic.share
|
|
|
- from video_post post
|
|
|
|
|
|
|
+ from vod_video_post post
|
|
|
inner join video_statistic statistic
|
|
inner join video_statistic statistic
|
|
|
on statistic.video_id=post.video_id
|
|
on statistic.video_id=post.video_id
|
|
|
<where>
|
|
<where>
|
|
@@ -313,7 +313,7 @@
|
|
|
<select id="findByNextVideos" resultMap="videoPostCard">
|
|
<select id="findByNextVideos" resultMap="videoPostCard">
|
|
|
select post.id,post.video_id,post.title,post.cover_url,post.duration,post.horizontal,post.publish_at,post.publish_by,post.status,
|
|
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
|
|
statistic.view,statistic.comment
|
|
|
- from video_post post
|
|
|
|
|
|
|
+ from vod_video_post post
|
|
|
inner join video_statistic statistic
|
|
inner join video_statistic statistic
|
|
|
on statistic.video_id=post.video_id
|
|
on statistic.video_id=post.video_id
|
|
|
<where>
|
|
<where>
|
|
@@ -341,7 +341,7 @@
|
|
|
|
|
|
|
|
<select id="countBySearchCriteria" resultType="java.lang.Integer">
|
|
<select id="countBySearchCriteria" resultType="java.lang.Integer">
|
|
|
select count(*)
|
|
select count(*)
|
|
|
- from video_post
|
|
|
|
|
|
|
+ from vod_video_post
|
|
|
<where>
|
|
<where>
|
|
|
deleted=0
|
|
deleted=0
|
|
|
<if test="status != null">
|
|
<if test="status != null">
|
|
@@ -363,7 +363,7 @@
|
|
|
</select>
|
|
</select>
|
|
|
<select id="findSearchCriteriaByPage" resultType="cn.reghao.tnb.content.app.vod.model.po.VideoPost">
|
|
<select id="findSearchCriteriaByPage" resultType="cn.reghao.tnb.content.app.vod.model.po.VideoPost">
|
|
|
select *
|
|
select *
|
|
|
- from video_post
|
|
|
|
|
|
|
+ from vod_video_post
|
|
|
<where>
|
|
<where>
|
|
|
deleted=0
|
|
deleted=0
|
|
|
<if test="searchCriteria.status != null">
|
|
<if test="searchCriteria.status != null">
|
|
@@ -386,51 +386,51 @@
|
|
|
|
|
|
|
|
<select id="findByVideoId" resultType="cn.reghao.tnb.content.app.vod.model.po.VideoPost">
|
|
<select id="findByVideoId" resultType="cn.reghao.tnb.content.app.vod.model.po.VideoPost">
|
|
|
select *
|
|
select *
|
|
|
- from video_post
|
|
|
|
|
|
|
+ from vod_video_post
|
|
|
where deleted=0 and video_id=#{videoId}
|
|
where deleted=0 and video_id=#{videoId}
|
|
|
</select>
|
|
</select>
|
|
|
<select id="findByVideoFileId" resultType="cn.reghao.tnb.content.app.vod.model.po.VideoPost">
|
|
<select id="findByVideoFileId" resultType="cn.reghao.tnb.content.app.vod.model.po.VideoPost">
|
|
|
select *
|
|
select *
|
|
|
- from video_post
|
|
|
|
|
|
|
+ from vod_video_post
|
|
|
where deleted=0 and video_file_id=#{videoFileId}
|
|
where deleted=0 and video_file_id=#{videoFileId}
|
|
|
</select>
|
|
</select>
|
|
|
<select id="findAll" resultType="cn.reghao.tnb.content.app.vod.model.po.VideoPost">
|
|
<select id="findAll" resultType="cn.reghao.tnb.content.app.vod.model.po.VideoPost">
|
|
|
select *
|
|
select *
|
|
|
- from video_post
|
|
|
|
|
|
|
+ from vod_video_post
|
|
|
where category_id=6
|
|
where category_id=6
|
|
|
</select>
|
|
</select>
|
|
|
<select id="findAllById" resultType="cn.reghao.tnb.content.app.vod.model.po.VideoPost">
|
|
<select id="findAllById" resultType="cn.reghao.tnb.content.app.vod.model.po.VideoPost">
|
|
|
select *
|
|
select *
|
|
|
- from video_post
|
|
|
|
|
|
|
+ from vod_video_post
|
|
|
where deleted=0 and category_id=4 and id > #{nextId}
|
|
where deleted=0 and category_id=4 and id > #{nextId}
|
|
|
limit #{pageSize}
|
|
limit #{pageSize}
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<select id="findBannerVideos" resultType="cn.reghao.tnb.content.api.dto.BannerVideo">
|
|
<select id="findBannerVideos" resultType="cn.reghao.tnb.content.api.dto.BannerVideo">
|
|
|
select post.video_id,post.cover_url,post.title
|
|
select post.video_id,post.cover_url,post.title
|
|
|
- from video_post post
|
|
|
|
|
|
|
+ from vod_video_post post
|
|
|
where deleted=0
|
|
where deleted=0
|
|
|
order by publish_at desc
|
|
order by publish_at desc
|
|
|
limit 10
|
|
limit 10
|
|
|
</select>
|
|
</select>
|
|
|
<select id="findGroupByPublishBy" resultType="cn.reghao.tnb.common.db.GroupCount">
|
|
<select id="findGroupByPublishBy" resultType="cn.reghao.tnb.common.db.GroupCount">
|
|
|
select publish_by as id,count(*) total
|
|
select publish_by as id,count(*) total
|
|
|
- from video_post
|
|
|
|
|
|
|
+ from vod_video_post
|
|
|
where deleted=0 and category_pid=11
|
|
where deleted=0 and category_pid=11
|
|
|
group by publish_by
|
|
group by publish_by
|
|
|
order by total desc
|
|
order by total desc
|
|
|
</select>
|
|
</select>
|
|
|
<select id="findGroupByCategoryId" resultType="cn.reghao.tnb.common.db.GroupCount">
|
|
<select id="findGroupByCategoryId" resultType="cn.reghao.tnb.common.db.GroupCount">
|
|
|
select category_id as id,count(*) total
|
|
select category_id as id,count(*) total
|
|
|
- from video_post
|
|
|
|
|
|
|
+ from vod_video_post
|
|
|
where deleted=0
|
|
where deleted=0
|
|
|
group by category_id
|
|
group by category_id
|
|
|
order by total desc
|
|
order by total desc
|
|
|
</select>
|
|
</select>
|
|
|
<select id="findRandomVideoIds" resultType="java.lang.String">
|
|
<select id="findRandomVideoIds" resultType="java.lang.String">
|
|
|
SELECT t1.video_id
|
|
SELECT t1.video_id
|
|
|
- FROM video_post AS t1
|
|
|
|
|
- JOIN (SELECT ROUND(RAND()*(SELECT MAX(id) FROM video_post)) AS id) AS t2
|
|
|
|
|
|
|
+ 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
|
|
WHERE t1.id>=t2.id
|
|
|
ORDER BY t1.id
|
|
ORDER BY t1.id
|
|
|
LIMIT #{size}
|
|
LIMIT #{size}
|