博客功能添加

This commit is contained in:
zxm 2018-10-01 10:03:38 +08:00 committed by meng
parent 2e3d4a6e49
commit 7c1f2b0f4d
12 changed files with 641 additions and 0 deletions

View File

@ -0,0 +1,72 @@
package com.len.entity;
import javax.persistence.*;
@Table(name = "blog_article_category")
public class ArticleCategory {
@Id
@GeneratedValue(generator = "JDBC")
private String id;
/**
* 文章id
*/
@Column(name = "article_id")
private String articleId;
/**
* 标签id
*/
@Column(name = "tag_id")
private String tagId;
/**
* @return id
*/
public String getId() {
return id;
}
/**
* @param id
*/
public void setId(String id) {
this.id = id == null ? null : id.trim();
}
/**
* 获取文章id
*
* @return article_id - 文章id
*/
public String getArticleId() {
return articleId;
}
/**
* 设置文章id
*
* @param articleId 文章id
*/
public void setArticleId(String articleId) {
this.articleId = articleId == null ? null : articleId.trim();
}
/**
* 获取标签id
*
* @return tag_id - 标签id
*/
public String getTagId() {
return tagId;
}
/**
* 设置标签id
*
* @param tagId 标签id
*/
public void setTagId(String tagId) {
this.tagId = tagId == null ? null : tagId.trim();
}
}

View File

@ -0,0 +1,234 @@
package com.len.entity;
import java.util.Date;
import javax.persistence.*;
@Table(name = "blog_article")
public class BlogArticle {
@Id
@GeneratedValue(generator = "JDBC")
private String id;
/**
* code
*/
private String code;
/**
* 类别id
*/
@Column(name = "category_id")
private String categoryId;
/**
* 标题
*/
private String title;
/**
* 阅读次数
*/
@Column(name = "read_number")
private Integer readNumber;
/**
* 次序(置顶功能)
*/
@Column(name = "top_num")
private Integer topNum;
@Column(name = "create_by")
private String createBy;
@Column(name = "update_by")
private String updateBy;
@Column(name = "create_date")
private Date createDate;
@Column(name = "update_date")
private Date updateDate;
/**
* 文章内容
*/
private String content;
/**
* @return id
*/
public String getId() {
return id;
}
/**
* @param id
*/
public void setId(String id) {
this.id = id == null ? null : id.trim();
}
/**
* 获取code
*
* @return code - code
*/
public String getCode() {
return code;
}
/**
* 设置code
*
* @param code code
*/
public void setCode(String code) {
this.code = code == null ? null : code.trim();
}
/**
* 获取类别id
*
* @return category_id - 类别id
*/
public String getCategoryId() {
return categoryId;
}
/**
* 设置类别id
*
* @param categoryId 类别id
*/
public void setCategoryId(String categoryId) {
this.categoryId = categoryId == null ? null : categoryId.trim();
}
/**
* 获取标题
*
* @return title - 标题
*/
public String getTitle() {
return title;
}
/**
* 设置标题
*
* @param title 标题
*/
public void setTitle(String title) {
this.title = title == null ? null : title.trim();
}
/**
* 获取阅读次数
*
* @return read_number - 阅读次数
*/
public Integer getReadNumber() {
return readNumber;
}
/**
* 设置阅读次数
*
* @param readNumber 阅读次数
*/
public void setReadNumber(Integer readNumber) {
this.readNumber = readNumber;
}
/**
* 获取次序(置顶功能)
*
* @return top_num - 次序(置顶功能)
*/
public Integer getTopNum() {
return topNum;
}
/**
* 设置次序(置顶功能)
*
* @param topNum 次序(置顶功能)
*/
public void setTopNum(Integer topNum) {
this.topNum = topNum;
}
/**
* @return create_by
*/
public String getCreateBy() {
return createBy;
}
/**
* @param createBy
*/
public void setCreateBy(String createBy) {
this.createBy = createBy == null ? null : createBy.trim();
}
/**
* @return update_by
*/
public String getUpdateBy() {
return updateBy;
}
/**
* @param updateBy
*/
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy == null ? null : updateBy.trim();
}
/**
* @return create_date
*/
public Date getCreateDate() {
return createDate;
}
/**
* @param createDate
*/
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
/**
* @return update_date
*/
public Date getUpdateDate() {
return updateDate;
}
/**
* @param updateDate
*/
public void setUpdateDate(Date updateDate) {
this.updateDate = updateDate;
}
/**
* 获取文章内容
*
* @return content - 文章内容
*/
public String getContent() {
return content;
}
/**
* 设置文章内容
*
* @param content 文章内容
*/
public void setContent(String content) {
this.content = content == null ? null : content.trim();
}
}

View File

