فهرست منبع

提交代码(新增参数配置功能)和参数配置

cxd 7 ماه پیش
والد
کامیت
e849bce526
23فایلهای تغییر یافته به همراه669 افزوده شده و 21 حذف شده
  1. 68 0
      gqy-admin/src/main/java/com/gqy/web/controller/document/DcSpecController.java
  2. 17 0
      gqy-admin/src/main/java/com/gqy/web/controller/document/DocumentCategoryController.java
  3. 7 0
      gqy-admin/src/main/java/com/gqy/web/controller/document/ParamsController.java
  4. 38 0
      gqy-admin/src/main/java/com/gqy/web/controller/document/ProjectCategoryController.java
  5. 6 4
      gqy-admin/src/main/resources/application-druid.yml
  6. 3 2
      gqy-admin/src/main/resources/application.yml
  7. 70 0
      gqy-system/src/main/java/com/gqy/document/domain/DcParam.java
  8. 71 0
      gqy-system/src/main/java/com/gqy/document/domain/DcSpec.java
  9. 6 8
      gqy-system/src/main/java/com/gqy/document/domain/DocumentCategory.java
  10. 20 4
      gqy-system/src/main/java/com/gqy/document/domain/ProjectCategory.java
  11. 32 0
      gqy-system/src/main/java/com/gqy/document/mapper/DcSpecMapper.java
  12. 17 0
      gqy-system/src/main/java/com/gqy/document/mapper/DocumentCategoryMapper.java
  13. 17 0
      gqy-system/src/main/java/com/gqy/document/mapper/ProjectCategoryMapper.java
  14. 7 0
      gqy-system/src/main/java/com/gqy/document/service/IDocumentCategoryService.java
  15. 19 0
      gqy-system/src/main/java/com/gqy/document/service/IProjectCategoryService.java
  16. 45 0
      gqy-system/src/main/java/com/gqy/document/service/impl/DcSpecServiceImpl.java
  17. 29 0
      gqy-system/src/main/java/com/gqy/document/service/impl/DocumentCategoryServiceImpl.java
  18. 29 0
      gqy-system/src/main/java/com/gqy/document/service/impl/ProjectCategoryServiceImpl.java
  19. 65 0
      gqy-system/src/main/resources/mapper/document/DcSpecMapper.xml
  20. 24 3
      gqy-system/src/main/resources/mapper/document/DocumentCategoryMapper.xml
  21. 20 0
      gqy-system/src/main/resources/mapper/document/ProjectCategoryMapper.xml
  22. 2 0
      read.txt
  23. 57 0
      创建表语句.txt

+ 68 - 0
gqy-admin/src/main/java/com/gqy/web/controller/document/DcSpecController.java

@@ -0,0 +1,68 @@
+package com.gqy.web.controller.document;
+
+
+import com.gqy.common.core.controller.BaseController;
+import com.gqy.common.core.domain.AjaxResult;
+import com.gqy.common.core.page.TableDataInfo;
+import com.gqy.common.enums.BusinessType;
+import com.gqy.document.domain.DcSpec;
+import com.gqy.document.service.IDcSpecService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 产品规格Controller
+ */
+@RestController
+@RequestMapping("/spec")
+public class DcSpecController  extends BaseController {
+
+    @Autowired
+    private IDcSpecService iDcSpecService;
+
+    /**
+     * 查询产品规格列表
+     */
+    @GetMapping("/list")
+    public TableDataInfo list(DcSpec dcSpec) {
+        startPage();
+        List<DcSpec> list =  null;
+        return getDataTable(list);
+    }
+
+    /**
+     * 获取产品规格详细信息
+     */
+//    @PreAuthorize("@ss.hasPermi('system:spec:query')")
+    @GetMapping(value = "/{psId}")
+    public AjaxResult getInfo(@PathVariable("psId") Integer psId) {
+        return success(iDcSpecService.selectDcSpecById(psId));
+    }
+
+    /**
+     * 新增产品规格
+     */
+//    @PreAuthorize("@ss.hasPermi('system:spec:add')")
+//    @Log(title = "产品规格", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody DcSpec dcSpec) {
+        return toAjax(iDcSpecService.insertDcSpec(dcSpec));
+    }
+
+    /**
+     * 修改产品规格
+     */
+//    @PreAuthorize("@ss.hasPermi('system:spec:edit')")
+//    @Log(title = "产品规格", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody DcSpec dcSpec) {
+        return toAjax(iDcSpecService.updateDcSpec(dcSpec));
+    }
+
+
+
+
+}

