Browse Source

删除文件相关处理

wukai 1 year ago
parent
commit
76a4d34469

+ 1 - 1
doc-admin/src/test/java/com/test/MongoTest.java

@@ -36,7 +36,7 @@ public class MongoTest {
 //        docInfoList.stream().sorted(Co)
         docInfoList.forEach(info -> {
 //            elasticSearchService.delete(info);
-//            infoService.deleteDocInfoByDocId(info.getDocId());
+            infoService.deleteDocInfoByDocId(info.getDocId());
             System.err.println(info.getCreateBy() + "-" + DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, info.getCreateTime()) + "\t" + info + "remark:" + StringUtils.length(info.getRemark()));
         });
     }

+ 28 - 7
doc-biz/src/main/java/com/doc/biz/controller/DocInfoController.java

@@ -14,6 +14,7 @@ import com.doc.common.enums.BusinessType;
 import com.doc.common.enums.EventLevel;
 import com.doc.common.utils.SecurityUtils;
 import com.doc.common.utils.StringUtils;
+import com.doc.common.utils.bean.BeanUtils;
 import com.doc.common.utils.file.FileUtils;
 import com.doc.common.utils.poi.ExcelUtil;
 import io.swagger.annotations.*;
@@ -53,6 +54,8 @@ public class DocInfoController extends BaseController {
     private IDocRecentService recentService;
     @Resource
     private IElasticSearchService elasticSearchService;
+    @Resource
+    private IDocInfoDelService delService;
 
     /**
      * 文件上传
@@ -354,16 +357,34 @@ public class DocInfoController extends BaseController {
     @Log(title = "文件基本信息表", businessType = BusinessType.DELETE, eventLevel = EventLevel.MIDDLE)
     @DeleteMapping("/{docIds}")
     public AjaxResult remove(@PathVariable Long[] docIds) {
+        List<DocInfo> list = new ArrayList<>();
         for (Long docId : docIds) {
             DocInfo info = docInfoService.selectDocInfoByDocId(docId);
-            //删除mongo记录
-            mongoService.removeFile(info.getFileId());
-
-            elasticSearchService.delete(docId);
-            //删除收藏记录
-            favoriteService.delete("N", docId);
+            list.add(info);
         }
-        return toAjax(docInfoService.deleteDocInfoByDocIds(docIds));
+        int i = docInfoService.deleteDocInfoByDocIds(docIds);
+        list.forEach(info -> {
+            DocInfoDel del = new DocInfoDel();
+            del.setRemark(getUsername());
+            BeanUtils.copyProperties(info, del);
+            delService.insertDocInfoDel(del);
+            /**取消删除mongo
+             try {
+             //删除mongo记录
+             mongoService.removeFile(info.getFileId());
+             } catch (Exception ignored) {
+             }*/
+            try {
+                //删除es记录
+                elasticSearchService.delete(info.getDocId());
+            } catch (Exception ignored) {
+            }
+            //删除收藏记录
+            favoriteService.delete("N", info.getDocId());
+            //删除最近记录
+            recentService.delete("N", info.getDocId());
+        });
+        return toAjax(i);
     }
 
 

+ 114 - 0
doc-biz/src/main/java/com/doc/biz/controller/DocInfoDelController.java