@ -0,0 +1,163 @@
package com.len.entity;
import java.util.Date;
import javax.persistence.*;
@Table(name = "blog_category")
public class BlogCategory {
@Id
@GeneratedValue(generator = "JDBC")
private String id;
/**
* 搜索code
*/
private String code;
/**
* 类别名称
*/
private String name;
/**
* 上层id(目前最多两次层)
*/
@Column(name = "parent_id")
private String parentId;
@Column(name = "create_by")
private String createBy;
@Column(name = "update_by")
private String updateBy;
@Column(name = "create_date")
private Date createDate;
@Column(name = "update_date")
private Date updateDate;
/**
* @return id
*/
public String getId() {
return id;
}
/**
* @param id
*/
public void setId(String id) {
this.id = id == null ? null : id.trim();
}
/**
* 获取搜索code
*
* @return code - 搜索code
*/
public String getCode() {
return code;
}
/**
* 设置搜索code
*
* @param code 搜索code
*/
public void setCode(String code) {
this.code = code == null ? null : code.trim();
}
/**
* 获取类别名称
*
* @return name - 类别名称
*/
public String getName() {
return name;
}
/**
* 设置类别名称
*
* @param name 类别名称
*/
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
/**
* 获取上层id(目前最多两次层)
*
* @return parent_id - 上层id(目前最多两次层)
*/
public String getParentId() {
return parentId;
}
/**
* 设置上层id(目前最多两次层)
*
* @param parentId 上层id(目前最多两次层)
*/
public void setParentId(String parentId) {
this.parentId = parentId == null ? null : parentId.trim();
}
/**
* @return create_by
*/
public String getCreateBy() {
return createBy;
}
/**
* @param createBy
*/
public void setCreateBy(String createBy) {
this.createBy = createBy == null ? null : createBy.trim();
}
/**
* @return update_by
*/
public String getUpdateBy() {
return updateBy;
}
/**
* @param updateBy
*/
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy == null ? null : updateBy.trim();
}
/**
* @return create_date
*/
public Date getCreateDate() {
return createDate;
}
/**
* @param createDate
*/
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
/**
* @return update_date
*/
public Date getUpdateDate() {
return updateDate;
}
/**
* @param updateDate
*/
public void setUpdateDate(Date updateDate) {
this.updateDate = updateDate;
}
}

View File

@ -0,0 +1,72 @@
package com.len.entity;
import javax.persistence.*;
@Table(name = "blog_tag")
public class BlogTag {
@Id
@GeneratedValue(generator = "JDBC")
private String id;
/**
* 标签code
*/
@Column(name = "tag_code")
private String tagCode;
/**
* 标签name
*/
@Column(name = "tag_name")
private String tagName;
/**
* @return id
*/
public String getId() {
return id;
}
/**
* @param id
*/
public void setId(String id) {
this.id = id == null ? null : id.trim();
}
/**
* 获取标签code
*
* @return tag_code - 标签code
*/
public String getTagCode() {
return tagCode;
}
/**
* 设置标签code
*
* @param tagCode 标签code
*/
public void setTagCode(String tagCode) {
this.tagCode = tagCode == null ? null : tagCode.trim();
}
/**
* 获取标签name
*
* @return tag_name - 标签name
*/
public String getTagName() {
return tagName;
}
/**
* 设置标签name
*
* @param tagName 标签name
*/
public void setTagName(String tagName) {
this.tagName = tagName == null ? null : tagName.trim();
}
}

View File

@ -0,0 +1,7 @@
package com.len.mapper;
import com.len.base.BaseMapper;
import com.len.entity.ArticleCategory;
public interface ArticleCategoryMapper extends BaseMapper<ArticleCategory, String> {
}

View File

@ -0,0 +1,7 @@
package com.len.mapper;
import com.len.base.BaseMapper;
import com.len.entity.BlogArticle;
public interface BlogArticleMapper extends BaseMapper<BlogArticle, String> {
}

View File

@ -0,0 +1,7 @@
package com.len.mapper;
import com.len.base.BaseMapper;
import com.len.entity.BlogCategory;
public interface BlogCategoryMapper extends BaseMapper<BlogCategory, String> {
}

View File

@ -0,0 +1,7 @@
package com.len.mapper;
import com.len.base.BaseMapper;
import com.len.entity.BlogTag;
public interface BlogTagMapper extends BaseMapper<BlogTag, String> {
}

View File

@ -0,0 +1,12 @@
<?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.len.mapper.ArticleCategoryMapper">
<resultMap id="BaseResultMap" type="com.len.entity.ArticleCategory">
<!--
WARNING - @mbg.generated
-->
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="article_id" jdbcType="VARCHAR" property="articleId" />
<result column="tag_id" jdbcType="VARCHAR" property="tagId" />
</resultMap>
</mapper>

View File

@ -0,0 +1,31 @@
<?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.len.mapper.BlogArticleMapper">
<resultMap id="BaseResultMap" type="com.len.entity.BlogArticle">
<!--
WARNING - @mbg.generated
-->
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="code" jdbcType="VARCHAR" property="code" />
<result column="category_id" jdbcType="VARCHAR" property="categoryId" />
<result column="title" jdbcType="VARCHAR" property="title" />
<result column="read_number" jdbcType="INTEGER" property="readNumber" />
<result column="top_num" jdbcType="INTEGER" property="topNum" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
<result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
<result column="update_date" jdbcType="TIMESTAMP" property="updateDate" />
<result column="content" jdbcType="LONGVARCHAR" property="content" />
</resultMap>
<select id="selectListByPage" parameterType="com.len.entity.BlogArticle" resultMap="BaseResultMap">
SELECT id,code,category_id,title,read_number,top_num
from blog_article
<where>
<if test="title!=null and title!=''"> and job_name like '%${title}%'</if>
<if test="content!=null and content!=''"> and clazz_path like '%${content}%'</if>
</where>
order by read_number asc,create_date desc
</select>
</mapper>

View File

@ -0,0 +1,17 @@
<?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.len.mapper.BlogCategoryMapper">
<resultMap id="BaseResultMap" type="com.len.entity.BlogCategory">
<!--
WARNING - @mbg.generated
-->
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="code" jdbcType="VARCHAR" property="code" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="parent_id" jdbcType="VARCHAR" property="parentId" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
<result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
<result column="update_date" jdbcType="TIMESTAMP" property="updateDate" />
</resultMap>
</mapper>

View File

@ -0,0 +1,12 @@
<?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.len.mapper.BlogTagMapper">
<resultMap id="BaseResultMap" type="com.len.entity.BlogTag">
<!--
WARNING - @mbg.generated
-->
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="tag_code" jdbcType="VARCHAR" property="tagCode" />
<result column="tag_name" jdbcType="VARCHAR" property="tagName" />
</resultMap>
</mapper>