新增便签ruoyi-note模块

This commit is contained in:
WangHao
2020-09-13 01:04:21 +08:00
parent a1e23ed9c9
commit d32b8041ae
28 changed files with 2923 additions and 11 deletions

28
ruoyi-note/pom.xml Normal file
View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>ruoyi</artifactId>
<groupId>com.ruoyi</groupId>
<version>3.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>ruoyi-note</artifactId>
<description>
note系统模块
</description>
<dependencies>
<!-- 通用工具-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,263 @@
package com.ruoyi.note.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import java.util.Date;
/**
* 便签管理对象 nm_note
*
* @author wang
* @date 2020-09-12
*/
public class NmNote
{
private static final long serialVersionUID = 1L;
/** Note便签ID */
@Excel(name = "Note便签ID")
private Long noteId;
/** 用户ID */
@Excel(name = "用户ID")
private Long userId;
/** 便签标题(自动截取) */
@Excel(name = "便签标题(自动截取)")
private String title;
/** 摘要(前50字) 循环展示 */
@Excel(name = "摘要(前50字) 循环展示")
private String description;
/** 所属分组Id */
@Excel(name = "所属分组Id")
private Integer menuId;
/** 背景颜色 '白','红','黄','蓝','紫' */
@Excel(name = "背景颜色 '白','红','黄','蓝','紫'")
private String background;
/** 字数 */
@Excel(name = "字数")
private Integer noteCount;
/** 排序(小到大) */
@Excel(name = "排序(小到大)")
private Integer noteSort;
/** 便签状态 */
@Excel(name = "便签状态")
private Integer isState;
/** 阅读进度 */
@Excel(name = "阅读进度")
private Integer readProgress;
/** 是否星标 */
@Excel(name = "是否星标")
private Integer isStar;
/** 是否删除 */
@Excel(name = "是否删除")
private Integer isDelete;
/** 是否置顶 */
@Excel(name = "是否置顶")
private Integer topFlag;
/** 是否分享(判断是否可以随意访问) */
@Excel(name = "是否分享(判断是否可以随意访问)")
private Integer isShare;
/** 是否加密 */
@Excel(name = "是否加密")
private Integer isEncryption;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
/** 更新时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
public void setNoteId(Long noteId)
{
this.noteId = noteId;
}
public Long getNoteId()
{
return noteId;
}
public void setUserId(Long userId)
{
this.userId = userId;
}
public Long getUserId()
{
return userId;
}
public void setTitle(String title)
{
this.title = title;
}
public String getTitle()
{
return title;
}
public void setDescription(String description)
{
this.description = description;
}
public String getDescription()
{
return description;
}
public void setMenuId(Integer menuId)
{
this.menuId = menuId;
}
public Integer getMenuId()
{
return menuId;
}
public void setBackground(String background)
{
this.background = background;
}
public String getBackground()
{
return background;
}
public void setNoteCount(Integer noteCount)
{
this.noteCount = noteCount;
}
public Integer getNoteCount()
{
return noteCount;
}
public void setNoteSort(Integer noteSort)
{
this.noteSort = noteSort;
}
public Integer getNoteSort()
{
return noteSort;
}
public void setIsState(Integer isState)
{
this.isState = isState;
}
public Integer getIsState()
{
return isState;
}
public void setReadProgress(Integer readProgress)
{
this.readProgress = readProgress;
}
public Integer getReadProgress()
{
return readProgress;
}
public void setIsStar(Integer isStar)
{
this.isStar = isStar;
}
public Integer getIsStar()
{
return isStar;
}
public void setIsDelete(Integer isDelete)
{
this.isDelete = isDelete;
}
public Integer getIsDelete()
{
return isDelete;
}
public void setTopFlag(Integer topFlag)
{
this.topFlag = topFlag;
}
public Integer getTopFlag()
{
return topFlag;
}
public void setIsShare(Integer isShare)
{
this.isShare = isShare;
}
public Integer getIsShare()
{
return isShare;
}
public void setIsEncryption(Integer isEncryption)
{
this.isEncryption = isEncryption;
}
public Integer getIsEncryption()
{
return isEncryption;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("noteId", getNoteId())
.append("userId", getUserId())
.append("title", getTitle())
.append("description", getDescription())
.append("menuId", getMenuId())
.append("background", getBackground())
.append("noteCount", getNoteCount())
.append("noteSort", getNoteSort())
.append("isState", getIsState())
.append("readProgress", getReadProgress())
.append("isStar", getIsStar())
.append("isDelete", getIsDelete())
.append("topFlag", getTopFlag())
.append("isShare", getIsShare())
.append("isEncryption", getIsEncryption())
.append("createTime", getCreateTime())
.append("updateTime", getUpdateTime())
.toString();
}
}

View File

@ -0,0 +1,65 @@
package com.ruoyi.note.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 文章内容对象 nm_note_content
*
* @author wang
* @date 2020-09-12
*/
public class NmNoteContent extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 便签主键ID */
private Long noteId;
/** markdown编辑器内容 */
@Excel(name = "markdown编辑器内容")
private String markdownContent;
/** ueditor编辑器内容 */
@Excel(name = "ueditor编辑器内容")
private String ueditorContent;
public void setNoteId(Long noteId)
{
this.noteId = noteId;
}
public Long getNoteId()
{
return noteId;
}
public void setMarkdownContent(String markdownContent)
{
this.markdownContent = markdownContent;
}
public String getMarkdownContent()
{
return markdownContent;
}
public void setUeditorContent(String ueditorContent)
{
this.ueditorContent = ueditorContent;
}
public String getUeditorContent()
{
return ueditorContent;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("noteId", getNoteId())
.append("markdownContent", getMarkdownContent())
.append("ueditorContent", getUeditorContent())
.toString();
}
}

