|
@@ -155,6 +155,79 @@
|
|
|
order by post.publish_at desc
|
|
order by post.publish_at desc
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
|
|
+ <select id="countAdminVideo" resultType="java.lang.Integer">
|
|
|
|
|
+ select count(*)
|
|
|
|
|
+ from vod_video_post
|
|
|
|
|
+ <where>
|
|
|
|
|
+ deleted=0
|
|
|
|
|
+ <if test="status != null">
|
|
|
|
|
+ and `status` in
|
|
|
|
|
+ <foreach collection="status" item="id" index="index" open="(" close=")" separator=",">
|
|
|
|
|
+ #{id}
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="scope != null">
|
|
|
|
|
+ and scope in
|
|
|
|
|
+ <foreach collection="scope" item="id" index="index" open="(" close=")" separator=",">
|
|
|
|
|
+ #{id}
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="categoryPid != null">
|
|
|
|
|
+ and category_pid=#{categoryPid}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="categoryId != null">
|
|
|
|
|
+ and category_id=#{categoryId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="userId != null">
|
|
|
|
|
+ and publish_by=#{userId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="horizontal != null">
|
|
|
|
|
+ and horizontal=#{horizontal}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="videoId != null">
|
|
|
|
|
+ and video_id=#{videoId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="title != null">
|
|
|
|
|
+ and match(title) against(#{title})
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </where>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ <select id="findAdminVideoByPage" resultType="cn.reghao.tnb.content.app.vod.model.po.VideoPost">
|
|
|
|
|
+ select *
|
|
|
|
|
+ from vod_video_post
|
|
|
|
|
+ <where>
|
|
|
|
|
+ deleted=0
|
|
|
|
|
+ <if test="videoQuery.status != null">
|
|
|
|
|
+ and `status` in
|
|
|
|
|
+ <foreach collection="videoQuery.status" item="id" index="index" open="(" close=")" separator=",">
|
|
|
|
|
+ #{id}
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="videoQuery.scope != null">
|
|
|
|
|
+ and scope in
|
|
|
|
|
+ <foreach collection="videoQuery.scope" item="id" index="index" open="(" close=")" separator=",">
|
|
|
|
|
+ #{id}
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="videoQuery.categoryPid != null">
|
|
|
|
|
+ and category_pid=#{videoQuery.categoryPid}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="videoQuery.categoryId != null">
|
|
|
|
|
+ and category_id=#{videoQuery.categoryId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="videoQuery.userId != null">
|
|
|
|
|
+ and publish_by=#{videoQuery.userId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="videoQuery.horizontal != null">
|
|
|
|
|
+ and horizontal=#{videoQuery.horizontal}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="videoQuery.title != null">
|
|
|
|
|
+ and match(title) against(#{videoQuery.title})
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </where>
|
|
|
|
|
+ order by #{videoQuery.orderBy} #{videoQuery.orderDirection}
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
<select id="countByCriteriaAndUserGroup" resultType="java.lang.Integer">
|
|
<select id="countByCriteriaAndUserGroup" resultType="java.lang.Integer">
|
|
|
select count(*)
|
|
select count(*)
|
|
|
from vod_video_post
|
|
from vod_video_post
|
|
@@ -413,13 +486,33 @@
|
|
|
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="findPublishByPost" resultType="cn.reghao.tnb.common.db.GroupCount">
|
|
|
select publish_by as id,count(*) total
|
|
select publish_by as id,count(*) total
|
|
|
from vod_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="findPublishByImage" resultType="cn.reghao.tnb.common.db.GroupCount">
|
|
|
|
|
+ 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>
|
|
|
|
|
+ <select id="findPublishByVideo" resultType="cn.reghao.tnb.common.db.GroupCount">
|
|
|
|
|
+ select publish_by as id,count(*) total
|
|
|
|
|
+ from vod_video_post
|
|
|
|
|
+ where category_pid=11
|
|
|
|
|
+ group by publish_by
|
|
|
|
|
+ order by total desc
|
|
|
|
|
+ </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 vod_video_post
|
|
from vod_video_post
|