From 105e82423677aab77581bab457f094db3fb308a1 Mon Sep 17 00:00:00 2001 From: Jade Date: Wed, 12 May 2021 13:44:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E6=A1=A3=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sql/20210512-yuan.sql | 19 + .../controller/doc/DocumentController.java | 32 ++ .../doc/DocumentDraftController.java | 70 +++ .../joylink/rtss/dao/DocuDocumentDAO.java | 14 + .../rtss/dao/DocuDocumentDraftDAO.java | 14 + .../joylink/rtss/entity/DocuDocument.java | 36 ++ .../rtss/entity/DocuDocumentDraft.java | 36 ++ .../rtss/entity/DocuDocumentDraftExample.java | 473 ++++++++++++++++++ .../rtss/entity/DocuDocumentExample.java | 473 ++++++++++++++++++ .../services/doc/DocumentDraftService.java | 57 +++ .../doc/DocumentDraftServiceImpl.java | 84 ++++ .../rtss/services/doc/DocumentService.java | 29 ++ .../services/doc/DocumentServiceImpl.java | 56 +++ .../club/joylink/rtss/vo/doc/DocumentVO.java | 39 ++ .../mybatis/mapper/DocuDocumentDAO.xml | 261 ++++++++++ .../mybatis/mapper/DocuDocumentDraftDAO.xml | 261 ++++++++++ 16 files changed, 1954 insertions(+) create mode 100644 sql/20210512-yuan.sql create mode 100644 src/main/java/club/joylink/rtss/controller/doc/DocumentController.java create mode 100644 src/main/java/club/joylink/rtss/controller/doc/DocumentDraftController.java create mode 100644 src/main/java/club/joylink/rtss/dao/DocuDocumentDAO.java create mode 100644 src/main/java/club/joylink/rtss/dao/DocuDocumentDraftDAO.java create mode 100644 src/main/java/club/joylink/rtss/entity/DocuDocument.java create mode 100644 src/main/java/club/joylink/rtss/entity/DocuDocumentDraft.java create mode 100644 src/main/java/club/joylink/rtss/entity/DocuDocumentDraftExample.java create mode 100644 src/main/java/club/joylink/rtss/entity/DocuDocumentExample.java create mode 100644 src/main/java/club/joylink/rtss/services/doc/DocumentDraftService.java create mode 100644 src/main/java/club/joylink/rtss/services/doc/DocumentDraftServiceImpl.java create mode 100644 src/main/java/club/joylink/rtss/services/doc/DocumentService.java create mode 100644 src/main/java/club/joylink/rtss/services/doc/DocumentServiceImpl.java create mode 100644 src/main/java/club/joylink/rtss/vo/doc/DocumentVO.java create mode 100644 src/main/resources/mybatis/mapper/DocuDocumentDAO.xml create mode 100644 src/main/resources/mybatis/mapper/DocuDocumentDraftDAO.xml diff --git a/sql/20210512-yuan.sql b/sql/20210512-yuan.sql new file mode 100644 index 000000000..7b57dbc66 --- /dev/null +++ b/sql/20210512-yuan.sql @@ -0,0 +1,19 @@ + +CREATE TABLE `docu_document_draft` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `title` varchar(50) NOT NULL COMMENT '标题', + `content` longtext NOT NULL COMMENT '内容', + `create_user_id` bigint NOT NULL COMMENT '创建用户', + `create_time` datetime NOT NULL COMMENT '创建时间', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `docu_document` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `title` varchar(50) NOT NULL COMMENT '标题', + `content` longtext NOT NULL COMMENT '内容', + `publish_user_id` bigint NOT NULL COMMENT '发布用户', + `publish_time` datetime NOT NULL COMMENT '发布时间', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + diff --git a/src/main/java/club/joylink/rtss/controller/doc/DocumentController.java b/src/main/java/club/joylink/rtss/controller/doc/DocumentController.java new file mode 100644 index 000000000..ce20990e7 --- /dev/null +++ b/src/main/java/club/joylink/rtss/controller/doc/DocumentController.java @@ -0,0 +1,32 @@ +package club.joylink.rtss.controller.doc; + +import club.joylink.rtss.services.doc.DocumentService; +import club.joylink.rtss.vo.doc.DocumentVO; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +@RestController +@RequestMapping(path = "/api/doc") +public class DocumentController { + + @Autowired + private DocumentService documentService; + + @ApiOperation(value = "查询文档列表") + @GetMapping(path = "") + public List listDocuments() { + return documentService.listDocuments(); + } + + @ApiOperation(value = "获取文档详情") + @GetMapping(path = "/{id}") + public DocumentVO getDetail(@PathVariable Long id) { + return documentService.getDetail(id); + } +} diff --git a/src/main/java/club/joylink/rtss/controller/doc/DocumentDraftController.java b/src/main/java/club/joylink/rtss/controller/doc/DocumentDraftController.java new file mode 100644 index 000000000..559d3ee41 --- /dev/null +++ b/src/main/java/club/joylink/rtss/controller/doc/DocumentDraftController.java @@ -0,0 +1,70 @@ +package club.joylink.rtss.controller.doc; + +import club.joylink.rtss.services.doc.DocumentDraftService; +import club.joylink.rtss.vo.UserVO; +import club.joylink.rtss.vo.doc.DocumentVO; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestAttribute; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import springfox.documentation.annotations.ApiIgnore; + +import java.util.List; + +@RestController +@RequestMapping(path = "/api/doc/draft") +public class DocumentDraftController { + + @Autowired + private DocumentDraftService documentDraftService; + + @ApiOperation(value = "查询草稿文档列表") + @GetMapping(path = "") + public List listMyDocuments(@ApiIgnore @RequestAttribute UserVO user) { + return documentDraftService.listMyDocuments(user); + } + + @ApiOperation(value = "创建新的草稿文档") + @PostMapping(path = "") + public void create(@RequestBody @Validated DocumentVO documentVO, @ApiIgnore @RequestAttribute UserVO user) { + documentDraftService.create(documentVO, user); + } + + @ApiOperation(value = "更新标题") + @PutMapping(path = "/{id}") + public void updateTitle(@PathVariable Long id, @RequestBody @Validated DocumentVO documentVO) { + documentDraftService.updateTitle(id, documentVO); + } + + @ApiOperation(value = "获取文档详情") + @GetMapping(path = "/{id}") + public DocumentVO getDetail(@PathVariable Long id) { + return documentDraftService.getDetail(id); + } + + @ApiOperation(value = "保存数据") + @PutMapping(path = "/{id}/data") + public void save(@PathVariable Long id, @RequestBody DocumentVO documentVO) { + documentDraftService.save(id, documentVO.getContent()); + } + + @ApiOperation(value = "发布文档") + @PutMapping(path = "/{id}/publish") + public void publish(@PathVariable Long id, @ApiIgnore @RequestAttribute UserVO user) { + documentDraftService.publish(id, user); + } + + @ApiOperation(value = "删除文档") + @DeleteMapping(path = "/{id}") + public void delete(@PathVariable Long id) { + documentDraftService.delete(id); + } +} diff --git a/src/main/java/club/joylink/rtss/dao/DocuDocumentDAO.java b/src/main/java/club/joylink/rtss/dao/DocuDocumentDAO.java new file mode 100644 index 000000000..5096c7e19 --- /dev/null +++ b/src/main/java/club/joylink/rtss/dao/DocuDocumentDAO.java @@ -0,0 +1,14 @@ +package club.joylink.rtss.dao; + +import club.joylink.rtss.entity.DocuDocument; +import club.joylink.rtss.entity.DocuDocumentExample; +import org.apache.ibatis.annotations.Mapper; +import org.springframework.stereotype.Repository; + +/** + * DocuDocumentDAO继承基类 + */ +@Mapper +@Repository +public interface DocuDocumentDAO extends MyBatisBaseDao { +} \ No newline at end of file diff --git a/src/main/java/club/joylink/rtss/dao/DocuDocumentDraftDAO.java b/src/main/java/club/joylink/rtss/dao/DocuDocumentDraftDAO.java new file mode 100644 index 000000000..90ba16d97 --- /dev/null +++ b/src/main/java/club/joylink/rtss/dao/DocuDocumentDraftDAO.java @@ -0,0 +1,14 @@ +package club.joylink.rtss.dao; + +import club.joylink.rtss.entity.DocuDocumentDraft; +import club.joylink.rtss.entity.DocuDocumentDraftExample; +import org.apache.ibatis.annotations.Mapper; +import org.springframework.stereotype.Repository; + +/** + * DocuDocumentDraftDAO继承基类 + */ +@Mapper +@Repository +public interface DocuDocumentDraftDAO extends MyBatisBaseDao { +} \ No newline at end of file diff --git a/src/main/java/club/joylink/rtss/entity/DocuDocument.java b/src/main/java/club/joylink/rtss/entity/DocuDocument.java new file mode 100644 index 000000000..fe9163c1d --- /dev/null +++ b/src/main/java/club/joylink/rtss/entity/DocuDocument.java @@ -0,0 +1,36 @@ +package club.joylink.rtss.entity; + +import java.io.Serializable; +import java.time.LocalDateTime; +import lombok.Data; + +/** + * @author + * + */ +@Data +public class DocuDocument implements Serializable { + private Long id; + + /** + * 标题 + */ + private String title; + + /** + * 发布用户 + */ + private Long publishUserId; + + /** + * 发布时间 + */ + private LocalDateTime publishTime; + + /** + * 内容 + */ + private String content; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/src/main/java/club/joylink/rtss/entity/DocuDocumentDraft.java b/src/main/java/club/joylink/rtss/entity/DocuDocumentDraft.java new file mode 100644 index 000000000..0480c60d0 --- /dev/null +++ b/src/main/java/club/joylink/rtss/entity/DocuDocumentDraft.java @@ -0,0 +1,36 @@ +package club.joylink.rtss.entity; + +import java.io.Serializable; +import java.time.LocalDateTime; +import lombok.Data; + +/** + * @author + * + */ +@Data +public class DocuDocumentDraft implements Serializable { + private Long id; + + /** + * 标题 + */ + private String title; + + /** + * 创建用户 + */ + private Long createUserId; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 内容 + */ + private String content; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/src/main/java/club/joylink/rtss/entity/DocuDocumentDraftExample.java b/src/main/java/club/joylink/rtss/entity/DocuDocumentDraftExample.java new file mode 100644 index 000000000..5e4368a3d --- /dev/null +++ b/src/main/java/club/joylink/rtss/entity/DocuDocumentDraftExample.java @@ -0,0 +1,473 @@ +package club.joylink.rtss.entity; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; + +public class DocuDocumentDraftExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public DocuDocumentDraftExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + public void setLimit(Integer limit) { + this.limit = limit; + } + + public Integer getLimit() { + return limit; + } + + public void setOffset(Long offset) { + this.offset = offset; + } + + public Long getOffset() { + return offset; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andTitleIsNull() { + addCriterion("title is null"); + return (Criteria) this; + } + + public Criteria andTitleIsNotNull() { + addCriterion("title is not null"); + return (Criteria) this; + } + + public Criteria andTitleEqualTo(String value) { + addCriterion("title =", value, "title"); + return (Criteria) this; + } + + public Criteria andTitleNotEqualTo(String value) { + addCriterion("title <>", value, "title"); + return (Criteria) this; + } + + public Criteria andTitleGreaterThan(String value) { + addCriterion("title >", value, "title"); + return (Criteria) this; + } + + public Criteria andTitleGreaterThanOrEqualTo(String value) { + addCriterion("title >=", value, "title"); + return (Criteria) this; + } + + public Criteria andTitleLessThan(String value) { + addCriterion("title <", value, "title"); + return (Criteria) this; + } + + public Criteria andTitleLessThanOrEqualTo(String value) { + addCriterion("title <=", value, "title"); + return (Criteria) this; + } + + public Criteria andTitleLike(String value) { + addCriterion("title like", value, "title"); + return (Criteria) this; + } + + public Criteria andTitleNotLike(String value) { + addCriterion("title not like", value, "title"); + return (Criteria) this; + } + + public Criteria andTitleIn(List values) { + addCriterion("title in", values, "title"); + return (Criteria) this; + } + + public Criteria andTitleNotIn(List values) { + addCriterion("title not in", values, "title"); + return (Criteria) this; + } + + public Criteria andTitleBetween(String value1, String value2) { + addCriterion("title between", value1, value2, "title"); + return (Criteria) this; + } + + public Criteria andTitleNotBetween(String value1, String value2) { + addCriterion("title not between", value1, value2, "title"); + return (Criteria) this; + } + + public Criteria andCreateUserIdIsNull() { + addCriterion("create_user_id is null"); + return (Criteria) this; + } + + public Criteria andCreateUserIdIsNotNull() { + addCriterion("create_user_id is not null"); + return (Criteria) this; + } + + public Criteria andCreateUserIdEqualTo(Long value) { + addCriterion("create_user_id =", value, "createUserId"); + return (Criteria) this; + } + + public Criteria andCreateUserIdNotEqualTo(Long value) { + addCriterion("create_user_id <>", value, "createUserId"); + return (Criteria) this; + } + + public Criteria andCreateUserIdGreaterThan(Long value) { + addCriterion("create_user_id >", value, "createUserId"); + return (Criteria) this; + } + + public Criteria andCreateUserIdGreaterThanOrEqualTo(Long value) { + addCriterion("create_user_id >=", value, "createUserId"); + return (Criteria) this; + } + + public Criteria andCreateUserIdLessThan(Long value) { + addCriterion("create_user_id <", value, "createUserId"); + return (Criteria) this; + } + + public Criteria andCreateUserIdLessThanOrEqualTo(Long value) { + addCriterion("create_user_id <=", value, "createUserId"); + return (Criteria) this; + } + + public Criteria andCreateUserIdIn(List values) { + addCriterion("create_user_id in", values, "createUserId"); + return (Criteria) this; + } + + public Criteria andCreateUserIdNotIn(List values) { + addCriterion("create_user_id not in", values, "createUserId"); + return (Criteria) this; + } + + public Criteria andCreateUserIdBetween(Long value1, Long value2) { + addCriterion("create_user_id between", value1, value2, "createUserId"); + return (Criteria) this; + } + + public Criteria andCreateUserIdNotBetween(Long value1, Long value2) { + addCriterion("create_user_id not between", value1, value2, "createUserId"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(LocalDateTime value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(LocalDateTime value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(LocalDateTime value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(LocalDateTime value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(LocalDateTime value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(LocalDateTime value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(LocalDateTime value1, LocalDateTime value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(LocalDateTime value1, LocalDateTime value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + } + + /** + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/src/main/java/club/joylink/rtss/entity/DocuDocumentExample.java b/src/main/java/club/joylink/rtss/entity/DocuDocumentExample.java new file mode 100644 index 000000000..076013e2c --- /dev/null +++ b/src/main/java/club/joylink/rtss/entity/DocuDocumentExample.java @@ -0,0 +1,473 @@ +package club.joylink.rtss.entity; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; + +public class DocuDocumentExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public DocuDocumentExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + public void setLimit(Integer limit) { + this.limit = limit; + } + + public Integer getLimit() { + return limit; + } + + public void setOffset(Long offset) { + this.offset = offset; + } + + public Long getOffset() { + return offset; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andTitleIsNull() { + addCriterion("title is null"); + return (Criteria) this; + } + + public Criteria andTitleIsNotNull() { + addCriterion("title is not null"); + return (Criteria) this; + } + + public Criteria andTitleEqualTo(String value) { + addCriterion("title =", value, "title"); + return (Criteria) this; + } + + public Criteria andTitleNotEqualTo(String value) { + addCriterion("title <>", value, "title"); + return (Criteria) this; + } + + public Criteria andTitleGreaterThan(String value) { + addCriterion("title >", value, "title"); + return (Criteria) this; + } + + public Criteria andTitleGreaterThanOrEqualTo(String value) { + addCriterion("title >=", value, "title"); + return (Criteria) this; + } + + public Criteria andTitleLessThan(String value) { + addCriterion("title <", value, "title"); + return (Criteria) this; + } + + public Criteria andTitleLessThanOrEqualTo(String value) { + addCriterion("title <=", value, "title"); + return (Criteria) this; + } + + public Criteria andTitleLike(String value) { + addCriterion("title like", value, "title"); + return (Criteria) this; + } + + public Criteria andTitleNotLike(String value) { + addCriterion("title not like", value, "title"); + return (Criteria) this; + } + + public Criteria andTitleIn(List values) { + addCriterion("title in", values, "title"); + return (Criteria) this; + } + + public Criteria andTitleNotIn(List values) { + addCriterion("title not in", values, "title"); + return (Criteria) this; + } + + public Criteria andTitleBetween(String value1, String value2) { + addCriterion("title between", value1, value2, "title"); + return (Criteria) this; + } + + public Criteria andTitleNotBetween(String value1, String value2) { + addCriterion("title not between", value1, value2, "title"); + return (Criteria) this; + } + + public Criteria andPublishUserIdIsNull() { + addCriterion("publish_user_id is null"); + return (Criteria) this; + } + + public Criteria andPublishUserIdIsNotNull() { + addCriterion("publish_user_id is not null"); + return (Criteria) this; + } + + public Criteria andPublishUserIdEqualTo(Long value) { + addCriterion("publish_user_id =", value, "publishUserId"); + return (Criteria) this; + } + + public Criteria andPublishUserIdNotEqualTo(Long value) { + addCriterion("publish_user_id <>", value, "publishUserId"); + return (Criteria) this; + } + + public Criteria andPublishUserIdGreaterThan(Long value) { + addCriterion("publish_user_id >", value, "publishUserId"); + return (Criteria) this; + } + + public Criteria andPublishUserIdGreaterThanOrEqualTo(Long value) { + addCriterion("publish_user_id >=", value, "publishUserId"); + return (Criteria) this; + } + + public Criteria andPublishUserIdLessThan(Long value) { + addCriterion("publish_user_id <", value, "publishUserId"); + return (Criteria) this; + } + + public Criteria andPublishUserIdLessThanOrEqualTo(Long value) { + addCriterion("publish_user_id <=", value, "publishUserId"); + return (Criteria) this; + } + + public Criteria andPublishUserIdIn(List values) { + addCriterion("publish_user_id in", values, "publishUserId"); + return (Criteria) this; + } + + public Criteria andPublishUserIdNotIn(List values) { + addCriterion("publish_user_id not in", values, "publishUserId"); + return (Criteria) this; + } + + public Criteria andPublishUserIdBetween(Long value1, Long value2) { + addCriterion("publish_user_id between", value1, value2, "publishUserId"); + return (Criteria) this; + } + + public Criteria andPublishUserIdNotBetween(Long value1, Long value2) { + addCriterion("publish_user_id not between", value1, value2, "publishUserId"); + return (Criteria) this; + } + + public Criteria andPublishTimeIsNull() { + addCriterion("publish_time is null"); + return (Criteria) this; + } + + public Criteria andPublishTimeIsNotNull() { + addCriterion("publish_time is not null"); + return (Criteria) this; + } + + public Criteria andPublishTimeEqualTo(LocalDateTime value) { + addCriterion("publish_time =", value, "publishTime"); + return (Criteria) this; + } + + public Criteria andPublishTimeNotEqualTo(LocalDateTime value) { + addCriterion("publish_time <>", value, "publishTime"); + return (Criteria) this; + } + + public Criteria andPublishTimeGreaterThan(LocalDateTime value) { + addCriterion("publish_time >", value, "publishTime"); + return (Criteria) this; + } + + public Criteria andPublishTimeGreaterThanOrEqualTo(LocalDateTime value) { + addCriterion("publish_time >=", value, "publishTime"); + return (Criteria) this; + } + + public Criteria andPublishTimeLessThan(LocalDateTime value) { + addCriterion("publish_time <", value, "publishTime"); + return (Criteria) this; + } + + public Criteria andPublishTimeLessThanOrEqualTo(LocalDateTime value) { + addCriterion("publish_time <=", value, "publishTime"); + return (Criteria) this; + } + + public Criteria andPublishTimeIn(List values) { + addCriterion("publish_time in", values, "publishTime"); + return (Criteria) this; + } + + public Criteria andPublishTimeNotIn(List values) { + addCriterion("publish_time not in", values, "publishTime"); + return (Criteria) this; + } + + public Criteria andPublishTimeBetween(LocalDateTime value1, LocalDateTime value2) { + addCriterion("publish_time between", value1, value2, "publishTime"); + return (Criteria) this; + } + + public Criteria andPublishTimeNotBetween(LocalDateTime value1, LocalDateTime value2) { + addCriterion("publish_time not between", value1, value2, "publishTime"); + return (Criteria) this; + } + } + + /** + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/src/main/java/club/joylink/rtss/services/doc/DocumentDraftService.java b/src/main/java/club/joylink/rtss/services/doc/DocumentDraftService.java new file mode 100644 index 000000000..7a3b0b16d --- /dev/null +++ b/src/main/java/club/joylink/rtss/services/doc/DocumentDraftService.java @@ -0,0 +1,57 @@ +package club.joylink.rtss.services.doc; + +import club.joylink.rtss.vo.UserVO; +import club.joylink.rtss.vo.doc.DocumentVO; + +import java.util.List; + +public interface DocumentDraftService { + + /** + * 查询草稿文档列表 + * @param userVO + * @return + */ + List listMyDocuments(UserVO userVO); + + /** + * 创建新的草稿文档 + * @param documentVO + * @param userVO + */ + void create(DocumentVO documentVO, UserVO userVO); + + /** + * 更新标题 + * @param id + * @param documentVO + */ + void updateTitle(Long id, DocumentVO documentVO); + + /** + * 获取文档详情 + * @param id + * @return + */ + DocumentVO getDetail(Long id); + + /** + * 保存数据 + * @param id + * @param content + */ + void save(Long id, String content); + + /** + * 发布文档 + * @param id + * @param userVO + */ + void publish(Long id, UserVO userVO); + + /** + * 删除文档 + * @param id + */ + void delete(Long id); +} diff --git a/src/main/java/club/joylink/rtss/services/doc/DocumentDraftServiceImpl.java b/src/main/java/club/joylink/rtss/services/doc/DocumentDraftServiceImpl.java new file mode 100644 index 000000000..3f51aaf64 --- /dev/null +++ b/src/main/java/club/joylink/rtss/services/doc/DocumentDraftServiceImpl.java @@ -0,0 +1,84 @@ +package club.joylink.rtss.services.doc; + +import club.joylink.rtss.dao.DocuDocumentDraftDAO; +import club.joylink.rtss.entity.DocuDocumentDraft; +import club.joylink.rtss.entity.DocuDocumentDraftExample; +import club.joylink.rtss.exception.BusinessExceptionAssertEnum; +import club.joylink.rtss.vo.UserVO; +import club.joylink.rtss.vo.doc.DocumentVO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; +import java.util.List; +import java.util.stream.Collectors; + +@Service +public class DocumentDraftServiceImpl implements DocumentDraftService { + + @Autowired + private DocuDocumentDraftDAO docuDocumentDraftDAO; + + @Autowired + private DocumentService documentService; + + @Override + public List listMyDocuments(UserVO userVO) { + DocuDocumentDraftExample example = new DocuDocumentDraftExample(); + example.createCriteria().andCreateUserIdEqualTo(userVO.getId()); + List list = docuDocumentDraftDAO.selectByExample(example); + return list.stream().map(DocumentVO::new).collect(Collectors.toList()); + } + + @Override + public void create(DocumentVO documentVO, UserVO userVO) { + // 校验名称 + DocuDocumentDraftExample example = new DocuDocumentDraftExample(); + example.createCriteria().andTitleEqualTo(documentVO.getTitle()); + BusinessExceptionAssertEnum.NAME_REPEAT + .assertTrue(docuDocumentDraftDAO.countByExample(example) == 0, "name already exist"); + // 添加 + DocuDocumentDraft documentDraft = new DocuDocumentDraft(); + documentDraft.setTitle(documentDraft.getTitle()); + documentDraft.setCreateUserId(userVO.getId()); + documentDraft.setCreateTime(LocalDateTime.now()); + docuDocumentDraftDAO.insertSelective(documentDraft); + } + + @Override + public void updateTitle(Long id, DocumentVO documentVO) { + DocuDocumentDraftExample example = new DocuDocumentDraftExample(); + example.createCriteria().andTitleEqualTo(documentVO.getTitle()).andIdNotEqualTo(id); + BusinessExceptionAssertEnum.NAME_REPEAT + .assertTrue(docuDocumentDraftDAO.countByExample(example) == 0, "name already exist"); + DocuDocumentDraft documentDraft = docuDocumentDraftDAO.selectByPrimaryKey(id); + documentDraft.setTitle(documentVO.getTitle()); + docuDocumentDraftDAO.updateByPrimaryKey(documentDraft); + } + + @Override + public DocumentVO getDetail(Long id) { + DocuDocumentDraft documentDraft = docuDocumentDraftDAO.selectByPrimaryKey(id); + DocumentVO documentVO = new DocumentVO(documentDraft); + documentVO.setContent(documentDraft.getContent()); + return documentVO; + } + + @Override + public void save(Long id, String content) { + DocuDocumentDraft documentDraft = docuDocumentDraftDAO.selectByPrimaryKey(id); + documentDraft.setContent(content); + docuDocumentDraftDAO.updateByPrimaryKey(documentDraft); + } + + @Override + public void publish(Long id, UserVO userVO) { + DocumentVO documentVO = getDetail(id); + documentService.publish(documentVO, userVO); + } + + @Override + public void delete(Long id) { + docuDocumentDraftDAO.deleteByPrimaryKey(id); + } +} diff --git a/src/main/java/club/joylink/rtss/services/doc/DocumentService.java b/src/main/java/club/joylink/rtss/services/doc/DocumentService.java new file mode 100644 index 000000000..7a40d3250 --- /dev/null +++ b/src/main/java/club/joylink/rtss/services/doc/DocumentService.java @@ -0,0 +1,29 @@ +package club.joylink.rtss.services.doc; + +import club.joylink.rtss.vo.UserVO; +import club.joylink.rtss.vo.doc.DocumentVO; + +import java.util.List; + +public interface DocumentService { + + /** + * 查询文档列表 + * @return + */ + List listDocuments(); + + /** + * 获取文档详情 + * @param id + * @return + */ + DocumentVO getDetail(Long id); + + /** + * 发布文档 + * @param documentVO + * @param userVO + */ + void publish(DocumentVO documentVO, UserVO userVO); +} diff --git a/src/main/java/club/joylink/rtss/services/doc/DocumentServiceImpl.java b/src/main/java/club/joylink/rtss/services/doc/DocumentServiceImpl.java new file mode 100644 index 000000000..9093277e9 --- /dev/null +++ b/src/main/java/club/joylink/rtss/services/doc/DocumentServiceImpl.java @@ -0,0 +1,56 @@ +package club.joylink.rtss.services.doc; + +import club.joylink.rtss.dao.DocuDocumentDAO; +import club.joylink.rtss.entity.DocuDocument; +import club.joylink.rtss.entity.DocuDocumentExample; +import club.joylink.rtss.vo.UserVO; +import club.joylink.rtss.vo.doc.DocumentVO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.time.LocalDateTime; +import java.util.List; +import java.util.stream.Collectors; + +@Service +public class DocumentServiceImpl implements DocumentService { + + @Autowired + private DocuDocumentDAO docuDocumentDAO; + + @Override + public List listDocuments() { + List list = docuDocumentDAO.selectByExample(null); + return list.stream().map(DocumentVO::new).collect(Collectors.toList()); + } + + @Override + public DocumentVO getDetail(Long id) { + DocuDocument document = docuDocumentDAO.selectByPrimaryKey(id); + DocumentVO documentVO = new DocumentVO(document); + documentVO.setContent(document.getContent()); + return documentVO; + } + + @Override + public void publish(DocumentVO documentVO, UserVO userVO) { + DocuDocumentExample example = new DocuDocumentExample(); + example.createCriteria().andTitleEqualTo(documentVO.getTitle()); + List documentList = docuDocumentDAO.selectByExample(example); + if (CollectionUtils.isEmpty(documentList)) { + DocuDocument document = new DocuDocument(); + document.setTitle(documentVO.getTitle()); + document.setContent(documentVO.getContent()); + document.setPublishUserId(userVO.getId()); + document.setPublishTime(LocalDateTime.now()); + docuDocumentDAO.insert(document); + } else { + DocuDocument document = documentList.get(0); + document.setContent(documentVO.getContent()); + document.setPublishUserId(userVO.getId()); + document.setPublishTime(LocalDateTime.now()); + docuDocumentDAO.updateByPrimaryKey(document); + } + } +} diff --git a/src/main/java/club/joylink/rtss/vo/doc/DocumentVO.java b/src/main/java/club/joylink/rtss/vo/doc/DocumentVO.java new file mode 100644 index 000000000..f1ffac63f --- /dev/null +++ b/src/main/java/club/joylink/rtss/vo/doc/DocumentVO.java @@ -0,0 +1,39 @@ +package club.joylink.rtss.vo.doc; + +import club.joylink.rtss.entity.DocuDocument; +import club.joylink.rtss.entity.DocuDocumentDraft; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +import javax.validation.constraints.Max; +import javax.validation.constraints.NotBlank; + +@ApiModel(value = "文档对象") +@Getter +@Setter +@NoArgsConstructor +public class DocumentVO { + + private Long id; + + @ApiModelProperty(value = "标题") + @NotBlank(message = "标题不能为空") + @Max(50) + private String title; + + @ApiModelProperty(value = "内容") + private String content; + + public DocumentVO(DocuDocumentDraft documentDraft) { + this.id = documentDraft.getId(); + this.title = documentDraft.getTitle(); + } + + public DocumentVO(DocuDocument document) { + this.id = document.getId(); + this.title = document.getTitle(); + } +} diff --git a/src/main/resources/mybatis/mapper/DocuDocumentDAO.xml b/src/main/resources/mybatis/mapper/DocuDocumentDAO.xml new file mode 100644 index 000000000..ad4f7d6ab --- /dev/null +++ b/src/main/resources/mybatis/mapper/DocuDocumentDAO.xml @@ -0,0 +1,261 @@ + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, title, publish_user_id, publish_time + + + content + + + + + + delete from docu_document + where id = #{id,jdbcType=BIGINT} + + + delete from docu_document + + + + + + insert into docu_document (title, publish_user_id, publish_time, + content) + values (#{title,jdbcType=VARCHAR}, #{publishUserId,jdbcType=BIGINT}, #{publishTime,jdbcType=TIMESTAMP}, + #{content,jdbcType=LONGVARCHAR}) + + + insert into docu_document + + + title, + + + publish_user_id, + + + publish_time, + + + content, + + + + + #{title,jdbcType=VARCHAR}, + + + #{publishUserId,jdbcType=BIGINT}, + + + #{publishTime,jdbcType=TIMESTAMP}, + + + #{content,jdbcType=LONGVARCHAR}, + + + + + + update docu_document + + + id = #{record.id,jdbcType=BIGINT}, + + + title = #{record.title,jdbcType=VARCHAR}, + + + publish_user_id = #{record.publishUserId,jdbcType=BIGINT}, + + + publish_time = #{record.publishTime,jdbcType=TIMESTAMP}, + + + content = #{record.content,jdbcType=LONGVARCHAR}, + + + + + + + + update docu_document + set id = #{record.id,jdbcType=BIGINT}, + title = #{record.title,jdbcType=VARCHAR}, + publish_user_id = #{record.publishUserId,jdbcType=BIGINT}, + publish_time = #{record.publishTime,jdbcType=TIMESTAMP}, + content = #{record.content,jdbcType=LONGVARCHAR} + + + + + + update docu_document + set id = #{record.id,jdbcType=BIGINT}, + title = #{record.title,jdbcType=VARCHAR}, + publish_user_id = #{record.publishUserId,jdbcType=BIGINT}, + publish_time = #{record.publishTime,jdbcType=TIMESTAMP} + + + + + + update docu_document + + + title = #{title,jdbcType=VARCHAR}, + + + publish_user_id = #{publishUserId,jdbcType=BIGINT}, + + + publish_time = #{publishTime,jdbcType=TIMESTAMP}, + + + content = #{content,jdbcType=LONGVARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + update docu_document + set title = #{title,jdbcType=VARCHAR}, + publish_user_id = #{publishUserId,jdbcType=BIGINT}, + publish_time = #{publishTime,jdbcType=TIMESTAMP}, + content = #{content,jdbcType=LONGVARCHAR} + where id = #{id,jdbcType=BIGINT} + + + update docu_document + set title = #{title,jdbcType=VARCHAR}, + publish_user_id = #{publishUserId,jdbcType=BIGINT}, + publish_time = #{publishTime,jdbcType=TIMESTAMP} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/src/main/resources/mybatis/mapper/DocuDocumentDraftDAO.xml b/src/main/resources/mybatis/mapper/DocuDocumentDraftDAO.xml new file mode 100644 index 000000000..903eae03c --- /dev/null +++ b/src/main/resources/mybatis/mapper/DocuDocumentDraftDAO.xml @@ -0,0 +1,261 @@ + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, title, create_user_id, create_time + + + content + + + + + + delete from docu_document_draft + where id = #{id,jdbcType=BIGINT} + + + delete from docu_document_draft + + + + + + insert into docu_document_draft (title, create_user_id, create_time, + content) + values (#{title,jdbcType=VARCHAR}, #{createUserId,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}, + #{content,jdbcType=LONGVARCHAR}) + + + insert into docu_document_draft + + + title, + + + create_user_id, + + + create_time, + + + content, + + + + + #{title,jdbcType=VARCHAR}, + + + #{createUserId,jdbcType=BIGINT}, + + + #{createTime,jdbcType=TIMESTAMP}, + + + #{content,jdbcType=LONGVARCHAR}, + + + + + + update docu_document_draft + + + id = #{record.id,jdbcType=BIGINT}, + + + title = #{record.title,jdbcType=VARCHAR}, + + + create_user_id = #{record.createUserId,jdbcType=BIGINT}, + + + create_time = #{record.createTime,jdbcType=TIMESTAMP}, + + + content = #{record.content,jdbcType=LONGVARCHAR}, + + + + + + + + update docu_document_draft + set id = #{record.id,jdbcType=BIGINT}, + title = #{record.title,jdbcType=VARCHAR}, + create_user_id = #{record.createUserId,jdbcType=BIGINT}, + create_time = #{record.createTime,jdbcType=TIMESTAMP}, + content = #{record.content,jdbcType=LONGVARCHAR} + + + + + + update docu_document_draft + set id = #{record.id,jdbcType=BIGINT}, + title = #{record.title,jdbcType=VARCHAR}, + create_user_id = #{record.createUserId,jdbcType=BIGINT}, + create_time = #{record.createTime,jdbcType=TIMESTAMP} + + + + + + update docu_document_draft + + + title = #{title,jdbcType=VARCHAR}, + + + create_user_id = #{createUserId,jdbcType=BIGINT}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + content = #{content,jdbcType=LONGVARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + update docu_document_draft + set title = #{title,jdbcType=VARCHAR}, + create_user_id = #{createUserId,jdbcType=BIGINT}, + create_time = #{createTime,jdbcType=TIMESTAMP}, + content = #{content,jdbcType=LONGVARCHAR} + where id = #{id,jdbcType=BIGINT} + + + update docu_document_draft + set title = #{title,jdbcType=VARCHAR}, + create_user_id = #{createUserId,jdbcType=BIGINT}, + create_time = #{createTime,jdbcType=TIMESTAMP} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file