Explorar el Código

content-service 的 vod 模块相关的表添加 vod_ 前缀, 便于业务隔离

reghao hace 1 año
padre
commit
1abdb552a7

+ 9 - 9
content/content-service/src/main/resources/mapper/data/PlayRecordMapper.xml → content/content-service/src/main/resources/mapper/vod/PlayRecordMapper.xml

@@ -3,40 +3,40 @@
 
 <mapper namespace="cn.reghao.tnb.content.app.vod.db.mapper.PlayRecordMapper">
     <insert id="save" useGeneratedKeys="true" keyProperty="id">
-        insert into play_record
+        insert into vod_play_record
         (`id`,`deleted`,`create_time`,`update_time`,`user_id`,`video_id`,`current_time`,`create_at`,`ended`)
         values 
         (#{id},#{deleted},#{createTime},#{updateTime},#{userId},#{videoId},#{currentTime},#{createAt},#{ended})
     </insert>
 
     <update id="update">
-        update play_record
+        update vod_play_record
         set update_time=now(),`current_time`=#{currentTime},create_at=#{createAt},ended=#{ended}
         where id=#{id}
     </update>
 
     <delete id="delete">
-        delete from play_record
+        delete from vod_play_record
         where id=#{id}
     </delete>
 
     <select id="findAll" resultType="cn.reghao.tnb.content.app.vod.model.po.PlayRecord">
         select *
-        from play_record
+        from vod_play_record
     </select>
     <select id="findCurrentTime" resultType="java.lang.Double">
         select max(`current_time`)
-        from play_record
+        from vod_play_record
         where user_id=#{userId} and video_id=#{videoId}
     </select>
     <select id="findMaxId" resultType="java.lang.Long">
         select max(create_at)
-        from play_record
+        from vod_play_record
         where user_id=#{userId}
     </select>
     <select id="countUserRecord" resultType="java.lang.Integer">
         select count(*)
-        from play_record record
+        from vod_play_record record
         inner join video_post post
         on record.video_id=post.video_id and record.user_id=#{userId}
         order by record.create_at desc
@@ -44,7 +44,7 @@
     <select id="findUserRecordByPage1" resultType="cn.reghao.tnb.content.api.dto.VideoRecord">
         select post.video_id,post.title,post.cover_url,post.duration,post.publish_at,post.publish_by,
                record.current_time,record.create_at
-        from play_record record
+        from vod_play_record record
         inner join video_post post
         on record.video_id=post.video_id and record.user_id=#{userId}
         where record.ended is false and record.create_at &lt; #{nextId}
@@ -53,7 +53,7 @@
     </select>
     <select id="findByUserIdAndVideoId" resultType="cn.reghao.tnb.content.app.vod.model.po.PlayRecord">
         select *
-        from play_record
+        from vod_play_record
         where ended is false and user_id=#{userId} and video_id=#{videoId}
         order by id desc
         limit 1

+ 4 - 4
content/content-service/src/main/resources/mapper/vod/PostAlbumMapper.xml

@@ -3,21 +3,21 @@
 
 <mapper namespace="cn.reghao.tnb.content.app.vod.db.mapper.PostAlbumMapper">
     <insert id="save" useGeneratedKeys="true" keyProperty="id">
-        insert into post_album
+        insert into vod_post_album
         (`album_id`,`album_name`,`cover_url`,`post_type`,`total`,`scope`,`create_by`)
         values
         (#{albumId},#{albumName},#{coverUrl},#{postType},#{total},#{scope},#{createBy})
     </insert>
 
     <update id="updateAlbumCover">
-        update post_album
+        update vod_post_album
         set cover_url=#{coverUrl}
         where album_id=#{albumId}
     </update>
 
     <select id="countByCriteria" resultType="java.lang.Integer">
         select count(*)
-        from post_album
+        from vod_post_album
         <where>
             deleted=0
             <if test="scope != null">
@@ -36,7 +36,7 @@
     </select>
     <select id="findAlbumByPage" resultType="cn.reghao.tnb.content.app.vod.model.po.PostAlbum">
         select *
-        from post_album
+        from vod_post_album
         <where>
             deleted=0
             <if test="albumQuery.scope != null">

+ 6 - 6
content/content-service/src/main/resources/mapper/vod/PostItemMapper.xml

@@ -3,13 +3,13 @@
 
 <mapper namespace="cn.reghao.tnb.content.app.vod.db.mapper.PostItemMapper">
     <insert id="save" useGeneratedKeys="true" keyProperty="id">
-        insert into post_item
+        insert into vod_post_item
         (`album_id`,`post_id`,`pos`,`added_at`)
         values
         (#{albumId},#{postId},#{pos},#{addedAt})
     </insert>
     <insert id="saveAll" useGeneratedKeys="true" keyProperty="id">
-        insert into post_item
+        insert into vod_post_item
         (`album_id`,`post_id`,`pos`,`added_at`)
         values
         <foreach collection="list" item="item" index="index" separator=",">
@@ -18,23 +18,23 @@
     </insert>
 
     <delete id="deleteByAlbumIdAndPostId">
-        delete from post_item
+        delete from vod_post_item
         where album_id=#{albumId} and post_id=#{postId}
     </delete>
 
     <select id="countByAlbumId" resultType="java.lang.Integer">
         select count(*)
-        from post_item
+        from vod_post_item
         where album_id=#{albumId}
     </select>
     <select id="findByAlbumIdByPage" resultType="cn.reghao.tnb.content.app.vod.model.po.PostItem">
         select *
-        from post_item
+        from vod_post_item
         where album_id=#{albumId}
     </select>
     <select id="findByImagePost" resultType="cn.reghao.tnb.content.app.vod.model.po.PostItem">
         select *
-        from post_item
+        from vod_post_item
         where album_id in
               (
                   select album_id

+ 3 - 3
content/content-service/src/main/resources/mapper/vod/SearchRecordMapper.xml

@@ -3,7 +3,7 @@
 
 <mapper namespace="cn.reghao.tnb.content.app.vod.db.mapper.SearchRecordMapper">
     <insert id="save" useGeneratedKeys="true" keyProperty="id">
-        insert into search_record
+        insert into vod_search_record
         (`id`,`deleted`,`create_time`,`update_time`,`user_id`,`keyword`)
         values 
         (#{id},#{deleted},#{createTime},#{updateTime},#{userId},#{keyword})
@@ -11,14 +11,14 @@
 
     <select id="findHotSearch" resultType="cn.reghao.tnb.content.app.vod.model.vo.HotSearch">
         select keyword,count(*) as rank
-        from search_record
+        from vod_search_record
         group by keyword
         order by rank desc
         limit 10
     </select>
     <select id="findSuggestKeyword" resultType="cn.reghao.tnb.content.app.vod.model.vo.SuggestKeyword">
         select id as rank,keyword
-        from search_record
+        from vod_search_record
         where keyword like concat('%',#{keyword},'%')
         limit 5
     </select>

+ 2 - 2
content/content-service/src/main/resources/mapper/data/SiteNoticeMapper.xml → content/content-service/src/main/resources/mapper/vod/SiteNoticeMapper.xml

@@ -3,7 +3,7 @@
 
 <mapper namespace="cn.reghao.tnb.content.app.vod.db.mapper.SiteNoticeMapper">
     <insert id="save" useGeneratedKeys="true" keyProperty="id">
-        insert into site_notice
+        insert into vod_site_notice
         (`content`,`create_by`)
         values 
         (#{content},#{createBy})
@@ -11,7 +11,7 @@
 
     <select id="findLatest" resultType="cn.reghao.tnb.content.app.vod.model.po.SiteNotice">
         select *
-        from site_notice
+        from vod_site_notice
         order by id desc
         limit 1
     </select>

+ 6 - 6
content/content-service/src/main/resources/mapper/vod/VideoCategoryMapper.xml

@@ -3,7 +3,7 @@
 
 <mapper namespace="cn.reghao.tnb.content.app.vod.db.mapper.VideoCategoryMapper">
     <insert id="save" useGeneratedKeys="true" keyProperty="id">
-        insert into video_category
+        insert into vod_video_category
         (`pid`,`name`,`region_id`,`icon`,`sort`)
         values 
         (#{pid},#{name},#{regionId},#{icon},#{sort})
@@ -11,26 +11,26 @@
 
     <select id="findAll" resultType="cn.reghao.tnb.content.app.vod.model.po.VideoCategory">
         select *
-        from video_category
+        from vod_video_category
     </select>
     <select id="findAllCategoryIds" resultType="cn.reghao.tnb.content.api.dto.spider.BiliRegion">
         select region_id,pid as category_pid,id as category_id
-        from video_category
+        from vod_video_category
         where pid not in (0, 3, 11)
     </select>
     <select id="findById" resultType="cn.reghao.tnb.content.app.vod.model.po.VideoCategory">
         select *
-        from video_category
+        from vod_video_category
         where id=#{id}
     </select>
     <select id="findByRid" resultType="cn.reghao.tnb.content.app.vod.model.po.VideoCategory">
         select *
-        from video_category
+        from vod_video_category
         where region_id=#{rid}
     </select>
     <select id="findAllCategory" resultType="cn.reghao.tnb.content.app.vod.model.po.VideoCategory">
         select *
-        from video_category
+        from vod_video_category
         where `pid` != 0
     </select>
 </mapper>

+ 5 - 5
content/content-service/src/main/resources/mapper/vod/VideoErrorMapper.xml

@@ -3,29 +3,29 @@
 
 <mapper namespace="cn.reghao.tnb.content.app.vod.db.mapper.VideoErrorMapper">
     <insert id="save" useGeneratedKeys="true" keyProperty="id">
-        insert into video_error
+        insert into vod_video_error
         (`id`,`deleted`,`create_time`,`update_time`,`video_id`,`error_code`,`error_info`,`solved`)
         values 
         (#{id},#{deleted},#{createTime},#{updateTime},#{videoId},#{errorCode},#{errorInfo},#{solved})
     </insert>
 
     <delete id="deleteByErrorCode">
-        delete from video_error
+        delete from vod_video_error
         where error_code=#{errorCode}
     </delete>
 
     <select id="findAll" resultType="cn.reghao.tnb.content.app.vod.model.po.VideoError">
         select *
-        from video_error
+        from vod_video_error
     </select>
     <select id="findByVideoId" resultType="cn.reghao.tnb.content.app.vod.model.po.VideoError">
         select *
-        from video_error
+        from vod_video_error
         where video_id=#{videoId}
     </select>
     <select id="findByErrorCode" resultType="cn.reghao.tnb.content.app.vod.model.po.VideoError">
         select *
-        from video_error
+        from vod_video_error
         where error_code=#{errorCode}
     </select>
 </mapper>

+ 7 - 7
content/content-service/src/main/resources/mapper/vod/VideoFileMapper.xml

@@ -3,13 +3,13 @@
 
 <mapper namespace="cn.reghao.tnb.content.app.vod.db.mapper.VideoFileMapper">
     <insert id="save" useGeneratedKeys="true" keyProperty="id">
-        insert into video_file
+        insert into vod_video_file
         (`video_file_id`,`object_id`,`video_codec`,`vbit_rate`,`audio_codec`,`abit_rate`,`format_name`,`url_type`,`url`,`quality`,`width`,`height`,`horizontal`,`duration`)
         values 
         (#{videoFileId},#{objectId},#{videoCodec},#{vbitRate},#{audioCodec},#{abitRate},#{formatName},#{urlType},#{url},#{quality},#{width},#{height},#{horizontal},#{duration})
     </insert>
     <insert id="saveAll" useGeneratedKeys="true" keyProperty="id">
-        insert into video_file
+        insert into vod_video_file
         (`video_file_id`,`object_id`,`video_codec`,`vbit_rate`,`audio_codec`,`abit_rate`,`format_name`,`url_type`,`url`,`quality`,`width`,`height`,`horizontal`,`duration`)
         values
         <foreach collection="list" item="item" index="index" separator=",">
@@ -18,26 +18,26 @@
     </insert>
 
     <delete id="deleteByVideoFileId">
-        update video_file
+        update vod_video_file
         set deleted=1
         where video_file_id=#{videoFileId}
     </delete>
 
     <select id="findAll" resultType="cn.reghao.tnb.content.app.vod.model.po.VideoFile">
-        select * from video_file
+        select * from vod_video_file
     </select>
     <select id="findVideoInfo" resultType="cn.reghao.oss.sdk.model.dto.media.VideoInfo">
         select video_file_id,duration,horizontal,quality,video_codec,audio_codec,url_type,url
-        from video_file
+        from vod_video_file
         where video_file_id=#{videoFileId}
     </select>
     <select id="findByVideoFileId" resultType="cn.reghao.tnb.content.app.vod.model.po.VideoFile">
-        select * from video_file
+        select * from vod_video_file
         where video_file_id=#{videoFileId}
     </select>
     <select id="findVideoUrls" resultType="cn.reghao.oss.sdk.model.dto.media.VideoUrlDto">
         select url_type as type,url,width,height,quality
-        from video_file
+        from vod_video_file
         where video_file_id=#{videoFileId}
     </select>
 </mapper>

+ 29 - 29
content/content-service/src/main/resources/mapper/vod/VideoPostMapper.xml

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

+ 6 - 6
content/content-service/src/main/resources/mapper/vod/VideoPostTagMapper.xml

@@ -3,13 +3,13 @@
 
 <mapper namespace="cn.reghao.tnb.content.app.vod.db.mapper.VideoPostTagMapper">
     <insert id="save" useGeneratedKeys="true" keyProperty="id">
-        insert into video_tags
+        insert into vod_video_tags
         (`video_id`, `tag_id`)
         values
         (#{videoId},#{tagId})
     </insert>
     <insert id="saveAll" useGeneratedKeys="true" keyProperty="id">
-        insert ignore into video_tags
+        insert ignore into vod_video_tags
         (`video_id`, `tag_id`)
         values
         <foreach collection="list" item="item" index="index" separator=",">
@@ -18,21 +18,21 @@
     </insert>
 
     <delete id="deleteByTagId">
-        delete from video_tags
+        delete from vod_video_tags
         where tag_id=#{tagId}
     </delete>
 
     <select id="findAll" resultType="cn.reghao.tnb.content.app.vod.model.po.VideoPostTag">
-        select * from video_tags
+        select * from vod_video_tags
     </select>
     <select id="findByTagId" resultType="java.lang.String">
         select video_id
-        from video_tags
+        from vod_video_tags
         where tag_id=#{tagId}
     </select>
     <select id="findByGroupBy" resultType="cn.reghao.tnb.common.db.GroupCount">
         select tag_id as id, count(*) as total
-        from video_tags
+        from vod_video_tags
         group by tag_id
     </select>
 </mapper>

+ 6 - 6
content/content-service/src/main/resources/mapper/vod/VideoStatisticMapper.xml

@@ -3,37 +3,37 @@
 
 <mapper namespace="cn.reghao.tnb.content.app.vod.db.mapper.VideoStatisticMapper">
     <insert id="save" useGeneratedKeys="true" keyProperty="id">
-        insert into video_statistic
+        insert into vod_video_statistic
         (`video_id`,`view`,`danmaku`,`comment`,`favorite`,`share`,`thumb_up`,`thumb_down`,`coin`)
         values 
         (#{videoId},#{view},#{danmaku},#{comment},#{favorite},#{share},#{thumbUp},#{thumbDown},#{coin})
     </insert>
     <insert id="saveAll" useGeneratedKeys="true" keyProperty="id">
-        insert into video_statistic
+        insert into vod_video_statistic
         (`video_id`,`view`,`danmaku`,`comment`,`favorite`,`share`,`thumb_up`,`thumb_down`,`coin`)
         values
         (#{item.videoId},#{item.view},#{item.danmaku},#{item.comment},#{item.favorite},#{item.share},#{item.thumbUp},#{item.thumbDown},#{item.coin})
     </insert>
 
     <update id="update">
-        update video_statistic
+        update vod_video_statistic
         set `view`=#{view},danmaku=#{danmaku},`comment`=#{comment},favorite=#{favorite},`share`=#{share},thumb_up=#{thumbUp},coin=#{coin}
         where video_id=#{videoId}
     </update>
     <update id="updateIncrView">
-        update video_statistic
+        update vod_video_statistic
         set update_time=now(),`view`=`view`+1
         where video_id=#{videoId}
     </update>
 
     <select id="findAll" resultType="cn.reghao.tnb.content.app.vod.model.po.VideoStatistic">
         SELECT *
-        FROM video_statistic
+        FROM vod_video_statistic
         limit 1000
     </select>
     <select id="findByVideoId" resultType="cn.reghao.tnb.content.app.vod.model.po.VideoStatistic">
         SELECT *
-        FROM video_statistic
+        FROM vod_video_statistic
         where video_id=#{videoId}
     </select>
 </mapper>

+ 12 - 12
content/content-service/src/main/resources/mapper/vod/VideoTagMapper.xml

@@ -3,13 +3,13 @@
 
 <mapper namespace="cn.reghao.tnb.content.app.vod.db.mapper.VideoTagMapper">
     <insert id="save" useGeneratedKeys="true" keyProperty="id">
-        insert into video_tag
+        insert into vod_video_tag
             (`tag_id`,`tag_name`)
         values
         (#{tagId},#{tagName})
     </insert>
     <insert id="saveAll" useGeneratedKeys="true" keyProperty="id">
-        insert ignore into video_tag
+        insert ignore into vod_video_tag
             (`tag_id`,`tag_name`)
         values
         <foreach collection="list" item="item" index="index" separator=",">
@@ -18,41 +18,41 @@
     </insert>
 
     <delete id="deleteByTagId">
-        delete from video_tag
+        delete from vod_video_tag
         where tag_id=#{tagId}
     </delete>
 
     <select id="findAll" resultType="cn.reghao.tnb.content.app.vod.model.po.VideoTag">
         select *
-        from video_tag
+        from vod_video_tag
     </select>
     <select id="findByName" resultType="cn.reghao.tnb.content.app.vod.model.po.VideoTag">
-        select * from video_tag where tag_name=#{name}
+        select * from vod_video_tag where tag_name=#{name}
     </select>
     <select id="findByTagId" resultType="cn.reghao.tnb.content.app.vod.model.po.VideoTag">
         select *
-        from video_tag
+        from vod_video_tag
         where tag_id=#{tagId}
     </select>
     <select id="findVideoTags" resultType="java.lang.String">
         select tag.tag_name
-        from video_tag tag
-        inner join video_tags tags
+        from vod_video_tag tag
+        inner join vod_video_tags tags
         on tag.tag_id=tags.tag_id and tags.video_id=#{videoId}
     </select>
     <select id="findVideoIds" resultType="java.lang.String">
         select video_id
-        from video_tags
+        from vod_video_tags
         where tag_id in (
             select tag_id
-            from video_tag
+            from vod_video_tag
             where tag_name=#{tagName}
         )
         limit 100
     </select>
     <select id="findRandomTags" resultType="java.lang.String">
-        SELECT t1.tag_id FROM video_tag AS t1
-        JOIN (SELECT ROUND(RAND()*(SELECT MAX(id) FROM video_tag)) AS id) AS t2
+        SELECT t1.tag_id FROM vod_video_tag AS t1
+        JOIN (SELECT ROUND(RAND()*(SELECT MAX(id) FROM vod_video_tag)) AS id) AS t2
         WHERE t1.id>=t2.id
         ORDER BY t1.id
         LIMIT #{size};