View File

@ -0,0 +1,65 @@
package com.ruoyi.note.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 便签标签对象 nm_note_tag
*
* @author wang
* @date 2020-09-12
*/
public class NmNoteTag extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** id */
private Long id;
/** 便签id */
@Excel(name = "便签id")
private Long noteId;
/** 标签Id */
@Excel(name = "标签Id")
private Long tagId;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setNoteId(Long noteId)
{
this.noteId = noteId;
}
public Long getNoteId()
{
return noteId;
}
public void setTagId(Long tagId)
{
this.tagId = tagId;
}
public Long getTagId()
{
return tagId;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("noteId", getNoteId())
.append("tagId", getTagId())
.toString();
}
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.note.mapper;
import java.util.List;
import com.ruoyi.note.domain.NmNoteContent;
/**
* 文章内容Mapper接口
*
* @author wang
* @date 2020-09-12
*/
public interface NmNoteContentMapper
{
/**
* 查询文章内容
*
* @param noteId 文章内容ID
* @return 文章内容
*/
public NmNoteContent selectNmNoteContentById(Long noteId);
/**
* 查询文章内容列表
*
* @param nmNoteContent 文章内容
* @return 文章内容集合
*/
public List<NmNoteContent> selectNmNoteContentList(NmNoteContent nmNoteContent);
/**
* 新增文章内容
*
* @param nmNoteContent 文章内容
* @return 结果
*/
public int insertNmNoteContent(NmNoteContent nmNoteContent);
/**
* 修改文章内容
*
* @param nmNoteContent 文章内容
* @return 结果
*/
public int updateNmNoteContent(NmNoteContent nmNoteContent);
/**
* 删除文章内容
*
* @param noteId 文章内容ID
* @return 结果
*/
public int deleteNmNoteContentById(Long noteId);
/**
* 批量删除文章内容
*
* @param noteIds 需要删除的数据ID
* @return 结果
*/
public int deleteNmNoteContentByIds(Long[] noteIds);
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.note.mapper;
import java.util.List;
import com.ruoyi.note.domain.NmNote;
/**
* 便签管理Mapper接口
*
* @author wang
* @date 2020-09-12
*/
public interface NmNoteMapper
{
/**
* 查询便签管理
*
* @param noteId 便签管理ID
* @return 便签管理
*/
public NmNote selectNmNoteById(Long noteId);
/**
* 查询便签管理列表
*
* @param nmNote 便签管理
* @return 便签管理集合
*/
public List<NmNote> selectNmNoteList(NmNote nmNote);
/**
* 新增便签管理
*
* @param nmNote 便签管理
* @return 结果
*/
public int insertNmNote(NmNote nmNote);
/**
* 修改便签管理
*
* @param nmNote 便签管理
* @return 结果
*/
public int updateNmNote(NmNote nmNote);
/**
* 删除便签管理
*
* @param noteId 便签管理ID
* @return 结果
*/
public int deleteNmNoteById(Long noteId);
/**
* 批量删除便签管理
*
* @param noteIds 需要删除的数据ID
* @return 结果
*/
public int deleteNmNoteByIds(Long[] noteIds);
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.note.mapper;
import java.util.List;
import com.ruoyi.note.domain.NmNoteTag;
/**
* 便签标签Mapper接口
*
* @author wang
* @date 2020-09-12
*/
public interface NmNoteTagMapper
{
/**
* 查询便签标签
*
* @param id 便签标签ID
* @return 便签标签
*/
public NmNoteTag selectNmNoteTagById(Long id);
/**
* 查询便签标签列表
*
* @param nmNoteTag 便签标签
* @return 便签标签集合
*/
public List<NmNoteTag> selectNmNoteTagList(NmNoteTag nmNoteTag);
/**
* 新增便签标签
*
* @param nmNoteTag 便签标签
* @return 结果
*/
public int insertNmNoteTag(NmNoteTag nmNoteTag);
/**
* 修改便签标签
*
* @param nmNoteTag 便签标签
* @return 结果
*/
public int updateNmNoteTag(NmNoteTag nmNoteTag);
/**
* 删除便签标签
*
* @param id 便签标签ID
* @return 结果
*/
public int deleteNmNoteTagById(Long id);
/**
* 批量删除便签标签
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteNmNoteTagByIds(Long[] ids);
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.note.service;
import java.util.List;
import com.ruoyi.note.domain.NmNoteContent;
/**
* 文章内容Service接口
*
* @author wang
* @date 2020-09-12
*/
public interface INmNoteContentService
{
/**
* 查询文章内容
*
* @param noteId 文章内容ID
* @return 文章内容
*/
public NmNoteContent selectNmNoteContentById(Long noteId);
/**
* 查询文章内容列表
*
* @param nmNoteContent 文章内容
* @return 文章内容集合
*/
public List<NmNoteContent> selectNmNoteContentList(NmNoteContent nmNoteContent);
/**
* 新增文章内容
*
* @param nmNoteContent 文章内容
* @return 结果
*/
public int insertNmNoteContent(NmNoteContent nmNoteContent);
/**
* 修改文章内容
*
* @param nmNoteContent 文章内容
* @return 结果
*/
public int updateNmNoteContent(NmNoteContent nmNoteContent);
/**
* 批量删除文章内容
*
* @param noteIds 需要删除的文章内容ID
* @return 结果
*/
public int deleteNmNoteContentByIds(Long[] noteIds);
/**
* 删除文章内容信息
*
* @param noteId 文章内容ID
* @return 结果
*/
public int deleteNmNoteContentById(Long noteId);
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.note.service;
import java.util.List;
import com.ruoyi.note.domain.NmNote;
/**
* 便签管理Service接口
*
* @author wang
* @date 2020-09-12
*/
public interface INmNoteService
{
/**
* 查询便签管理
*
* @param noteId 便签管理ID
* @return 便签管理
*/
public NmNote selectNmNoteById(Long noteId);
/**
* 查询便签管理列表
*
* @param nmNote 便签管理
* @return 便签管理集合
*/
public List<NmNote> selectNmNoteList(NmNote nmNote);
/**
* 新增便签管理
*
* @param nmNote 便签管理
* @return 结果
*/
public int insertNmNote(NmNote nmNote);
/**
* 修改便签管理
*
* @param nmNote 便签管理
* @return 结果
*/
public int updateNmNote(NmNote nmNote);
/**
* 批量删除便签管理
*
* @param noteIds 需要删除的便签管理ID
* @return 结果
*/
public int deleteNmNoteByIds(Long[] noteIds);
/**
* 删除便签管理信息
*
* @param noteId 便签管理ID
* @return 结果
*/
public int deleteNmNoteById(Long noteId);
}

View File

@ -0,0 +1,61 @@
package com.ruoyi.note.service;
import java.util.List;
import com.ruoyi.note.domain.NmNoteTag;
/**
* 便签标签Service接口
*
* @author wang
* @date 2020-09-12
*/
public interface INmNoteTagService
{
/**
* 查询便签标签
*
* @param id 便签标签ID
* @return 便签标签
*/
public NmNoteTag selectNmNoteTagById(Long id);
/**
* 查询便签标签列表
*
* @param nmNoteTag 便签标签
* @return 便签标签集合
*/
public List<NmNoteTag> selectNmNoteTagList(NmNoteTag nmNoteTag);
/**
* 新增便签标签
*
* @param nmNoteTag 便签标签
* @return 结果
*/
public int insertNmNoteTag(NmNoteTag nmNoteTag);
/**
* 修改便签标签
*
* @param nmNoteTag 便签标签
* @return 结果
*/
public int updateNmNoteTag(NmNoteTag nmNoteTag);
/**
* 批量删除便签标签
*
* @param ids 需要删除的便签标签ID
* @return 结果
*/
public int deleteNmNoteTagByIds(Long[] ids);
/**
* 删除便签标签信息
*
* @param id 便签标签ID
* @return 结果
*/
public int deleteNmNoteTagById(Long id);
}

View File

@ -0,0 +1,93 @@
package com.ruoyi.note.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.note.mapper.NmNoteContentMapper;
import com.ruoyi.note.domain.NmNoteContent;
import com.ruoyi.note.service.INmNoteContentService;
/**
* 文章内容Service业务层处理
*
* @author wang
* @date 2020-09-12
*/
@Service
public class NmNoteContentServiceImpl implements INmNoteContentService
{
@Autowired
private NmNoteContentMapper nmNoteContentMapper;
/**
* 查询文章内容
*
* @param noteId 文章内容ID
* @return 文章内容
*/
@Override
public NmNoteContent selectNmNoteContentById(Long noteId)
{
return nmNoteContentMapper.selectNmNoteContentById(noteId);
}
/**
* 查询文章内容列表
*
* @param nmNoteContent 文章内容
* @return 文章内容
*/
@Override
public List<NmNoteContent> selectNmNoteContentList(NmNoteContent nmNoteContent)
{
return nmNoteContentMapper.selectNmNoteContentList(nmNoteContent);
}
/**
* 新增文章内容
*
* @param nmNoteContent 文章内容
* @return 结果
*/
@Override
public int insertNmNoteContent(NmNoteContent nmNoteContent)
{
return nmNoteContentMapper.insertNmNoteContent(nmNoteContent);
}
/**
* 修改文章内容
*
* @param nmNoteContent 文章内容
* @return 结果
*/
@Override
public int updateNmNoteContent(NmNoteContent nmNoteContent)
{
return nmNoteContentMapper.updateNmNoteContent(nmNoteContent);
}
/**
* 批量删除文章内容
*
* @param noteIds 需要删除的文章内容ID
* @return 结果
*/
@Override
public int deleteNmNoteContentByIds(Long[] noteIds)
{
return nmNoteContentMapper.deleteNmNoteContentByIds(noteIds);
}
/**
* 删除文章内容信息
*
* @param noteId 文章内容ID
* @return 结果
*/
@Override
public int deleteNmNoteContentById(Long noteId)
{
return nmNoteContentMapper.deleteNmNoteContentById(noteId);
}
}

View File

@ -0,0 +1,96 @@
package com.ruoyi.note.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.note.mapper.NmNoteMapper;
import com.ruoyi.note.domain.NmNote;
import com.ruoyi.note.service.INmNoteService;
/**
* 便签管理Service业务层处理
*
* @author wang
* @date 2020-09-12
*/
@Service
public class NmNoteServiceImpl implements INmNoteService
{
@Autowired
private NmNoteMapper nmNoteMapper;
/**
* 查询便签管理
*
* @param noteId 便签管理ID
* @return 便签管理
*/
@Override
public NmNote selectNmNoteById(Long noteId)
{
return nmNoteMapper.selectNmNoteById(noteId);
}
/**
* 查询便签管理列表
*
* @param nmNote 便签管理
* @return 便签管理
*/
@Override
public List<NmNote> selectNmNoteList(NmNote nmNote)
{
return nmNoteMapper.selectNmNoteList(nmNote);
}
/**
* 新增便签管理
*
* @param nmNote 便签管理
* @return 结果
*/
@Override
public int insertNmNote(NmNote nmNote)
{
nmNote.setCreateTime(DateUtils.getNowDate());
return nmNoteMapper.insertNmNote(nmNote);
}
/**
* 修改便签管理
*
* @param nmNote 便签管理
* @return 结果
*/
@Override
public int updateNmNote(NmNote nmNote)
{
nmNote.setUpdateTime(DateUtils.getNowDate());
return nmNoteMapper.updateNmNote(nmNote);
}
/**
* 批量删除便签管理
*
* @param noteIds 需要删除的便签管理ID
* @return 结果
*/
@Override
public int deleteNmNoteByIds(Long[] noteIds)
{
return nmNoteMapper.deleteNmNoteByIds(noteIds);
}
/**
* 删除便签管理信息
*
* @param noteId 便签管理ID
* @return 结果
*/
@Override
public int deleteNmNoteById(Long noteId)
{
return nmNoteMapper.deleteNmNoteById(noteId);
}
}

View File

@ -0,0 +1,93 @@
package com.ruoyi.note.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.note.mapper.NmNoteTagMapper;
import com.ruoyi.note.domain.NmNoteTag;
import com.ruoyi.note.service.INmNoteTagService;
/**
* 便签标签Service业务层处理
*
* @author wang
* @date 2020-09-12
*/
@Service
public class NmNoteTagServiceImpl implements INmNoteTagService
{
@Autowired
private NmNoteTagMapper nmNoteTagMapper;
/**
* 查询便签标签
*
* @param id 便签标签ID
* @return 便签标签
*/
@Override
public NmNoteTag selectNmNoteTagById(Long id)
{
return nmNoteTagMapper.selectNmNoteTagById(id);
}
/**
* 查询便签标签列表
*
* @param nmNoteTag 便签标签
* @return 便签标签
*/
@Override
public List<NmNoteTag> selectNmNoteTagList(NmNoteTag nmNoteTag)
{
return nmNoteTagMapper.selectNmNoteTagList(nmNoteTag);
}
/**
* 新增便签标签
*
* @param nmNoteTag 便签标签
* @return 结果
*/
@Override
public int insertNmNoteTag(NmNoteTag nmNoteTag)
{
return nmNoteTagMapper.insertNmNoteTag(nmNoteTag);
}
/**
* 修改便签标签
*
* @param nmNoteTag 便签标签
* @return 结果
*/
@Override
public int updateNmNoteTag(NmNoteTag nmNoteTag)
{
return nmNoteTagMapper.updateNmNoteTag(nmNoteTag);
}
/**
* 批量删除便签标签
*
* @param ids 需要删除的便签标签ID
* @return 结果
*/
@Override
public int deleteNmNoteTagByIds(Long[] ids)
{
return nmNoteTagMapper.deleteNmNoteTagByIds(ids);
}
/**
* 删除便签标签信息
*
* @param id 便签标签ID
* @return 结果
*/
@Override
public int deleteNmNoteTagById(Long id)
{
return nmNoteTagMapper.deleteNmNoteTagById(id);
}
}

View File

@ -0,0 +1,66 @@
<?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.ruoyi.note.mapper.NmNoteContentMapper">
<resultMap type="NmNoteContent" id="NmNoteContentResult">
<result property="noteId" column="note_id" />
<result property="markdownContent" column="markdown_content" />
<result property="ueditorContent" column="ueditor_content" />
</resultMap>
<sql id="selectNmNoteContentVo">
select note_id, markdown_content, ueditor_content from nm_note_content
</sql>
<select id="selectNmNoteContentList" parameterType="NmNoteContent" resultMap="NmNoteContentResult">
<include refid="selectNmNoteContentVo"/>
<where>
<if test="noteId != null "> and note_id = #{noteId}</if>
<if test="markdownContent != null and markdownContent != ''"> and markdown_content = #{markdownContent}</if>
<if test="ueditorContent != null and ueditorContent != ''"> and ueditor_content = #{ueditorContent}</if>
</where>
</select>
<select id="selectNmNoteContentById" parameterType="Long" resultMap="NmNoteContentResult">
<include refid="selectNmNoteContentVo"/>
where note_id = #{noteId}
</select>
<insert id="insertNmNoteContent" parameterType="NmNoteContent">
insert into nm_note_content
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="noteId != null">note_id,</if>
<if test="markdownContent != null">markdown_content,</if>
<if test="ueditorContent != null">ueditor_content,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="noteId != null">#{noteId},</if>
<if test="markdownContent != null">#{markdownContent},</if>
<if test="ueditorContent != null">#{ueditorContent},</if>
</trim>
</insert>
<update id="updateNmNoteContent" parameterType="NmNoteContent">
update nm_note_content
<trim prefix="SET" suffixOverrides=",">
<if test="markdownContent != null">markdown_content = #{markdownContent},</if>
<if test="ueditorContent != null">ueditor_content = #{ueditorContent},</if>
</trim>
where note_id = #{noteId}
</update>
<delete id="deleteNmNoteContentById" parameterType="Long">
delete from nm_note_content where note_id = #{noteId}
</delete>
<delete id="deleteNmNoteContentByIds" parameterType="String">
delete from nm_note_content where note_id in
<foreach item="noteId" collection="array" open="(" separator="," close=")">
#{noteId}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,134 @@
<?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.ruoyi.note.mapper.NmNoteMapper">
<resultMap type="NmNote" id="NmNoteResult">
<result property="noteId" column="note_id" />
<result property="userId" column="user_id" />
<result property="title" column="title" />
<result property="description" column="description" />
<result property="menuId" column="menu_id" />
<result property="background" column="background" />
<result property="noteCount" column="note_count" />
<result property="noteSort" column="note_sort" />
<result property="isState" column="is_state" />
<result property="readProgress" column="read_progress" />
<result property="isStar" column="is_star" />
<result property="isDelete" column="is_delete" />
<result property="topFlag" column="top_flag" />
<result property="isShare" column="is_share" />
<result property="isEncryption" column="is_encryption" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectNmNoteVo">
select note_id, user_id, title, description, menu_id, background, note_count, note_sort, is_state, read_progress, is_star, is_delete, top_flag, is_share, is_encryption, create_time, update_time from nm_note
</sql>
<select id="selectNmNoteList" parameterType="NmNote" resultMap="NmNoteResult">
<include refid="selectNmNoteVo"/>
<where>
<if test="noteId != null "> and note_id = #{noteId}</if>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="title != null and title != ''"> and title like concat('%', #{title}, '%')</if>
<if test="description != null and description != ''"> and description = #{description}</if>
<if test="menuId != null "> and menu_id = #{menuId}</if>
<if test="background != null and background != ''"> and background = #{background}</if>
<if test="noteCount != null "> and note_count = #{noteCount}</if>
<if test="noteSort != null "> and note_sort = #{noteSort}</if>
<if test="isState != null "> and is_state = #{isState}</if>
<if test="readProgress != null "> and read_progress = #{readProgress}</if>
<if test="isStar != null "> and is_star = #{isStar}</if>
<if test="isDelete != null "> and is_delete = #{isDelete}</if>
<if test="topFlag != null "> and top_flag = #{topFlag}</if>
<if test="isShare != null "> and is_share = #{isShare}</if>
<if test="isEncryption != null "> and is_encryption = #{isEncryption}</if>
</where>
</select>
<select id="selectNmNoteById" parameterType="Long" resultMap="NmNoteResult">
<include refid="selectNmNoteVo"/>
where note_id = #{noteId}
</select>
<insert id="insertNmNote" parameterType="NmNote">
insert into nm_note
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="noteId != null">note_id,</if>
<if test="userId != null">user_id,</if>
<if test="title != null">title,</if>
<if test="description != null">description,</if>
<if test="menuId != null">menu_id,</if>
<if test="background != null">background,</if>
<if test="noteCount != null">note_count,</if>
<if test="noteSort != null">note_sort,</if>
<if test="isState != null">is_state,</if>
<if test="readProgress != null">read_progress,</if>
<if test="isStar != null">is_star,</if>
<if test="isDelete != null">is_delete,</if>
<if test="topFlag != null">top_flag,</if>
<if test="isShare != null">is_share,</if>
<if test="isEncryption != null">is_encryption,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="noteId != null">#{noteId},</if>
<if test="userId != null">#{userId},</if>
<if test="title != null">#{title},</if>
<if test="description != null">#{description},</if>
<if test="menuId != null">#{menuId},</if>
<if test="background != null">#{background},</if>
<if test="noteCount != null">#{noteCount},</if>
<if test="noteSort != null">#{noteSort},</if>
<if test="isState != null">#{isState},</if>
<if test="readProgress != null">#{readProgress},</if>
<if test="isStar != null">#{isStar},</if>
<if test="isDelete != null">#{isDelete},</if>
<if test="topFlag != null">#{topFlag},</if>
<if test="isShare != null">#{isShare},</if>
<if test="isEncryption != null">#{isEncryption},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateNmNote" parameterType="NmNote">
update nm_note
<trim prefix="SET" suffixOverrides=",">
<if test="userId != null">user_id = #{userId},</if>
<if test="title != null">title = #{title},</if>
<if test="description != null">description = #{description},</if>
<if test="menuId != null">menu_id = #{menuId},</if>
<if test="background != null">background = #{background},</if>
<if test="noteCount != null">note_count = #{noteCount},</if>
<if test="noteSort != null">note_sort = #{noteSort},</if>
<if test="isState != null">is_state = #{isState},</if>
<if test="readProgress != null">read_progress = #{readProgress},</if>
<if test="isStar != null">is_star = #{isStar},</if>
<if test="isDelete != null">is_delete = #{isDelete},</if>
<if test="topFlag != null">top_flag = #{topFlag},</if>
<if test="isShare != null">is_share = #{isShare},</if>
<if test="isEncryption != null">is_encryption = #{isEncryption},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where note_id = #{noteId}
</update>
<delete id="deleteNmNoteById" parameterType="Long">
delete from nm_note where note_id = #{noteId}
</delete>
<delete id="deleteNmNoteByIds" parameterType="String">
delete from nm_note where note_id in
<foreach item="noteId" collection="array" open="(" separator="," close=")">
#{noteId}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,63 @@
<?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.ruoyi.note.mapper.NmNoteTagMapper">
<resultMap type="NmNoteTag" id="NmNoteTagResult">
<result property="id" column="id" />
<result property="noteId" column="note_id" />
<result property="tagId" column="tag_id" />
</resultMap>
<sql id="selectNmNoteTagVo">
select id, note_id, tag_id from nm_note_tag
</sql>
<select id="selectNmNoteTagList" parameterType="NmNoteTag" resultMap="NmNoteTagResult">
<include refid="selectNmNoteTagVo"/>
<where>
<if test="noteId != null "> and note_id = #{noteId}</if>
<if test="tagId != null "> and tag_id = #{tagId}</if>
</where>
</select>
<select id="selectNmNoteTagById" parameterType="Long" resultMap="NmNoteTagResult">
<include refid="selectNmNoteTagVo"/>
where id = #{id}
</select>
<insert id="insertNmNoteTag" parameterType="NmNoteTag" useGeneratedKeys="true" keyProperty="id">
insert into nm_note_tag
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="noteId != null">note_id,</if>
<if test="tagId != null">tag_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="noteId != null">#{noteId},</if>
<if test="tagId != null">#{tagId},</if>
</trim>
</insert>
<update id="updateNmNoteTag" parameterType="NmNoteTag">
update nm_note_tag
<trim prefix="SET" suffixOverrides=",">
<if test="noteId != null">note_id = #{noteId},</if>
<if test="tagId != null">tag_id = #{tagId},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteNmNoteTagById" parameterType="Long">
delete from nm_note_tag where id = #{id}
</delete>
<delete id="deleteNmNoteTagByIds" parameterType="String">
delete from nm_note_tag where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>