+ 17 - 0
gqy-admin/src/main/java/com/gqy/web/controller/document/DocumentCategoryController.java

@@ -4,6 +4,7 @@ package com.gqy.web.controller.document;
  *
  */
 import com.gqy.common.core.controller.BaseController;
+import com.gqy.common.core.domain.AjaxResult;
 import com.gqy.common.core.domain.AjaxResultCQY;
 import com.gqy.document.domain.DocumentCategory;
 import com.gqy.document.domain.vo.PageResult;
@@ -11,6 +12,7 @@ import com.gqy.document.service.IDocumentCategoryService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
@@ -96,4 +98,19 @@ public class DocumentCategoryController extends BaseController {
         return AjaxResultCQY.success("查询成功",documentCategoryService.info(Long.valueOf(id)));
     }
 
+
+    /**
+     * 创建文档分类
+     */
+    @PostMapping("/create")
+    @ResponseBody
+    public AjaxResult create(@RequestBody DocumentCategory documentCategory) {
+        try {
+            return AjaxResult.success(documentCategoryService.create(documentCategory));
+        } catch (Exception e) {
+            return AjaxResult.error(e.getMessage());
+        }
+    }
+
+
 }

+ 7 - 0
gqy-admin/src/main/java/com/gqy/web/controller/document/ParamsController.java

@@ -72,6 +72,13 @@ public class ParamsController {
         return iDcParamsService.create(params);
     }
 
+
+    /**
+     * 获取参数配置详细信息
+     *
+     * @param id 参数ID
+     * @return 结果
+     */
     @PostMapping("/info")
 //    @PreAuthorize("@ss.hasPermi('system:params:query')")
     public AjaxResultCQY info(@RequestBody Map id)

+ 38 - 0
gqy-admin/src/main/java/com/gqy/web/controller/document/ProjectCategoryController.java

@@ -0,0 +1,38 @@
+package com.gqy.web.controller.document;
+
+import com.gqy.common.core.controller.BaseController;
+import com.gqy.common.core.domain.AjaxResult;
+import com.gqy.common.core.domain.AjaxResultCQY;
+import com.gqy.document.domain.ProjectCategory;
+import com.gqy.document.service.IProjectCategoryService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * 项目分类Controller
+ *
+ */
+@RestController
+@RequestMapping("/project/category")
+public class ProjectCategoryController extends BaseController {
+    @Autowired
+    private IProjectCategoryService projectCategoryService;
+
+    /**
+     * 添加项目分类
+     * @param projectCategory
+     * @return
+     */
+    @PostMapping("/add")
+    public AjaxResultCQY add(ProjectCategory projectCategory) {
+        // 调用服务层新增方法
+        if (projectCategoryService.insertProjectCategory(projectCategory) > 0) {
+            return AjaxResultCQY.success();
+        }
+        return AjaxResultCQY.error("新增项目分类失败");
+    }
+
+}

+ 6 - 4
gqy-admin/src/main/resources/application-druid.yml

@@ -6,10 +6,12 @@ spring:
         druid:
             # 主库数据源
             master:
-                url: jdbc:mysql://120.46.190.49:3306/rouyi?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+#                url: jdbc:mysql://120.46.190.49:3306/rouyi?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+
+                url: jdbc:mysql://localhost:3306/rouyi?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
                 username: root
-                #password: root
-                password: Gd8XCWEef72GerxE
+                password: root
+                #password: Gd8XCWEef72GerxE
             # 从库数据源
             slave:
                 # 从数据源开关/默认关闭
@@ -59,4 +61,4 @@ spring:
                     merge-sql: true
                 wall:
                     config:
-                        multi-statement-allow: true
+                        multi-statement-allow: true

+ 3 - 2
gqy-admin/src/main/resources/application.yml

@@ -68,13 +68,14 @@ spring:
   # redis 配置
   redis:
     # 地址
-    host: 120.46.190.49
+    #host: 120.46.190.49
+    host: 127.0.0.1
     # 端口,默认为6379
     port: 6379
     # 数据库索引
     database: 13
     # 密码
