cxd 6 сар өмнө
parent
commit
ef87568df4

+ 29 - 8
gqy-admin/src/main/java/com/gqy/web/controller/document/DcDocumentController.java

@@ -69,10 +69,12 @@ public class DcDocumentController extends BaseController
      */
     @PostMapping("/add")
     public AjaxResultCQY add(@RequestBody DcDocument document) {
-
-        documentService.insertDcDocument(document);
-
-        return null;
+        try{
+            documentService.insertDcDocument(document);
+            return AjaxResultCQY.success("创建成功");
+        }catch (Exception e){
+            return AjaxResultCQY.error("创建失败");
+        }
     }
 
     /**
@@ -80,10 +82,29 @@ public class DcDocumentController extends BaseController
      * @param document
      * @return
      */
-    @PostMapping("/update")
-    public AjaxResultCQY update(@RequestBody DcDocument document){
-        documentService.updateDcDocument(document);
-        return null;
+    @PostMapping("/edit")
+    public AjaxResultCQY edit(@RequestBody DcDocument document){
+        try {
+            documentService.updateDcDocument(document);
+            return AjaxResultCQY.success("修改成功");
+        }catch (Exception e){
+            return AjaxResultCQY.error("修改失败");
+        }
+    }
+
+
+    /**
+     * 删除文档
+     * @return
+     */
+    @GetMapping("/delete/{dcbId}")
+    public @ResponseBody AjaxResultCQY delete(@PathVariable("dcbId") Long dcbId) {
+        try{
+            documentService.deleteDcDocumentById(dcbId);
+            return AjaxResultCQY.success("删除成功");
+        }catch (Exception e){
+            return AjaxResultCQY.error("删除失败");
+        }
     }
 
 //

+ 35 - 36
gqy-system/src/main/java/com/gqy/document/domain/DcDocument.java

@@ -7,81 +7,80 @@ package com.gqy.document.domain;
  */
 public class DcDocument {
 
-
     /** 主键ID */
-    private Long dcmId;
+    private Long dcm_id;
 
     /** 状态(5-使用中 4-已删除 6-已归档) */
-    private Integer dcmStatus;
+    private Integer dcm_status;
 
     /** 文档标题 */
-    private String dcmTitle;
+    private String dcm_title;
 
     /** 创建人ID */
-    private Long dcmOwner;
+    private Long dcm_owner;
 
     /** 文档模板类型(1.官方模板 2.自定义模板) */
-    private Integer dcmType;
+    private Integer dcm_type;
 
     /** 修改标记 */
-    private Integer dcmXbj;
+    private Integer dcm_xbj;
 
     /** 文档内容 */
-    private String dcmData;
+    private String dcm_data;
 
-    public Long getDcmId() {
-        return dcmId;
+    public Long getDcm_id() {
+        return dcm_id;
     }
 
-    public void setDcmId(Long dcmId) {
-        this.dcmId = dcmId;
+    public void setDcm_id(Long dcm_id) {
+        this.dcm_id = dcm_id;
     }
 
-    public Integer getDcmStatus() {
-        return dcmStatus;
+    public Integer getDcm_status() {
+        return dcm_status;
     }
 
-    public void setDcmStatus(Integer dcmStatus) {
-        this.dcmStatus = dcmStatus;
+    public void setDcm_status(Integer dcm_status) {
+        this.dcm_status = dcm_status;
     }
 
-    public String getDcmTitle() {
-        return dcmTitle;
+    public String getDcm_title() {
+        return dcm_title;
     }
 
-    public void setDcmTitle(String dcmTitle) {
-        this.dcmTitle = dcmTitle;
+    public void setDcm_title(String dcm_title) {
+        this.dcm_title = dcm_title;
     }
 
-    public Long getDcmOwner() {
-        return dcmOwner;
+    public Long getDcm_owner() {
+        return dcm_owner;
     }
 
-    public void setDcmOwner(Long dcmOwner) {
-        this.dcmOwner = dcmOwner;
+    public void setDcm_owner(Long dcm_owner) {
+        this.dcm_owner = dcm_owner;
     }
 
-    public Integer getDcmType() {
-        return dcmType;
+    public Integer getDcm_type() {
+        return dcm_type;
     }
 
-    public void setDcmType(Integer dcmType) {
-        this.dcmType = dcmType;
+    public void setDcm_type(Integer dcm_type) {
+        this.dcm_type = dcm_type;
     }
 
-    public Integer getDcmXbj() {
-        return dcmXbj;
+    public Integer getDcm_xbj() {
+        return dcm_xbj;
     }
 
-    public void setDcmXbj(Integer dcmXbj) {
-        this.dcmXbj = dcmXbj;
+    public void setDcm_xbj(Integer dcm_xbj) {
+        this.dcm_xbj = dcm_xbj;
     }
 
-    public String getDcmData() {
-        return dcmData;
+    public String getDcm_data() {
+        return dcm_data;
     }
 
-    public void setDcmData(String dcmData) {
-        this.dcmData = dcmData;
+    public void setDcm_data(String dcm_data) {
+        this.dcm_data = dcm_data;
     }
 }

+ 6 - 0
gqy-system/src/main/java/com/gqy/document/service/IDocumentService.java

@@ -49,6 +49,12 @@ public interface IDocumentService
      */
     public int updateDcDocument(DcDocument dcDocument);
 
+    /**
+     * 删除文档信息
+     * @param id
+     * @return
+     */
+    public int deleteDcDocumentById(Long id);
 
 
 //    /**

+ 30 - 6
gqy-system/src/main/java/com/gqy/document/service/impl/DcDocumentServiceImpl.java

@@ -6,6 +6,7 @@ import java.util.stream.Collectors;
 import com.alibaba.fastjson2.JSONArray;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
+import com.gqy.common.constant.Constants;
 import com.gqy.common.core.domain.AjaxResult;
 import com.gqy.common.core.domain.AjaxResultCQY;
 import com.gqy.common.core.text.Convert;
@@ -22,6 +23,7 @@ import com.gqy.document.mapper.ProductDocumentMapper;
 import com.gqy.document.mapper.ProjectDocumentMapper;
 import com.gqy.document.service.IDocumentService;
 import org.apache.commons.collections4.CollectionUtils;
+import org.apache.poi.ss.usermodel.IconMultiStateFormatting;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -49,7 +51,7 @@ public class DcDocumentServiceImpl implements IDocumentService
     private DocumentMapper documentMapper;
 
     /**
-     *
+     * 查询
      * @param page
      * @param pageSize
      * @param dcDocument
@@ -69,22 +71,44 @@ public class DcDocumentServiceImpl implements IDocumentService
     }
 
 
-    @Override
+
     public List<DcDocument> selectDcDocumentList(DcDocument dcDocument) {
         return documentMapper.selectDcDocumentList(dcDocument);
     }
 
-    @Override
+    /**
+     * 插入
+     * @param dcDocument
+     * @return
+     */
     public int insertDcDocument(DcDocument dcDocument) {
-        return 0;
+        dcDocument.setDcm_status(Constants.status_5);
+        return documentMapper.insertDcDocument(dcDocument);
     }
 
-    @Override
+    /**
+     * 更新
+     * @param dcDocument
+     * @return
+     */
     public int updateDcDocument(DcDocument dcDocument) {
-        return 0;
+        return documentMapper.updateDcDocument(dcDocument);
+    }
+
+
+    /**
+     * 删除
+     * @param id
+     * @return
+     */
+    public int deleteDcDocumentById(Long id){
+        DcDocument dcDocument = documentMapper.selectDcDocumentByDcmId(id);
+        dcDocument.setDcm_status(Constants.status_4);
+        return documentMapper.updateDcDocument(dcDocument);
     }
 
 
+
 //    @Autowired
 //    private DocumentMapper documentMapper;
 //

+ 38 - 291
gqy-system/src/main/resources/mapper/document/DcDocumentMapper.xml

@@ -4,15 +4,14 @@
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.gqy.document.mapper.DocumentMapper">
 
-
     <resultMap type="DcDocument" id="DcDocumentResult">
-        <id     property="dcmId"       column="dcm_id"      />
-        <result property="dcmStatus"   column="dcm_status"  />
-        <result property="dcmTitle"    column="dcm_title"   />
-        <result property="dcmOwner"    column="dcm_owner"   />
-        <result property="dcmType"     column="dcm_type"    />
-        <result property="dcmXbj"      column="dcm_xbj"     />
-        <result property="dcmData"     column="dcm_data"    />
+        <id     property="dcm_id"       column="dcm_id"      />
+        <result property="dcm_status"   column="dcm_status"  />
+        <result property="dcm_title"    column="dcm_title"   />
+        <result property="dcm_owner"    column="dcm_owner"   />
+        <result property="dcm_type"     column="dcm_type"    />
+        <result property="dcm_xbj"      column="dcm_xbj"     />
+        <result property="dcm_data"     column="dcm_data"    />
     </resultMap>
 
     <sql id="selectDcDocumentVo">
@@ -23,314 +22,62 @@
     <select id="selectDcDocumentList" parameterType="DcDocument" resultMap="DcDocumentResult">
         <include refid="selectDcDocumentVo"/>
         <where>
-            <if test="dcmStatus != null "> and dcm_status = #{dcmStatus}</if>
-            <if test="dcmTitle != null  and dcmTitle != ''"> and dcm_title like concat('%', #{dcmTitle}, '%')</if>
-            <if test="dcmOwner != null "> and dcm_owner = #{dcmOwner}</if>
-            <if test="dcmType != null "> and dcm_type = #{dcmType}</if>
-            <if test="dcmXbj != null "> and dcm_xbj = #{dcmXbj}</if>
+            <if test="dcm_status != null "> and dcm_status = #{dcm_status}</if>
+            <if test="dcm_title != null  and dcm_title != ''"> and dcm_title like concat('%', #{dcm_title}, '%')</if>
+            <if test="dcm_owner != null "> and dcm_owner = #{dcm_owner}</if>
+            <if test="dcm_type != null "> and dcm_type = #{dcm_type}</if>
+            <if test="dcm_xbj != null "> and dcm_xbj = #{dcm_xbj}</if>
         </where>
+        and dcm_status in (5,6)
+        order by dcm_id desc,dcm_status asc
     </select>
 
     <select id="selectDcDocumentByDcmId" parameterType="Long" resultMap="DcDocumentResult">
         <include refid="selectDcDocumentVo"/>
-        where dcm_id = #{dcmId}
+        where dcm_id = #{dcm_id}
     </select>
 
-    <insert id="insertDcDocument" parameterType="DcDocument" useGeneratedKeys="true" keyProperty="dcmId">
+    <insert id="insertDcDocument" parameterType="DcDocument" useGeneratedKeys="true" keyProperty="dcm_id">
         insert into dc_document
         <trim prefix="(" suffix=")" suffixOverrides=",">
-            dcm_status,
-            <if test="dcmTitle != null">dcm_title,</if>
-            <if test="dcmOwner != null">dcm_owner,</if>
-            <if test="dcmType != null">dcm_type,</if>
-            <if test="dcmXbj != null">dcm_xbj,</if>
-            <if test="dcmData != null">dcm_data,</if>
+            <if test="dcm_status != null">dcm_status,</if>
+            <if test="dcm_title != null">dcm_title,</if>
+            <if test="dcm_owner != null">dcm_owner,</if>
+            <if test="dcm_type != null">dcm_type,</if>
+            <if test="dcm_xbj != null">dcm_xbj,</if>
+            <if test="dcm_data != null">dcm_data,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
-            #{dcmStatus},
-            <if test="dcmTitle != null">#{dcmTitle},</if>
-            <if test="dcmOwner != null">#{dcmOwner},</if>
-            <if test="dcmType != null">#{dcmType},</if>
-            <if test="dcmXbj != null">#{dcmXbj},</if>
-            <if test="dcmData != null">#{dcmData},</if>
+            <if test="dcm_status != null">#{dcm_status},</if>
+            <if test="dcm_title != null">#{dcm_title},</if>
+            <if test="dcm_owner != null">#{dcm_owner},</if>
+            <if test="dcm_type != null">#{dcm_type},</if>
+            <if test="dcm_xbj != null">#{dcm_xbj},</if>
+            <if test="dcm_data != null">#{dcm_data},</if>
          </trim>
     </insert>
 
-
     <update id="updateDcDocument" parameterType="DcDocument">
         update dc_document
         <trim prefix="SET" suffixOverrides=",">
-            <if test="dcmStatus != null">dcm_status = #{dcmStatus},</if>
-            <if test="dcmTitle != null">dcm_title = #{dcmTitle},</if>
-            <if test="dcmOwner != null">dcm_owner = #{dcmOwner},</if>
-            <if test="dcmType != null">dcm_type = #{dcmType},</if>
-            <if test="dcmXbj != null">dcm_xbj = #{dcmXbj},</if>
-            <if test="dcmData != null">dcm_data = #{dcmData},</if>
+            <if test="dcm_status != null">dcm_status = #{dcm_status},</if>
+            <if test="dcm_title != null">dcm_title = #{dcm_title},</if>
+            <if test="dcm_owner != null">dcm_owner = #{dcm_owner},</if>
+            <if test="dcm_type != null">dcm_type = #{dcm_type},</if>
+            <if test="dcm_xbj != null">dcm_xbj = #{dcm_xbj},</if>
+            <if test="dcm_data != null">dcm_data = #{dcm_data},</if>
         </trim>
-        where dcm_id = #{dcmId}
+        where dcm_id = #{dcm_id}
     </update>
 
     <delete id="deleteDcDocumentByDcmId" parameterType="Long">
-        delete from dc_document where dcm_id = #{dcmId}
+        delete from dc_document where dcm_id = #{dcm_id}
     </delete>
 
     <delete id="deleteDcDocumentByDcmIds" parameterType="String">
         delete from dc_document where dcm_id in
-        <foreach item="dcmId" collection="array" open="(" separator="," close=")">
-            #{dcmId}
+        <foreach item="dcm_id" collection="array" open="(" separator="," close=")">
+            #{dcm_id}
         </foreach>
     </delete>
-
-
-
-
-
-<!--    <resultMap type="Document" id="DocumentResult">-->
-<!--        <id     property="id"           column="id"            />-->
-<!--        <result property="title"        column="title"         />-->
-<!--        <result property="data"         column="data"          />-->
-<!--        <result property="user_id"      column="user_id"       />-->
-<!--        <result property="category_id"  column="category_id"   />-->
-<!--        <result property="is_template"  column="is_template"   />-->
-<!--        <result property="status"       column="status"        />-->
-<!--        <result property="create_time"  column="create_time"   />-->
-<!--        <result property="update_time"  column="update_time"   />-->
-<!--        <result property="create_by"    column="create_by"     />-->
-<!--        <result property="update_by"    column="update_by"     />-->
-
-<!--        <result property="type_name"    column="type_name"     />-->
-
-
-<!--    </resultMap>-->
-
-<!--    <insert id="insertDocument" parameterType="Document" useGeneratedKeys="true" keyProperty="id">-->
-<!--        insert into dc_document(-->
-<!--        <if test="title != null and title != ''">title,</if>-->
-<!--        <if test="data != null">data,</if>-->
-<!--        <if test="user_id != null">user_id,</if>-->
-<!--        <if test="category_id != null">category_id,</if>-->
-<!--        <if test="is_template != null">is_template,</if>-->
-<!--        <if test="status != null">status,</if>-->
-<!--        <if test="create_by != null">create_by,</if>-->
-<!--        create_time,-->
-<!--        update_time-->
-<!--        )values(-->
-<!--        <if test="title != null and title != ''">#{title},</if>-->
-<!--        <if test="data != null">#{data},</if>-->
-<!--        <if test="user_id != null">#{user_id},</if>-->
-<!--        <if test="category_id != null">#{category_id},</if>-->
-<!--        <if test="is_template != null">#{is_template},</if>-->
-<!--        <if test="status != null">#{status},</if>-->
-<!--        <if test="create_by != null">#{create_by},</if>-->
-<!--        sysdate(),-->
-<!--        sysdate()-->
-<!--        )-->
-<!--    </insert>-->
-
-<!--    <select id="checkDocumentTitleUnique" resultMap="DocumentResult">-->
-<!--        select id, title, is_template-->
-<!--        from dc_document-->
-<!--        where title = #{title}-->
-<!--          and is_template = #{is_template}-->
-<!--          and status != 4-->
-<!--        limit 1-->
-<!--    </select>-->
-
-
-
-
-<!--    <sql id="selectDocumentVo">-->
-<!--        SELECT d.id, d.title, d.data, d.user_id, d.create_time, d.update_time,-->
-<!--               d.status, d.category_id, d.is_template,-->
-<!--               c.name as type_name, u.user_name-->
-<!--        FROM dc_document d-->
-<!--                 LEFT JOIN dc_document_category c ON d.category_id = c.id-->
-<!--                 LEFT JOIN sys_user u ON d.user_id = u.user_id-->
-<!--    </sql>-->
-
-<!--    <select id="selectDocumentList" parameterType="Document" resultMap="DocumentResult">-->
-<!--        <include refid="selectDocumentVo"/>-->
-<!--        <where>-->
-<!--            AND d.status = 5-->
-<!--            <if test="title != null and title != ''">-->
-<!--                AND d.title like concat('%', #{title}, '%')-->
-<!--            </if>-->
-<!--            <if test="category_id != null">-->
-<!--                AND d.category_id = #{categoryId}-->
-<!--            </if>-->
-<!--            <if test="user_id != null">-->
-<!--                AND d.user_id = #{userId}-->
-<!--            </if>-->
-<!--            <if test="params.isAdmin != null and params.isAdmin == true">-->
-<!--                AND d.is_template = 0-->
-<!--            </if>-->
-<!--            <if test="params.isAdmin != null and params.isAdmin == false">-->
-<!--                AND d.is_template = 0 AND d.user_id = #{params.loginUserId}-->
-<!--            </if>-->
-<!--        </where>-->
-<!--        ORDER BY d.id DESC-->
-<!--    </select>-->
-
-
-
-
-<!--    &lt;!&ndash; 分页查询文档列表 &ndash;&gt;-->
-<!--    <select id="pageDocument" resultType="map" parameterType="Document">-->
-<!--        SELECT-->
-<!--        d.id,-->
-<!--        d.title,-->
-<!--        d.category_id,-->
-<!--        d.user_id,-->
-<!--        DATE_FORMAT(d.create_time, '%Y-%m-%d %H:%i:%s') as create_time,-->
-<!--        d.status,-->
-<!--        d.is_template,-->
-<!--        c.name as type_name,-->
-<!--        u.user_name-->
-<!--        FROM dc_document d-->
-<!--        LEFT JOIN dc_document_category c ON d.category_id = c.id AND c.status = 5-->
-<!--        LEFT JOIN sys_user u ON d.user_id = u.user_id-->
-<!--        <where>-->
-<!--            AND d.status = #{status}-->
-<!--            <if test="title != null and title != ''">-->
-<!--                AND d.title LIKE CONCAT('%', #{title}, '%')-->
-<!--            </if>-->
-<!--            <if test="category_id != null">-->
-<!--                AND d.category_id = #{category_id}-->
-<!--            </if>-->
-<!--            <if test="user_id != null">-->
-<!--                AND d.user_id = #{user_id}-->
-<!--            </if>-->
-<!--&lt;!&ndash;            <if test="current_user_id != null">&ndash;&gt;-->
-<!--&lt;!&ndash;                AND (&ndash;&gt;-->
-<!--&lt;!&ndash;                d.user_id = #{current_user_id}&ndash;&gt;-->
-<!--&lt;!&ndash;                OR (&ndash;&gt;-->
-<!--&lt;!&ndash;                d.is_template = 1&ndash;&gt;-->
-<!--&lt;!&ndash;                AND d.user_id IN (&ndash;&gt;-->
-<!--&lt;!&ndash;                SELECT user_id FROM sys_user&ndash;&gt;-->
-<!--&lt;!&ndash;                WHERE is_admin = 1&ndash;&gt;-->
-<!--&lt;!&ndash;                )&ndash;&gt;-->
-<!--&lt;!&ndash;                )&ndash;&gt;-->
-<!--&lt;!&ndash;                )&ndash;&gt;-->
-<!--&lt;!&ndash;            </if>&ndash;&gt;-->
-<!--        </where>-->
-<!--        ORDER BY d.create_time DESC-->
-<!--    </select>-->
-
-<!--    &lt;!&ndash; ================  info  &ndash;&gt;-->
-<!--    <resultMap type="Document" id="DocumentResultInfo">-->
-<!--        <id     property="id"           column="id"           />-->
-<!--        <result property="title"        column="title"        />-->
-<!--        <result property="data"         column="data"         />-->
-<!--        <result property="user_id"      column="user_id"      />-->
-<!--        <result property="category_id"  column="category_id"  />-->
-<!--        <result property="create_time"  column="create_time"  />-->
-<!--        <result property="update_time"  column="update_time"  />-->
-<!--        <result property="status"       column="status"       />-->
-<!--        <result property="is_template"  column="is_template"  />-->
-<!--        &lt;!&ndash; 非数据库字段 &ndash;&gt;-->
-<!--        <result property="category_name" column="category_name"/>-->
-<!--        <result property="user_name"    column="user_name"    />-->
-<!--    </resultMap>-->
-
-<!--    <sql id="selectDocumentVoInfo">-->
-<!--        SELECT d.id, d.title, d.data, d.user_id, d.category_id,-->
-<!--               d.create_time, d.update_time, d.status, d.is_template,-->
-<!--               c.name as category_name,-->
-<!--               u.user_name as user_name-->
-<!--        FROM dc_document d-->
-<!--                 LEFT JOIN dc_document_category c ON d.category_id = c.id-->
-<!--                 LEFT JOIN sys_user u ON d.user_id = u.user_id-->
-<!--    </sql>-->
-<!--    <select id="info" parameterType="Long" resultMap="DocumentResult">-->
-<!--        <include refid="selectDocumentVoInfo"/>-->
-<!--        <where>-->
-<!--            AND d.id = #{id}-->
-<!--            AND d.status != 4-->
-<!--        </where>-->
-<!--    </select>-->
-<!--    &lt;!&ndash; ================  info  &ndash;&gt;-->
-
-
-<!--    &lt;!&ndash; 获取文档关联的产品ID列表 &ndash;&gt;-->
-<!--    <select id="selectProductDocumentsByDocId" parameterType="Long" resultType="Long">-->
-<!--        select product_id-->
-<!--        from dc_product_document-->
-<!--        where document_id = #{documentId}-->
-<!--          and status != 4-->
-<!--    </select>-->
-
-<!--    &lt;!&ndash; 获取文档关联的项目ID列表 &ndash;&gt;-->
-<!--    <select id="selectProjectDocumentsByDocId" parameterType="Long" resultType="Long">-->
-<!--        select project_id-->
-<!--        from dc_project_document-->
-<!--        where doc_id = #{documentId}-->
-<!--          and status != 4-->
-<!--    </select>-->
-<!--    &lt;!&ndash; 获取文档关联的项目ID列表 &ndash;&gt;-->
-
-<!--    &lt;!&ndash; 查询文档列表 &ndash;&gt;-->
-<!--    <select id="searchList" parameterType="Document" resultMap="DocumentResult">-->
-<!--        SELECT d.id,-->
-<!--        d.title,-->
-<!--        d.category_id,-->
-<!--        d.create_time,-->
-<!--        d.status,-->
-<!--        d.is_template,-->
-<!--        d.user_id,-->
-<!--        dc.name as type_name-->
-<!--        &lt;!&ndash;-->
-<!--         su.user_name,-->
-<!--                ar.is_admin-->
-<!--                &ndash;&gt;-->
-<!--        FROM dc_document d-->
-<!--        LEFT JOIN dc_document_category dc ON d.category_id = dc.id-->
-<!--        <where>-->
-<!--            d.status = 5-->
-<!--            AND d.is_template = 1-->
-<!--&lt;!&ndash;            <choose>&ndash;&gt;-->
-<!--&lt;!&ndash;                <when test="is_admin != null and is_admin == 1">&ndash;&gt;-->
-<!--&lt;!&ndash;                    &lt;!&ndash; 管理员可以看到所有模板 &ndash;&gt;&ndash;&gt;-->
-<!--&lt;!&ndash;                </when>&ndash;&gt;-->
-<!--&lt;!&ndash;                <otherwise>&ndash;&gt;-->
-<!--&lt;!&ndash;                    &lt;!&ndash; 普通用户只能看到自己的和管理员的模板 &ndash;&gt;&ndash;&gt;-->
-<!--&lt;!&ndash;                    AND (&ndash;&gt;-->
-<!--&lt;!&ndash;                    d.user_id = #{user_id}&ndash;&gt;-->
-<!--&lt;!&ndash;                    OR d.user_id IN (&ndash;&gt;-->
-<!--&lt;!&ndash;                    SELECT u.user_id&ndash;&gt;-->
-<!--&lt;!&ndash;                    FROM sys_user u&ndash;&gt;-->
-<!--&lt;!&ndash;                    INNER JOIN sys_admin_role ar ON u.role_id = ar.id&ndash;&gt;-->
-<!--&lt;!&ndash;                    WHERE ar.is_admin = 1&ndash;&gt;-->
-<!--&lt;!&ndash;                    )&ndash;&gt;-->
-<!--&lt;!&ndash;                    )&ndash;&gt;-->
-<!--&lt;!&ndash;                </otherwise>&ndash;&gt;-->
-<!--&lt;!&ndash;            </choose>&ndash;&gt;-->
-<!--            &lt;!&ndash; 按标题模糊查询 &ndash;&gt;-->
-<!--            <if test="title != null and title != ''">-->
-<!--                AND d.title like concat('%', #{title}, '%')-->
-<!--            </if>-->
-<!--            &lt;!&ndash; 按分类查询 &ndash;&gt;-->
-<!--            <if test="category_id != null">-->
-<!--                AND d.category_id = #{category_id}-->
-<!--            </if>-->
-<!--            &lt;!&ndash; 按用户查询 &ndash;&gt;-->
-<!--            <if test="user_id != null">-->
-<!--                AND d.user_id = #{user_id}-->
-<!--            </if>-->
-<!--        </where>-->
-<!--        ORDER BY d.id DESC-->
-<!--    </select>-->
-
-
-<!--    &lt;!&ndash; 更新文档信息 &ndash;&gt;-->
-<!--    <update id="updateDocument" parameterType="Document">-->
-<!--        update dc_document-->
-<!--        <set>-->
-<!--            <if test="title != null">title = #{title},</if>-->
-<!--            <if test="data != null">data = #{data},</if>-->
-<!--            <if test="status != null">status = #{status},</if>-->
-<!--            update_time = sysdate()-->
-<!--        </set>-->
-<!--        where id = #{id}-->
-<!--    </update>-->
-
 </mapper>