|
@@ -9,6 +9,11 @@
|
|
|
(#{videoId},#{title},#{description},#{categoryPid},#{categoryId},#{coverUrl},#{scope},#{status},#{horizontal},#{duration},#{publishAt},#{publishBy})
|
|
(#{videoId},#{title},#{description},#{categoryPid},#{categoryId},#{coverUrl},#{scope},#{status},#{horizontal},#{duration},#{publishAt},#{publishBy})
|
|
|
</insert>
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
+ <delete id="deleteByVideoId">
|
|
|
|
|
+ delete from vod_video_post
|
|
|
|
|
+ where video_id=#{videoId}
|
|
|
|
|
+ </delete>
|
|
|
|
|
+
|
|
|
<update id="updateVideoScope">
|
|
<update id="updateVideoScope">
|
|
|
update vod_video_post
|
|
update vod_video_post
|
|
|
set update_time=now(),scope=#{scope}
|
|
set update_time=now(),scope=#{scope}
|
|
@@ -39,16 +44,6 @@
|
|
|
set update_time=now(),`title`=#{title},`description`=#{description},`category_pid`=#{categoryPid},`category_id`=#{categoryId},`cover_url`=#{coverUrl},`scope`=#{scope},`status`=#{status},`publish_at`=#{publishAt}
|
|
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}
|
|
where video_id=#{videoId}
|
|
|
</update>
|
|
</update>
|
|
|
- <update id="updateVideoCached">
|
|
|
|
|
- update vod_video_post
|
|
|
|
|
- set update_time=now(),duration=#{videoMeta.duration},`status`=2
|
|
|
|
|
- where video_id=#{videoId}
|
|
|
|
|
- </update>
|
|
|
|
|
-
|
|
|
|
|
- <delete id="deleteByVideoId">
|
|
|
|
|
- delete from vod_video_post
|
|
|
|
|
- where video_id=#{videoId}
|
|
|
|
|
- </delete>
|
|
|
|
|
|
|
|
|
|
<select id="countByCriteria" resultType="java.lang.Integer">
|
|
<select id="countByCriteria" resultType="java.lang.Integer">
|
|
|
select count(*)
|
|
select count(*)
|
|
@@ -93,10 +88,7 @@
|
|
|
<where>
|
|
<where>
|
|
|
deleted=0
|
|
deleted=0
|
|
|
<if test="videoQuery.status != null">
|
|
<if test="videoQuery.status != null">
|
|
|
- and post.status in
|
|
|
|
|
- <foreach collection="videoQuery.status" item="id" index="index" open="(" close=")" separator=",">
|
|
|
|
|
- #{id}
|
|
|
|
|
- </foreach>
|
|
|
|
|
|
|
+ and post.status=#{videoQuery.status}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="videoQuery.scope != null">
|
|
<if test="videoQuery.scope != null">
|
|
|
and post.scope in
|
|
and post.scope in
|
|
@@ -140,7 +132,7 @@
|
|
|
statistic.view,statistic.comment
|
|
statistic.view,statistic.comment
|
|
|
from vod_video_post post
|
|
from vod_video_post post
|
|
|
inner join vod_video_statistic statistic
|
|
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
|
|
|
|
|
|
|
+ on post.deleted=0 and statistic.video_id=post.video_id 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=",">
|
|
|
#{id}
|
|
#{id}
|
|
|
</foreach>
|
|
</foreach>
|
|
@@ -150,7 +142,7 @@
|
|
|
statistic.view,statistic.comment
|
|
statistic.view,statistic.comment
|
|
|
from vod_video_post post
|
|
from vod_video_post post
|
|
|
inner join vod_video_statistic statistic
|
|
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
|
|
|
|
|
|
|
+ on statistic.video_id=post.video_id and post.status=3 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=",">
|
|
|
#{id}
|
|
#{id}
|
|
|
</foreach>
|
|
</foreach>
|
|
@@ -164,10 +156,7 @@
|
|
|
<where>
|
|
<where>
|
|
|
post.deleted=0
|
|
post.deleted=0
|
|
|
<if test="videoQuery.status != null">
|
|
<if test="videoQuery.status != null">
|
|
|
- and post.status in
|
|
|
|
|
- <foreach collection="videoQuery.status" item="id" index="index" open="(" close=")" separator=",">
|
|
|
|
|
- #{id}
|
|
|
|
|
- </foreach>
|
|
|
|
|
|
|
+ and post.status=#{videoQuery.status}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="videoQuery.scope != null">
|
|
<if test="videoQuery.scope != null">
|
|
|
and post.scope in
|
|
and post.scope in
|
|
@@ -190,10 +179,7 @@
|
|
|
<where>
|
|
<where>
|
|
|
deleted=0
|
|
deleted=0
|
|
|
<if test="status != null">
|
|
<if test="status != null">
|
|
|
- and `status` in
|
|
|
|
|
- <foreach collection="status" item="id" index="index" open="(" close=")" separator=",">
|
|
|
|
|
- #{id}
|
|
|
|
|
- </foreach>
|
|
|
|
|
|
|
+ and status=#{status}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="scope != null">
|
|
<if test="scope != null">
|
|
|
and scope in
|
|
and scope in
|
|
@@ -212,10 +198,7 @@
|
|
|
<where>
|
|
<where>
|
|
|
deleted=0
|
|
deleted=0
|
|
|
<if test="searchCriteria.status != null">
|
|
<if test="searchCriteria.status != null">
|
|
|
- and status in
|
|
|
|
|
- <foreach collection="searchCriteria.status" item="id" index="index" open="(" close=")" separator=",">
|
|
|
|
|
- #{id}
|
|
|
|
|
- </foreach>
|
|
|
|
|
|
|
+ and status=#{status}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="searchCriteria.scope != null">
|
|
<if test="searchCriteria.scope != null">
|
|
|
and scope in
|
|
and scope in
|
|
@@ -237,12 +220,12 @@
|
|
|
<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 vod_video_post
|
|
from vod_video_post
|
|
|
- where deleted=0 and `status`=2 and category_pid=11
|
|
|
|
|
|
|
+ limit 1000
|
|
|
</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 vod_video_post
|
|
from vod_video_post
|
|
|
- where deleted=0 and `status` in (2,5) and id > #{nextId}
|
|
|
|
|
|
|
+ where id > #{nextId}
|
|
|
order by id asc
|
|
order by id asc
|
|
|
limit #{pageSize}
|
|
limit #{pageSize}
|
|
|
</select>
|
|
</select>
|
|
@@ -260,7 +243,7 @@
|
|
|
<select id="findShortVideo" resultType="java.lang.String">
|
|
<select id="findShortVideo" resultType="java.lang.String">
|
|
|
SELECT video_id
|
|
SELECT video_id
|
|
|
FROM vod_video_post AS t1
|
|
FROM vod_video_post AS t1
|
|
|
- WHERE t1.duration<=120 and t1.`status`=2 and t1.`horizontal`=0 and t1.scope in
|
|
|
|
|
|
|
+ WHERE t1.duration<=120 and t1.`status`=#{status} and t1.`horizontal`=0 and t1.scope in
|
|
|
<foreach collection="list" item="id" index="index" open="(" close=")" separator=",">
|
|
<foreach collection="list" item="id" index="index" open="(" close=")" separator=",">
|
|
|
#{id}
|
|
#{id}
|
|
|
</foreach>
|
|
</foreach>
|