-    password: Iayq@742295
+    #password: Iayq@742295
     # 连接超时时间
     timeout: 10s
     lettuce:

+ 70 - 0
gqy-system/src/main/java/com/gqy/document/domain/DcParam.java

@@ -0,0 +1,70 @@
+package com.gqy.document.domain;
+
+import com.gqy.common.annotation.Excel;
+import com.gqy.common.core.domain.BaseEntity;
+
+/**
+ * 产品参数对象 ps_param
+ */
+public class DcParam  extends BaseEntity {
+    /** 参数主键 */
+    private Integer psp_id;
+
+    /** 参数编码 */
+    @Excel(name = "参数编码")
+    private String psp_mode;
+
+    /** 参数名 */
+    @Excel(name = "参数名")
+    private String psp_name;
+
+    /** 参数值 */
+    @Excel(name = "参数值")
+    private String psp_value;
+
+    /** 文档块id */
+    @Excel(name = "文档块id")
+    private Integer psp_dck_id;
+
+    // getter和setter方法
+    public Integer getPsp_id() {
+        return psp_id;
+    }
+
+    public void setPsp_id(Integer psp_id) {
+        this.psp_id = psp_id;
+    }
+
+    public String getPsp_mode() {
+        return psp_mode;
+    }
+
+    public void setPsp_mode(String psp_mode) {
+        this.psp_mode = psp_mode;
+    }
+
+    public String getPsp_name() {
+        return psp_name;
+    }
+
+    public void setPsp_name(String psp_name) {
+        this.psp_name = psp_name;
+    }
+
+    public String getPsp_value() {
+        return psp_value;
+    }
+
+    public void setPsp_value(String psp_value) {
+        this.psp_value = psp_value;
+    }
+
+    public Integer getPsp_dck_id() {
+        return psp_dck_id;
+    }
+
+    public void setPsp_dck_id(Integer psp_dck_id) {
+        this.psp_dck_id = psp_dck_id;
+    }
+
+}

+ 71 - 0
gqy-system/src/main/java/com/gqy/document/domain/DcSpec.java

@@ -0,0 +1,71 @@
+package com.gqy.document.domain;
+
+import com.gqy.common.annotation.Excel;
+import com.gqy.common.core.domain.BaseEntity;
+
+/**
+ * 产品规格对象 dc_spec
+ */
+public class DcSpec extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /** 产品规格主键 */
+    @Excel(name = "产品规格主键")
+    private Integer ps_id;
+
+    /** 产品表主键 */
+    @Excel(name = "产品表主键")
+    private String ps_p_id;
+
+    /** 规格编号 */
+    @Excel(name = "规格编号")
+    private String pa_no;
+
+    /** 规格名 */
+    @Excel(name = "规格名")
+    private String ps_name;
+
+    /** 文档块id */
+    @Excel(name = "文档块id")
+    private Integer ps_dck_id;
+
+    public Integer getPs_id() {
+        return ps_id;
+    }
+
+    public void setPs_id(Integer ps_id) {
+        this.ps_id = ps_id;
+    }
+
+    public String getPs_p_id() {
+        return ps_p_id;
+    }
+
+    public void setPs_p_id(String ps_p_id) {
+        this.ps_p_id = ps_p_id;
+    }
+
+    public String getPa_no() {
+        return pa_no;
+    }
+
+    public void setPa_no(String pa_no) {
+        this.pa_no = pa_no;
+    }
+
+    public String getPs_name() {
+        return ps_name;
+    }
+
+    public void setPs_name(String ps_name) {
+        this.ps_name = ps_name;
+    }
+
+    public Integer getPs_dck_id() {
+        return ps_dck_id;
+    }
+
+    public void setPs_dck_id(Integer ps_dck_id) {
+        this.ps_dck_id = ps_dck_id;
+    }
+}

+ 6 - 8
gqy-system/src/main/java/com/gqy/document/domain/DocumentCategory.java

@@ -5,7 +5,7 @@ import com.gqy.common.core.domain.BaseEntity;
 
 import java.util.Date;
 