@@ -0,0 +1,114 @@
+package com.doc.biz.controller;
+
+import java.util.List;
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.doc.common.annotation.Log;
+import com.doc.common.core.controller.BaseController;
+import com.doc.common.core.domain.AjaxResult;
+import com.doc.common.enums.BusinessType;
+import com.doc.biz.domain.DocInfoDel;
+import com.doc.biz.service.IDocInfoDelService;
+import com.doc.common.utils.poi.ExcelUtil;
+import com.doc.common.core.page.TableDataInfo;
+
+/**
+ * 已删除文件列Controller
+ * 
+ * @author wukai
+ * @date 2024-01-10
+ */
+@Api(tags="已删除文件列")
+@RestController
+@RequestMapping("/biz/del")
+public class DocInfoDelController extends BaseController
+{
+    @Resource
+    private IDocInfoDelService docInfoDelService;
+
+    /**
+     * 查询已删除文件列列表
+     */
+    @ApiOperation("查询已删除文件列列表")
+    @PreAuthorize("@ss.hasPermi('biz:del:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(DocInfoDel docInfoDel)
+    {
+        startPage();
+        List<DocInfoDel> list = docInfoDelService.selectDocInfoDelList(docInfoDel);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出已删除文件列列表
+     */
+    @ApiOperation("导出已删除文件列列表")
+    @PreAuthorize("@ss.hasPermi('biz:del:export')")
+    @Log(title = "已删除文件列", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, DocInfoDel docInfoDel)
+    {
+        List<DocInfoDel> list = docInfoDelService.selectDocInfoDelList(docInfoDel);
+        ExcelUtil<DocInfoDel> util = new ExcelUtil<DocInfoDel>(DocInfoDel.class);
+        util.exportExcel(response, list, "已删除文件列数据");
+    }
+
+    /**
+     * 获取已删除文件列详细信息
+     */
+    @ApiOperation("获取已删除文件列详细信息")
+    @PreAuthorize("@ss.hasPermi('biz:del:query')")
+    @GetMapping(value = "/{docId}")
+    public AjaxResult getInfo(@PathVariable("docId") Long docId)
+    {
+        return success(docInfoDelService.selectDocInfoDelByDocId(docId));
+    }
+
+    /**
+     * 新增已删除文件列
+     */
+    @ApiOperation("新增已删除文件列")
+    @PreAuthorize("@ss.hasPermi('biz:del:add')")
+    @Log(title = "已删除文件列", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody DocInfoDel docInfoDel)
+    {
+        return toAjax(docInfoDelService.insertDocInfoDel(docInfoDel));
+    }
+
+    /**
+     * 修改已删除文件列
+     */
+    @ApiOperation("修改已删除文件列")
+    @PreAuthorize("@ss.hasPermi('biz:del:edit')")
+    @Log(title = "已删除文件列", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody DocInfoDel docInfoDel)
+    {
+        return toAjax(docInfoDelService.updateDocInfoDel(docInfoDel));
+    }
+
+    /**
+     * 删除已删除文件列
+     */
+    @ApiOperation("删除已删除文件列")
+    @PreAuthorize("@ss.hasPermi('biz:del:remove')")
+    @Log(title = "已删除文件列", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{docIds}")
+    public AjaxResult remove(@PathVariable Long[] docIds)
+    {
+        return toAjax(docInfoDelService.deleteDocInfoDelByDocIds(docIds));
+    }
+}

+ 156 - 0
doc-biz/src/main/java/com/doc/biz/domain/DocInfoDel.java

@@ -0,0 +1,156 @@
+package com.doc.biz.domain;
+
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.baomidou.mybatisplus.annotation.TableId;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.doc.common.annotation.Excel;
+import com.doc.common.core.domain.BaseEntity;
+
+/**
+ * 已删除文件列对象 doc_info_del
+ *
+ * @author wukai
+ * @date 2024-01-10
+ */
+@ApiModel(value = "DocInfoDel", description = "已删除文件列")
+public class DocInfoDel extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 文件ID */
+    @ApiModelProperty("文件ID")
+    @TableId
+    private Long docId;
+
+    /** 空间ID */
+    @ApiModelProperty("空间ID")
+    @Excel(name = "空间ID")
+    private Long spaceId;
+
+    /** 目录ID */
+    @ApiModelProperty("目录ID")
+    @Excel(name = "目录ID")
+    private Long dirId;
+
+    /** 文件名称 */
+    @ApiModelProperty("文件名称")
+    @Excel(name = "文件名称")
+    private String fileName;
+
+    /** 文件ID,mongo库中的ID */
+    @ApiModelProperty("文件ID,mongo库中的ID")
+    @Excel(name = "文件ID,mongo库中的ID")
+    private String fileId;
+
+    /** 文件大小 */
+    @ApiModelProperty("文件大小")
+    @Excel(name = "文件大小")
+    private Long fileSize;
+
+    /** 文件类型 */
+    @ApiModelProperty("文件类型")
+    @Excel(name = "文件类型")
+    private String fileType;
+
+    /** 删除时间 */
+    @ApiModelProperty("删除时间")
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "删除时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date delTime;
+
+    public void setDocId(Long docId)
+    {
+        this.docId = docId;
+    }
+
+    public Long getDocId()
+    {
+        return docId;
+    }
+    public void setSpaceId(Long spaceId)
+    {
+        this.spaceId = spaceId;
+    }
+
+    public Long getSpaceId()
+    {
+        return spaceId;
+    }
+    public void setDirId(Long dirId)
+    {
+        this.dirId = dirId;
+    }
+
+    public Long getDirId()
+    {
+        return dirId;
+    }
+    public void setFileName(String fileName)
+    {
+        this.fileName = fileName;
+    }
+
+    public String getFileName()
+    {
+        return fileName;
+    }
+    public void setFileId(String fileId)
+    {
+        this.fileId = fileId;
+    }
+
+    public String getFileId()
+    {
+        return fileId;
+    }
+    public void setFileSize(Long fileSize)
+    {
+        this.fileSize = fileSize;
+    }
+
+    public Long getFileSize()
+    {
+        return fileSize;
+    }
+    public void setFileType(String fileType)
+    {
+        this.fileType = fileType;
+    }
+
+    public String getFileType()
+    {
+        return fileType;
+    }
+    public void setDelTime(Date delTime)
+    {
+        this.delTime = delTime;
+    }
+
+    public Date getDelTime()
+    {
+        return delTime;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("docId", getDocId())
+            .append("spaceId", getSpaceId())
+            .append("dirId", getDirId())
+            .append("fileName", getFileName())
+            .append("fileId", getFileId())
+            .append("fileSize", getFileSize())
+            .append("fileType", getFileType())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .append("delTime", getDelTime())
+            .append("remark", getRemark())
+            .toString();
+    }
+}

+ 62 - 0
doc-biz/src/main/java/com/doc/biz/mapper/DocInfoDelMapper.java

@@ -0,0 +1,62 @@
+package com.doc.biz.mapper;
+
+import java.util.List;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.doc.biz.domain.DocInfoDel;
+
+/**
+ * 已删除文件列Mapper接口
+ * 
+ * @author wukai
+ * @date 2024-01-10
+ */
+public interface DocInfoDelMapper extends BaseMapper<DocInfoDel>
+{
+    /**
+     * 查询已删除文件列
+     * 
+     * @param docId 已删除文件列主键
+     * @return 已删除文件列
+     */
+    public DocInfoDel selectDocInfoDelByDocId(Long docId);
+
+    /**
+     * 查询已删除文件列列表
+     * 
+     * @param docInfoDel 已删除文件列
+     * @return 已删除文件列集合
+     */
+    public List<DocInfoDel> selectDocInfoDelList(DocInfoDel docInfoDel);
+
+    /**
+     * 新增已删除文件列
+     * 
+     * @param docInfoDel 已删除文件列
+     * @return 结果
+     */
+    public int insertDocInfoDel(DocInfoDel docInfoDel);
+
+    /**
+     * 修改已删除文件列
+     * 
+     * @param docInfoDel 已删除文件列
+     * @return 结果
+     */
+    public int updateDocInfoDel(DocInfoDel docInfoDel);
+
+    /**
+     * 删除已删除文件列
+     * 
+     * @param docId 已删除文件列主键
+     * @return 结果
+     */
+    public int deleteDocInfoDelByDocId(Long docId);
+
+    /**
+     * 批量删除已删除文件列
+     * 
+     * @param docIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteDocInfoDelByDocIds(Long[] docIds);
+}

+ 61 - 0
doc-biz/src/main/java/com/doc/biz/service/IDocInfoDelService.java

@@ -0,0 +1,61 @@
+package com.doc.biz.service;
+
+import java.util.List;
+import com.doc.biz.domain.DocInfoDel;
+
+/**
+ * 已删除文件列Service接口
+ * 
+ * @author wukai
+ * @date 2024-01-10
+ */
+public interface IDocInfoDelService 
+{
+    /**
+     * 查询已删除文件列
+     * 
+     * @param docId 已删除文件列主键
+     * @return 已删除文件列
+     */
+    public DocInfoDel selectDocInfoDelByDocId(Long docId);
+
+    /**
+     * 查询已删除文件列列表
+     * 
+     * @param docInfoDel 已删除文件列
+     * @return 已删除文件列集合
+     */
+    public List<DocInfoDel> selectDocInfoDelList(DocInfoDel docInfoDel);
+
+    /**
+     * 新增已删除文件列
+     * 
+     * @param docInfoDel 已删除文件列
+     * @return 结果
+     */
+    public int insertDocInfoDel(DocInfoDel docInfoDel);
+
+    /**
+     * 修改已删除文件列
+     * 
+     * @param docInfoDel 已删除文件列
+     * @return 结果
+     */
+    public int updateDocInfoDel(DocInfoDel docInfoDel);
+
+    /**
+     * 批量删除已删除文件列
+     * 
+     * @param docIds 需要删除的已删除文件列主键集合
+     * @return 结果
+     */
+    public int deleteDocInfoDelByDocIds(Long[] docIds);
+
+    /**
+     * 删除已删除文件列信息
+     * 
+     * @param docId 已删除文件列主键
+     * @return 结果
+     */
+    public int deleteDocInfoDelByDocId(Long docId);
+}

+ 8 - 0
doc-biz/src/main/java/com/doc/biz/service/IDocRecentService.java

@@ -70,4 +70,12 @@ public interface IDocRecentService {
      * @return 结果
      */
     public int deleteDocRecentByRecentId(Long recentId);
+
+    /**
+     * 删除最近文件信息
+     *
+     * @param isFolder 是否文件夹
+     * @param realId   关联ID
+     */
+    public void delete(String isFolder, Long realId);
 }

+ 90 - 0
doc-biz/src/main/java/com/doc/biz/service/impl/DocInfoDelServiceImpl.java

@@ -0,0 +1,90 @@
+package com.doc.biz.service.impl;
+
+import com.doc.biz.domain.DocInfoDel;
+import com.doc.biz.mapper.DocInfoDelMapper;
+import com.doc.biz.service.IDocInfoDelService;
+import com.doc.common.utils.DateUtils;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * 已删除文件列Service业务层处理
+ *
+ * @author wukai
+ * @date 2024-01-10
+ */
+@Service
+public class DocInfoDelServiceImpl implements IDocInfoDelService {
+    @Resource
+    private DocInfoDelMapper docInfoDelMapper;
+
+    /**
+     * 查询已删除文件列
+     *
+     * @param docId 已删除文件列主键
+     * @return 已删除文件列
+     */
+    @Override
+    public DocInfoDel selectDocInfoDelByDocId(Long docId) {
+        return docInfoDelMapper.selectDocInfoDelByDocId(docId);
+    }
+
+    /**
+     * 查询已删除文件列列表
+     *
+     * @param docInfoDel 已删除文件列
+     * @return 已删除文件列
+     */
+    @Override
+    public List<DocInfoDel> selectDocInfoDelList(DocInfoDel docInfoDel) {
+        return docInfoDelMapper.selectDocInfoDelList(docInfoDel);
+    }
+
+    /**
+     * 新增已删除文件列
+     *
+     * @param docInfoDel 已删除文件列
+     * @return 结果
+     */
+    @Override
+    public int insertDocInfoDel(DocInfoDel docInfoDel) {
+        docInfoDel.setDelTime(DateUtils.getNowDate());
+        return docInfoDelMapper.insertDocInfoDel(docInfoDel);
+    }
+
+    /**
+     * 修改已删除文件列
+     *
+     * @param docInfoDel 已删除文件列
+     * @return 结果
+     */
+    @Override
+    public int updateDocInfoDel(DocInfoDel docInfoDel) {
+        docInfoDel.setUpdateTime(DateUtils.getNowDate());
+        return docInfoDelMapper.updateDocInfoDel(docInfoDel);
+    }
+
+    /**
+     * 批量删除已删除文件列
+     *
+     * @param docIds 需要删除的已删除文件列主键
+     * @return 结果
+     */
+    @Override
+    public int deleteDocInfoDelByDocIds(Long[] docIds) {
+        return docInfoDelMapper.deleteDocInfoDelByDocIds(docIds);
+    }
+
+    /**
+     * 删除已删除文件列信息
+     *
+     * @param docId 已删除文件列主键
+     * @return 结果
+     */
+    @Override
+    public int deleteDocInfoDelByDocId(Long docId) {
+        return docInfoDelMapper.deleteDocInfoDelByDocId(docId);
+    }
+}

+ 14 - 0
doc-biz/src/main/java/com/doc/biz/service/impl/DocRecentServiceImpl.java

@@ -127,4 +127,18 @@ public class DocRecentServiceImpl implements IDocRecentService {
     public int deleteDocRecentByRecentId(Long recentId) {
         return docRecentMapper.deleteDocRecentByRecentId(recentId);
     }
+
+    /**
+     * 删除最近文件信息
+     *
+     * @param isFolder 是否文件夹
+     * @param realId   关联ID
+     */
+    @Override
+    public void delete(String isFolder, Long realId) {
+        QueryWrapper<DocRecent> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_folder", isFolder);
+        queryWrapper.eq("rela_id", realId);
+        docRecentMapper.delete(queryWrapper);
+    }
 }

+ 111 - 0
doc-biz/src/main/resources/mapper/biz/DocInfoDelMapper.xml

@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.doc.biz.mapper.DocInfoDelMapper">
+    
+    <resultMap type="DocInfoDel" id="DocInfoDelResult">
+        <result property="docId"    column="DOC_ID"    />
+        <result property="spaceId"    column="SPACE_ID"    />
+        <result property="dirId"    column="DIR_ID"    />
+        <result property="fileName"    column="FILE_NAME"    />
+        <result property="fileId"    column="FILE_ID"    />
+        <result property="fileSize"    column="FILE_SIZE"    />
+        <result property="fileType"    column="FILE_TYPE"    />
+        <result property="createBy"    column="CREATE_BY"    />
+        <result property="createTime"    column="CREATE_TIME"    />
+        <result property="updateBy"    column="UPDATE_BY"    />
+        <result property="updateTime"    column="UPDATE_TIME"    />
+        <result property="delTime"    column="DEL_TIME"    />
+        <result property="remark"    column="REMARK"    />
+    </resultMap>
+
+    <sql id="selectDocInfoDelVo">
+        select DOC_ID, SPACE_ID, DIR_ID, FILE_NAME, FILE_ID, FILE_SIZE, FILE_TYPE, CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME, DEL_TIME, REMARK from doc_info_del
+    </sql>
+
+    <select id="selectDocInfoDelList" parameterType="DocInfoDel" resultMap="DocInfoDelResult">
+        <include refid="selectDocInfoDelVo"/>
+        <where>  
+            <if test="spaceId != null "> and SPACE_ID = #{spaceId}</if>
+            <if test="dirId != null "> and DIR_ID = #{dirId}</if>
+            <if test="fileName != null  and fileName != ''"> and FILE_NAME like concat('%', #{fileName}, '%')</if>
+            <if test="fileId != null  and fileId != ''"> and FILE_ID = #{fileId}</if>
+            <if test="fileSize != null "> and FILE_SIZE = #{fileSize}</if>
+            <if test="fileType != null  and fileType != ''"> and FILE_TYPE = #{fileType}</if>
+            <if test="createBy != null  and createBy != ''"> and CREATE_BY = #{createBy}</if>
+            <if test="createTime != null "> and CREATE_TIME = #{createTime}</if>
+            <if test="updateBy != null  and updateBy != ''"> and UPDATE_BY = #{updateBy}</if>
+            <if test="updateTime != null "> and UPDATE_TIME = #{updateTime}</if>
+            <if test="delTime != null "> and DEL_TIME = #{delTime}</if>
+            <if test="remark != null  and remark != ''"> and REMARK = #{remark}</if>
+        </where>
+    </select>
+    
+    <select id="selectDocInfoDelByDocId" parameterType="Long" resultMap="DocInfoDelResult">
+        <include refid="selectDocInfoDelVo"/>
+        where DOC_ID = #{docId}
+    </select>
+        
+    <insert id="insertDocInfoDel" parameterType="DocInfoDel" useGeneratedKeys="true" keyProperty="docId">
+        insert into doc_info_del
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="spaceId != null">SPACE_ID,</if>
+            <if test="dirId != null">DIR_ID,</if>
+            <if test="fileName != null">FILE_NAME,</if>
+            <if test="fileId != null">FILE_ID,</if>
+            <if test="fileSize != null">FILE_SIZE,</if>
+            <if test="fileType != null">FILE_TYPE,</if>
+            <if test="createBy != null">CREATE_BY,</if>
+            <if test="createTime != null">CREATE_TIME,</if>
+            <if test="updateBy != null">UPDATE_BY,</if>
+            <if test="updateTime != null">UPDATE_TIME,</if>
+            <if test="delTime != null">DEL_TIME,</if>
+            <if test="remark != null">REMARK,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="spaceId != null">#{spaceId},</if>
+            <if test="dirId != null">#{dirId},</if>
+            <if test="fileName != null">#{fileName},</if>
+            <if test="fileId != null">#{fileId},</if>
+            <if test="fileSize != null">#{fileSize},</if>
+            <if test="fileType != null">#{fileType},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="delTime != null">#{delTime},</if>
+            <if test="remark != null">#{remark},</if>
+         </trim>
+    </insert>
+
+    <update id="updateDocInfoDel" parameterType="DocInfoDel">
+        update doc_info_del
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="spaceId != null">SPACE_ID = #{spaceId},</if>
+            <if test="dirId != null">DIR_ID = #{dirId},</if>
+            <if test="fileName != null">FILE_NAME = #{fileName},</if>
+            <if test="fileId != null">FILE_ID = #{fileId},</if>
+            <if test="fileSize != null">FILE_SIZE = #{fileSize},</if>
+            <if test="fileType != null">FILE_TYPE = #{fileType},</if>
+            <if test="createBy != null">CREATE_BY = #{createBy},</if>
+            <if test="createTime != null">CREATE_TIME = #{createTime},</if>
+            <if test="updateBy != null">UPDATE_BY = #{updateBy},</if>
+            <if test="updateTime != null">UPDATE_TIME = #{updateTime},</if>
+            <if test="delTime != null">DEL_TIME = #{delTime},</if>
+            <if test="remark != null">REMARK = #{remark},</if>
+        </trim>
+        where DOC_ID = #{docId}
+    </update>
+
+    <delete id="deleteDocInfoDelByDocId" parameterType="Long">
+        delete from doc_info_del where DOC_ID = #{docId}
+    </delete>
+
+    <delete id="deleteDocInfoDelByDocIds" parameterType="String">
+        delete from doc_info_del where DOC_ID in 
+        <foreach item="docId" collection="array" open="(" separator="," close=")">
+            #{docId}
+        </foreach>
+    </delete>
+</mapper>