Преглед на файлове

content-service disk 模块的数据库表名以 disk_ 为前缀

reghao преди 5 месеца
родител
ревизия
7b90d89079

+ 4 - 4
content/content-service/src/main/resources/mapper/disk/CamDeviceMapper.xml

@@ -3,7 +3,7 @@
 
 <mapper namespace="cn.reghao.tnb.content.app.disk.db.mapper.CamDeviceMapper">
     <insert id="save" useGeneratedKeys="true" keyProperty="id">
-        insert into my_cam_device
+        insert into disk_cam_device
         (`cam_id`,`cam_name`,`state`,`add_at`,`add_by`,`pull_url`,`push_url`)
         values
         (#{camId},#{camName},#{state},#{addAt},#{addBy},#{pullUrl},#{pushUrl})
@@ -11,7 +11,7 @@
 
     <select id="countByCamDeviceQuery" resultType="java.lang.Integer">
         select count(*)
-        from my_cam_device
+        from disk_cam_device
         <where>
             deleted=0
             <if test="camId != null">
@@ -27,7 +27,7 @@
     </select>
     <select id="findCamDeviceQueryByPage" resultType="cn.reghao.tnb.content.app.disk.model.po.CamDevice">
         select *
-        from my_cam_device
+        from disk_cam_device
         <where>
             deleted=0
             <if test="camDeviceQuery.camId != null">
@@ -43,7 +43,7 @@
     </select>
     <select id="findByCamIds" resultType="cn.reghao.tnb.content.app.disk.model.po.CamDevice">
         select *
-        from my_cam_device
+        from disk_cam_device
         where deleted=0 and cam_id in
         <foreach collection="list" item="id" index="index" open="(" close=")" separator=",">
             #{id}

+ 6 - 6
content/content-service/src/main/resources/mapper/disk/CamRecordMapper.xml

@@ -3,36 +3,36 @@
 
 <mapper namespace="cn.reghao.tnb.content.app.disk.db.mapper.CamRecordMapper">
     <insert id="save" useGeneratedKeys="true" keyProperty="id">
-        insert into my_cam_record
+        insert into disk_cam_record
         (`cam_id`,`record_id`,`video_file_id`,`start_at`,`duration`)
         values
         (#{camId},#{recordId},#{videoFileId},#{startAt},#{duration})
     </insert>
 
     <delete id="deleteByAlbumIdAndPostId">
-        delete from my_cam_record
+        delete from disk_cam_record
         where album_id=#{albumId} and post_id=#{postId}
     </delete>
     
     <select id="findByCamId" resultType="cn.reghao.tnb.content.app.disk.model.po.CamRecord">
         select *
-        from my_cam_record
+        from disk_cam_record
         where cam_id=#{camId}
     </select>
     <select id="findByCamIdAndStartAt" resultType="cn.reghao.tnb.content.app.disk.model.vo.CamRecordInfo">
         select cam_id,record_id,DATE_FORMAT(start_at,'%T') as startTime,duration
-        from my_cam_record
+        from disk_cam_record
         where cam_id=#{camId} and DATE_FORMAT(start_at,'%Y-%m-%d')=#{dayStr}
         order by start_at asc
     </select>
     <select id="findByRecordId" resultType="cn.reghao.tnb.content.app.disk.model.po.CamRecord">
         select *
-        from my_cam_record
+        from disk_cam_record
         where record_id=#{recordId}
     </select>
     <select id="findGroupByYearMonth" resultType="java.lang.String">
         select DATE_FORMAT(start_at,'%Y-%m-%d') as yearMonthDay
-        from my_cam_record
+        from disk_cam_record
         where cam_id=#{camId} and DATE_FORMAT(start_at,'%Y-%m')=#{yearMonth}
         group by yearMonthDay
     </select>

+ 13 - 13
content/content-service/src/main/resources/mapper/disk/DiskAlbumMapper.xml

@@ -3,13 +3,13 @@
 
 <mapper namespace="cn.reghao.tnb.content.app.disk.db.mapper.DiskAlbumMapper">
     <insert id="save" useGeneratedKeys="true" keyProperty="id">
-        insert into my_disk_album
+        insert into disk_album
         (`album_id`,`album_name`,`file_type`,`cover_file_id`,`num`,`create_at`,`create_by`)
         values
         (#{albumId},#{albumName},#{fileType},#{coverFileId},#{num},#{createAt},#{createBy})
     </insert>
     <insert id="saveAlbumFiles" useGeneratedKeys="true" keyProperty="id">
-        insert into my_disk_album_file
+        insert into disk_album_file
         (`album_id`,`sha256sum`,`pos`)
         values
         <foreach collection="list" item="item" index="index" separator=",">
@@ -18,28 +18,28 @@
     </insert>
 
     <update id="updateDiskAlbum">
-        update my_disk_album
+        update disk_album
         set update_time=now(),cover_file_id=#{coverFileId},num=#{num}
         where album_id=#{albumId}
     </update>
     <update id="updateDiskAlbumNum">
-        update my_disk_album
+        update disk_album
         set update_time=now(),num=#{num}
         where album_id=#{albumId}
     </update>
     <update id="updateDiskAlbumCover">
-        update my_disk_album
+        update disk_album
         set update_time=now(),cover_file_id=#{coverFileId}
         where album_id=#{albumId}
     </update>
     <update id="updateDiskAlbumFilePos">
-        update my_disk_album_file
+        update disk_album_file
         set pos=#{pos}
         where id=#{id}
     </update>
 
     <delete id="deleteDiskAlbumFiles">
-        delete from my_disk_album_file
+        delete from disk_album_file
         where album_id=#{albumId} and sha256sum in
         <foreach collection="sha256sumList" item="id" index="index" open="(" close=")" separator=",">
             #{id}
@@ -48,23 +48,23 @@
     
     <select id="findDiskAlbum" resultType="cn.reghao.tnb.content.app.disk.model.po.DiskAlbum">
         select *
-        from my_disk_album
+        from disk_album
         where album_id=#{albumId}
     </select>
     <select id="findByCreateBy" resultType="cn.reghao.tnb.content.app.disk.model.po.DiskAlbum">
         select *
-        from my_disk_album
+        from disk_album
         where create_by=#{createBy}
     </select>
     <select id="findDiskAlbumFiles" resultType="cn.reghao.tnb.content.app.disk.model.po.DiskAlbumFile">
         select *
-        from my_disk_album_file
+        from disk_album_file
         where album_id=#{albumId}
         order by pos asc
     </select>
     <select id="findDiskAlbumFileList" resultType="cn.reghao.tnb.content.app.disk.model.po.DiskAlbumFile">
         select *
-        from my_disk_album_file
+        from disk_album_file
         where album_id=#{albumId} and sha256sum in
         <foreach collection="sha256sumList" item="id" index="index" open="(" close=")" separator=",">
             #{id}
@@ -73,12 +73,12 @@
 
     <select id="countDiskAlbumFile" resultType="java.lang.Integer">
         select count(*)
-        from my_disk_album_file
+        from disk_album_file
         where album_id=#{albumId}
     </select>
     <select id="findDiskAlbumFileByPage" resultType="cn.reghao.tnb.content.app.disk.model.po.DiskAlbumFile">
         select *
-        from my_disk_album_file
+        from disk_album_file
         where album_id=#{albumId}
         order by pos asc
     </select>

+ 16 - 16
content/content-service/src/main/resources/mapper/disk/DiskFileMapper.xml

@@ -3,13 +3,13 @@
 
 <mapper namespace="cn.reghao.tnb.content.app.disk.db.mapper.DiskFileMapper">
     <insert id="save" useGeneratedKeys="true" keyProperty="id">
-        insert into my_disk_file
+        insert into disk_file
         (`channel_code`,`file_id`,`pid`,`path`,`filename`,`file_type`,`sha256sum`,`size`,`owner`)
         values
         (#{channelCode},#{fileId},#{pid},#{path},#{filename},#{fileType},#{sha256sum},#{size},#{owner})
     </insert>
     <insert id="saveAll" useGeneratedKeys="true" keyProperty="id">
-        insert into my_disk_file
+        insert into disk_file
         (`channel_code`,`file_id`,`pid`,`path`,`filename`,`file_type`,`sha256sum`,`size`,`owner`)
         values
         <foreach collection="list" item="item" index="index" separator=",">
@@ -18,12 +18,12 @@
     </insert>
 
     <update id="updateMoveDiskFile">
-        update my_disk_file
+        update disk_file
         set update_time=now(),pid=#{pid},`path`=#{path}
         where file_id=#{fileId}
     </update>
     <update id="updateDeleteDiskFiles">
-        update my_disk_file
+        update disk_file
         set update_time=now(),deleted=1
         where file_id in
         <foreach collection="collection" item="id" index="index" open="(" close=")" separator=",">
@@ -31,19 +31,19 @@
         </foreach>
     </update>
     <update id="updateDeleteByPathPrefix">
-        update my_disk_file
+        update disk_file
         set update_time=now(),deleted=1
         where `owner`=#{owner} and `path` like concat(#{pathPrefix},'%')
     </update>
 
     <delete id="deleteByAlbumIdAndPostId">
-        delete from my_disk_file
+        delete from disk_file
         where album_id=#{albumId} and post_id=#{postId}
     </delete>
 
     <select id="countByDiskQuery" resultType="java.lang.Integer">
         select count(*)
-        from my_disk_file
+        from disk_file
         <where>
             deleted=0
             <if test="fileType != null">
@@ -68,7 +68,7 @@
     </select>
     <select id="findDiskQueryByPage" resultType="cn.reghao.tnb.content.app.disk.model.po.DiskFile">
         select *
-        from my_disk_file
+        from disk_file
         <where>
             deleted=0
             <if test="diskQuery.fileType != null">
@@ -97,14 +97,14 @@
     </select>
     <select id="findFileTypeCountByGroup" resultType="cn.reghao.tnb.content.app.disk.model.vo.DiskFileCount">
         select file,count(*) as total
-        from my_disk_file
+        from disk_file
         group by file_type
         order by total desc
     </select>
 
     <select id="findByFileIds" resultType="cn.reghao.tnb.content.app.disk.model.po.DiskFile">
         select *
-        from my_disk_file
+        from disk_file
         where deleted=0 and file_id in
         <foreach collection="list" item="id" index="index" open="(" close=")" separator=",">
             #{id}
@@ -112,7 +112,7 @@
     </select>
     <select id="findByParentIds" resultType="cn.reghao.tnb.content.app.disk.model.po.DiskFile">
         select *
-        from my_disk_file
+        from disk_file
         where deleted=0 and pid in
         <foreach collection="list" item="id" index="index" open="(" close=")" separator=",">
             #{id}
@@ -120,18 +120,18 @@
     </select>
     <select id="findRoot" resultType="cn.reghao.tnb.content.app.disk.model.po.DiskFile">
         select *
-        from my_disk_file
+        from disk_file
         where file_id='0'
     </select>
     <select id="findByPathPrefix" resultType="cn.reghao.tnb.content.app.disk.model.po.DiskFile">
         select *
-        from my_disk_file
+        from disk_file
         where deleted=0 and file_id!=#{fileId} and `path` like concat(#{pathPrefix})
     </select>
 
     <select id="countSha256sumGroupByDiskQuery" resultType="java.lang.String">
         select sha256sum
-        from my_disk_file
+        from disk_file
         where deleted=0 and `owner`=#{userId} and file_type=#{fileType} and sha256sum not in (
             select sha256sum
             from my_disk_album_file A
@@ -145,7 +145,7 @@
     </select>
     <select id="findSha256sumGroupByPage" resultType="cn.reghao.tnb.content.app.disk.model.po.DiskFile">
         select *
-        from my_disk_file
+        from disk_file
         where deleted=0 and `owner`=#{userId} and file_type=#{fileType} and sha256sum not in (
             select sha256sum
             from my_disk_album_file A
@@ -159,7 +159,7 @@
     </select>
     <select id="findSha256sumGroup" resultType="cn.reghao.tnb.content.app.disk.model.po.DiskFile">
         select *
-        from my_disk_file
+        from disk_file
         where deleted=0 and sha256sum in
         <foreach collection="list" item="id" index="index" open="(" close=")" separator=",">
             #{id}

+ 14 - 14
content/content-service/src/main/resources/mapper/disk/DiskShareMapper.xml

@@ -3,13 +3,13 @@
 
 <mapper namespace="cn.reghao.tnb.content.app.disk.db.mapper.DiskShareMapper">
     <insert id="save" useGeneratedKeys="true" keyProperty="id">
-        insert into my_disk_share
+        insert into disk_share
         (`share_id`,`album_type`,`album_id`,`create_at`,`create_by`)
         values
         (#{shareId},#{albumType},#{albumId},#{createAt},#{createBy})
     </insert>
     <insert id="saveDiskShareTo" useGeneratedKeys="true" keyProperty="id">
-        insert into my_disk_share_to
+        insert into disk_share_to
         (`share_id`,`user_id`)
         values
         <foreach collection="list" item="item" index="index" separator=",">
@@ -18,47 +18,47 @@
     </insert>
 
     <update id="updateSetDelete">
-        update my_disk_share
+        update disk_share
         set update_time=now(),deleted=1
         where share_id=#{shareId}
     </update>
     <delete id="deleteShareToList">
-        delete from my_disk_share_to
+        delete from disk_share_to
         where share_id=#{shareId}
     </delete>
 
     <select id="countDiskShare" resultType="java.lang.Integer">
         select count(*)
-        from my_disk_share
+        from disk_share
         where deleted=0 and create_by=#{createBy}
     </select>
     <select id="findDiskShareByPage" resultType="cn.reghao.tnb.content.app.disk.model.po.DiskShare">
         select *
-        from my_disk_share
+        from disk_share
         where deleted=0 and create_by=#{createBy}
     </select>
     <select id="findDiskShare" resultType="cn.reghao.tnb.content.app.disk.model.po.DiskShare">
         select *
-        from my_disk_share
+        from disk_share
         where deleted=0 and share_id=#{shareId}
     </select>
 
     <select id="findDiskShareList" resultType="cn.reghao.tnb.content.app.disk.model.po.DiskShare">
-        select my_disk_share.*
-        from my_disk_share_to
-        inner join my_disk_share
-        on my_disk_share.deleted=0 and my_disk_share_to.share_id=my_disk_share.share_id
-        where my_disk_share.album_type=#{albumType} and my_disk_share_to.user_id=#{shareTo}
+        select disk_share.*
+        from disk_share_to
+        inner join disk_share
+        on disk_share.deleted=0 and disk_share_to.share_id=disk_share.share_id
+        where disk_share.album_type=#{albumType} and disk_share_to.user_id=#{shareTo}
     </select>
 
     <select id="countDiskShareTo" resultType="java.lang.Integer">
         select count(*)
-        from my_disk_share_to
+        from disk_share_to
         where share_id=#{shareId}
     </select>
     <select id="findDiskShareToList" resultType="java.lang.Long">
         select user_id
-        from my_disk_share_to
+        from disk_share_to
         where share_id=#{shareId}
     </select>
 </mapper>

+ 2 - 2
content/content-service/src/main/resources/mapper/disk/UserActivityMapper.xml

@@ -3,13 +3,13 @@
 
 <mapper namespace="cn.reghao.tnb.content.app.disk.db.mapper.UserActivityMapper">
     <insert id="save" useGeneratedKeys="true" keyProperty="id">
-        insert into my_user_activity
+        insert into disk_user_activity
         (`id`,`activity`,`create_time`,`create_by`)
         values
         (#{id},#{activity},#{createTime},#{createBy})
     </insert>
     <insert id="saveAll" useGeneratedKeys="true" keyProperty="id">
-        insert into my_user_activity
+        insert into disk_user_activity
         (`id`,`activity`,`create_time`,`create_by`)
         values
         <foreach collection="list" item="item" index="index" separator=",">