-public class DocumentCategory extends BaseEntity {
+public class DocumentCategory  {
 
     private static final long serialVersionUID = 1L;
 
@@ -23,7 +23,7 @@ public class DocumentCategory extends BaseEntity {
 
     /** 创建时间 */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    private Date createTime;
+    private Date create_time;
 
     public Long getId() {
         return id;
@@ -57,13 +57,11 @@ public class DocumentCategory extends BaseEntity {
         this.status = status;
     }
 
-    @Override
-    public Date getCreateTime() {
-        return createTime;
+    public Date getCreate_time() {
+        return create_time;
     }
 
-    @Override
-    public void setCreateTime(Date createTime) {
-        this.createTime = createTime;
+    public void setCreate_time(Date create_time) {
+        this.create_time = create_time;
     }
 }

+ 20 - 4
gqy-system/src/main/java/com/gqy/document/domain/ProjectCategory.java

@@ -2,22 +2,36 @@ package com.gqy.document.domain;
 
 import com.fasterxml.jackson.annotation.JsonFormat;
 
+import javax.validation.constraints.Size;
 import java.util.Date;
 
+/**
+ * 项目分类对象 dc_project_category
+ */
 public class ProjectCategory {
-    private Integer id;
+
+    /** 分类ID */
+    private Long id;
+
+    /** 分类编码 */
+    @Size(min = 0, max = 60, message = "分类编码长度不能超过60个字符")
     private String code;
+
+    /** 分类名称 */
+    @Size(min = 0, max = 255, message = "分类名称长度不能超过255个字符")
     private String name;
 
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    /** 创建时间 */
     private Date create_time;
+
+    /** 状态(5使用中 6已停用 4已删除) */
     private Integer status;
 
-    public Integer getId() {
+    public Long getId() {
         return id;
     }
 
-    public void setId(Integer id) {
+    public void setId(Long id) {
         this.id = id;
     }
 
@@ -52,4 +66,6 @@ public class ProjectCategory {
     public void setStatus(Integer status) {
         this.status = status;
     }
+
+
 }

+ 32 - 0
gqy-system/src/main/java/com/gqy/document/mapper/DcSpecMapper.java

@@ -0,0 +1,32 @@
+package com.gqy.document.mapper;
+
+import com.gqy.document.domain.DcSpec;
+
+import java.util.List;
+
+public interface DcSpecMapper {
+
+    /**
+     * 查询产品规格
+     */
+    public DcSpec selectDcSpecById(Integer psId);
+
+    /**
+     * 查询产品规格列表
+     */
+    public List<DcSpec> selectDcSpecList(DcSpec dcSpec);
+
+    /**
+     * 新增产品规格
+     */
+    public int insertDcSpec(DcSpec dcSpec);
+
+    /**
+     * 修改产品规格
+     */
+    public int updateDcSpec(DcSpec dcSpec);
+
+
+
+
+}

+ 17 - 0
gqy-system/src/main/java/com/gqy/document/mapper/DocumentCategoryMapper.java

@@ -16,6 +16,23 @@ public interface DocumentCategoryMapper {
      */
     List<DocumentCategory> search(DocumentCategory category);
 
+
+
+    /**
+     * 检查名称是否唯一
+     */
+    public DocumentCategory checkNameUnique(String name);
+
+
+    /**
+     * 新增文档分类
+     *
+     * @param documentCategory 文档分类信息
+     * @return 结果
+     */
+    public int insertDocumentCategory(DocumentCategory documentCategory);
+
+
     /**
      * 查询文档分类信息
      *

+ 17 - 0
gqy-system/src/main/java/com/gqy/document/mapper/ProjectCategoryMapper.java

@@ -0,0 +1,17 @@
+package com.gqy.document.mapper;
+
+import com.gqy.document.domain.ProjectCategory;
+
+/**
+ * 项目分类Service接口
+ *
+ */
+public interface ProjectCategoryMapper {
+    /**
+     * 新增项目分类
+     *
+     * @param projectCategory 项目分类信息
+     * @return 结果
+     */
+    public int insertProjectCategory(ProjectCategory projectCategory);
+}

+ 7 - 0
gqy-system/src/main/java/com/gqy/document/service/IDocumentCategoryService.java

@@ -24,4 +24,11 @@ public interface IDocumentCategoryService {
      * @return 结果
      */
     public AjaxResultCQY info(Long id);
+
+
+    /**
+     * 创建文档分类
+     */
+    public AjaxResultCQY create(DocumentCategory documentCategory);
+
 }

+ 19 - 0
gqy-system/src/main/java/com/gqy/document/service/IProjectCategoryService.java

@@ -0,0 +1,19 @@
+package com.gqy.document.service;
+
+
+import com.gqy.document.domain.ProjectCategory;
+
+/**
+ * 项目分类Service接口
+ *
+ * @author ruoyi
+ */
+public interface IProjectCategoryService {
+    /**
+     * 新增项目分类
+     *
+     * @param projectCategory 项目分类信息
+     * @return 结果
+     */
+    public int insertProjectCategory(ProjectCategory projectCategory);
+}

+ 45 - 0
gqy-system/src/main/java/com/gqy/document/service/impl/DcSpecServiceImpl.java

@@ -0,0 +1,45 @@
+package com.gqy.document.service.impl;
+
+import com.gqy.document.domain.DcSpec;
+import com.gqy.document.mapper.DcSpecMapper;
+import com.gqy.document.service.IDcSpecService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 产品规格Service业务层处理
+ */
+@Service
+public class DcSpecServiceImpl implements IDcSpecService {
+
+    @Autowired
+    private DcSpecMapper dcSpecMapper;
+
+
+    /**
+     * 查询产品规格
+     */
+    public DcSpec selectDcSpecById(Integer psId) {
+        return dcSpecMapper.selectDcSpecById(psId);
+    }
+
+
+    /**
+     * 查询产品规格列表
+     */
+    public List<DcSpec> selectDcSpecList(DcSpec dcSpec) {
+        return dcSpecMapper.selectDcSpecList(dcSpec);
+    }
+
+    public int insertDcSpec(DcSpec dcSpec) {
+        return dcSpecMapper.insertDcSpec(dcSpec);
+    }
+
+    public int updateDcSpec(DcSpec dcSpec) {
+        return dcSpecMapper.updateDcSpec(dcSpec);
+    }
+
+
+}

+ 29 - 0
gqy-system/src/main/java/com/gqy/document/service/impl/DocumentCategoryServiceImpl.java

@@ -3,6 +3,7 @@ package com.gqy.document.service.impl;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.gqy.common.core.domain.AjaxResultCQY;
+import com.gqy.common.exception.ServiceException;
 import com.gqy.document.domain.DocumentCategory;
 import com.gqy.document.domain.vo.PageResult;
 import com.gqy.document.mapper.DocumentCategoryMapper;
@@ -12,6 +13,7 @@ import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.Date;
 import java.util.List;
 
 
@@ -64,4 +66,31 @@ public class DocumentCategoryServiceImpl implements IDocumentCategoryService {
     public AjaxResultCQY info(Long id) {
         return AjaxResultCQY.success("查询成功",documentCategoryMapper.selectDocumentCategoryById(id));
     }
+
+    /**
+     * 创建文档分类
+     */
+    public AjaxResultCQY create(DocumentCategory documentCategory) {
+
+        try{
+            // 校验名称唯一性
+            if (documentCategoryMapper.checkNameUnique(documentCategory.getName()) != null) {
+                throw new ServiceException("名称已存在");
+            }
+
+            // 设置创建时间
+            documentCategory.setCreate_time(new Date());
+            // 设置状态为使用中(5)
+            documentCategory.setStatus(5);
+
+            documentCategoryMapper.insertDocumentCategory(documentCategory);
+
+        }catch (Exception e){
+            return AjaxResultCQY.error("添加失败");
+        }
+
+        return AjaxResultCQY.success("添加成功");
+    }
+
+
 }

+ 29 - 0
gqy-system/src/main/java/com/gqy/document/service/impl/ProjectCategoryServiceImpl.java

@@ -0,0 +1,29 @@
+package com.gqy.document.service.impl;
+
+import com.gqy.document.domain.ProjectCategory;
+import com.gqy.document.mapper.ProjectCategoryMapper;
+import com.gqy.document.service.IProjectCategoryService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * 项目分类Service业务层处理
+ *
+ */
+@Service
+public class ProjectCategoryServiceImpl implements IProjectCategoryService {
+
+    @Autowired
+    private ProjectCategoryMapper projectCategoryMapper;
+
+    /**
+     * 新增项目分类
+     *
+     * @param projectCategory 项目分类信息
+     * @return 结果
+     */
+    public int insertProjectCategory(ProjectCategory projectCategory) {
+        projectCategory.setStatus(5);
+        return projectCategoryMapper.insertProjectCategory(projectCategory);
+    }
+}

+ 65 - 0
gqy-system/src/main/resources/mapper/document/DcSpecMapper.xml

@@ -0,0 +1,65 @@
+<?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.gqy.document.mapper.DcSpecMapper">
+
+    <resultMap type="DcSpec" id="DcSpecResult">
+        <result property="ps_id"     column="ps_id"     />
+        <result property="ps_p_id"   column="ps_p_id"   />
+        <result property="pa_no"     column="pa_no"     />
+        <result property="ps_name"   column="ps_name"   />
+        <result property="ps_dck_id" column="ps_dck_id" />
+    </resultMap>
+
+    <sql id="selectDcSpecVo">
+        select ps_id, ps_p_id, pa_no, ps_name, ps_dck_id from dc_spec
+    </sql>
+
+    <select id="selectDcSpecList" parameterType="DcSpec" resultMap="DcSpecResult">
+        <include refid="selectDcSpecVo"/>
+        <where>
+            <if test="ps_p_id != null  and ps_p_id != ''"> and ps_p_id = #{ps_p_id}</if>
+            <if test="pa_no != null  and pa_no != ''"> and pa_no = #{pa_no}</if>
+            <if test="ps_name != null  and ps_name != ''"> and ps_name like concat('%', #{ps_name}, '%')</if>
+            <if test="ps_dck_id != null "> and ps_dck_id = #{ps_dck_id}</if>
+        </where>
+    </select>
+
+    <!-- 其他SQL语句的参数名也需要相应修改 -->
+
+
+    <insert id="insertDcSpec" parameterType="DcSpec" useGeneratedKeys="true" keyProperty="ps_id">
+        insert into dc_spec
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="ps_p_id != null and ps_p_id != ''">ps_p_id,</if>
+            <if test="pa_no != null and pa_no != ''">pa_no,</if>
+            <if test="ps_name != null and ps_name != ''">ps_name,</if>
+            <if test="ps_dck_id != null">ps_dck_id,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="ps_p_id != null and ps_p_id != ''">#{ps_p_id},</if>
+            <if test="pa_no != null and pa_no != ''">#{pa_no},</if>
+            <if test="ps_name != null and ps_name != ''">#{ps_name},</if>
+            <if test="ps_dck_id != null">#{ps_dck_id},</if>
+        </trim>
+    </insert>
+
+
+    <update id="updateDcSpec" parameterType="DcSpec">
+        update dc_spec
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="ps_p_id != null">ps_p_id = #{ps_p_id},</if>
+            <if test="pa_no != null">pa_no = #{pa_no},</if>
+            <if test="ps_name != null">ps_name = #{ps_name},</if>
+            <if test="ps_dck_id != null">ps_dck_id = #{ps_dck_id},</if>
+        </trim>
+        where ps_id = #{ps_id}
+    </update>
+
+
+    <select id="selectDcSpecById" parameterType="Integer" resultMap="DcSpecResult">
+        <include refid="selectDcSpecVo"/>
+        where ps_id = #{ps_id}
+    </select>
+
+
+</mapper>

+ 24 - 3
gqy-system/src/main/resources/mapper/document/DocumentCategoryMapper.xml

@@ -5,9 +5,6 @@
 <mapper namespace="com.gqy.document.mapper.DocumentCategoryMapper">
 
 
-
-
-
     <!-- 搜索文档分类列表 -->
     <select id="search" resultType="DocumentCategory">
         <!-- 查询字段 -->
@@ -41,4 +38,28 @@
     </select>
 
 
+    <!-- 新增文档分类 -->
+    <insert id="insertDocumentCategory" parameterType="DocumentCategory" useGeneratedKeys="true" keyProperty="id">
+        insert into dc_document_category (
+        name,
+        <if test="intro != null and intro != ''">intro,</if>
+        create_time,
+        status
+        ) values (
+        #{name},
+        <if test="intro != null and intro != ''">#{intro},</if>
+        #{create_time},
+        #{status}
+        )
+    </insert>
+
+    <!-- 校验名称是否唯一 -->
+    <select id="checkNameUnique" parameterType="String" resultType="DocumentCategory">
+        select id, name from dc_document_category
+        where name = #{name} and status != 4 limit 1
+    </select>
+
+
+
+
 </mapper>

+ 20 - 0
gqy-system/src/main/resources/mapper/document/ProjectCategoryMapper.xml

@@ -0,0 +1,20 @@
+<?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.gqy.document.mapper.ProjectCategoryMapper">
+
+    <!-- 新增项目分类 -->
+    <insert id="insertProjectCategory" parameterType="ProjectCategory" useGeneratedKeys="true" keyProperty="id">
+        insert into dc_project_category(
+        <if test="code != null and code != ''">code,</if>
+        <if test="name != null and name != ''">name,</if>
+        <if test="status != null">status,</if>
+        create_time
+        )values(
+        <if test="code != null and code != ''">#{code},</if>
+        <if test="name != null and name != ''">#{name},</if>
+        <if test="status != null">#{status},</if>
+        sysdate()
+        )
+    </insert>
+
+</mapper>

+ 2 - 0
read.txt

@@ -0,0 +1,2 @@
+sudo apt-get update
+sudo apt-get install pandoc

+ 57 - 0
创建表语句.txt

@@ -271,3 +271,60 @@ CREATE TABLE `dc_params` (
   `status` smallint NOT NULL COMMENT '状态(5-使用中 6-已停用 4-已删除)',
   PRIMARY KEY (`id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='参数配置表';
+
+
+
+CREATE TABLE dc_document (
+    id BIGINT PRIMARY KEY AUTO_INCREMENT, -- 文档的主键,自增
+    title VARCHAR(255) NOT NULL,          -- 文档标题,不能为空
+    data TEXT,                            -- 文档内容
+    user_id BIGINT,                       -- 外键,引用拥有该文档的用户
+    category_id BIGINT,                   -- 外键,引用文档的分类
+    is_template INT,                      -- 是否为模板(0 = 否,1 = 是)
+    status INT,                           -- 文档状态(例如:5 = 使用中,6 = 已停用,4 = 已删除)
+    create_time DATETIME,                 -- 文档创建的时间戳
+    update_time DATETIME,                 -- 文档最后更新的时间戳
+    create_by VARCHAR(255),               -- 创建文档的用户名称
+    update_by VARCHAR(255)                -- 最后更新文档的用户名称
+);
+
+
+CREATE TABLE dc_document_category (
+    id BIGINT PRIMARY KEY AUTO_INCREMENT, -- 主键ID,自增
+    name VARCHAR(255) NOT NULL,           -- 分类名称,不能为空
+    intro TEXT,                           -- 分类介绍
+    status INT,                           -- 状态(5 = 使用中,4 = 已删除,6 = 已停用)
+    create_time DATETIME                  -- 创建时间
+);
+
+
+
+drop table dc_template;
+
+CREATE TABLE dc_template (
+    id BIGINT PRIMARY KEY AUTO_INCREMENT, -- 主键ID,自增
+    code VARCHAR(255),                    -- 模板编码
+    name VARCHAR(255) NOT NULL,           -- 模板名称,不能为空
+    intro TEXT,                           -- 模板介绍
+    lay_id VARCHAR(255),                  -- 图层ID
+    type VARCHAR(255),                    -- 类型
+    content TEXT,                         -- 模板内容
+    attrs TEXT,                           -- 属性
+    category_id INT,                      -- 分类ID
+    admin_id INT,                         -- 管理员ID
+    user_id BIGINT,                       -- 用户ID
+    create_time DATETIME,                 -- 创建时间
+    status INT                            -- 状态(5 = 使用中,6 = 已停用,4 = 已删除)
+    -- 非数据库字段如 type_name 和 category 不包括在内
+);
+
+drop table ps_param;
+
+CREATE TABLE `dc_param` (
+  `psp_id` int NOT NULL AUTO_INCREMENT COMMENT '参数主键',
+  `psp_mode` varchar(50) NOT NULL COMMENT '参数编码',
+  `psp_name` varchar(100) NOT NULL COMMENT '参数名',
+  `psp_value` varchar(255) DEFAULT NULL COMMENT '参数值',
+  `psp_dck_id` int DEFAULT NULL COMMENT '文档块id',
+  PRIMARY KEY (`psp_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='产品参数表';