从"Blog"仓库中分离出来

This commit is contained in:
小海
2019-11-28 19:18:16 +08:00
commit 16cc30f513
119 changed files with 11291 additions and 0 deletions

View File

@@ -0,0 +1,75 @@
server.port=8081
spring.jpa.show-sql=false
spring.jpa.hibernate.ddl-auto=update
# 上传单个文件的大小
spring.servlet.multipart.max-file-size=10MB
# 上传文件的总大小
spring.servlet.multipart.max-request-size=10MB
##null字段不显示
spring.jackson.default-property-inclusion=non_null
################# 数据库 ##################
#请先填写下面的配置
spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
spring.datasource.url=
spring.datasource.username=
spring.datasource.password=
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
################## mybatis ##################
mybatis.mapper-locations=classpath:mapper/*.xml
mybatis.type-aliases-package=cn.celess.blog.entity
pagehelper.helper-dialect=mysql
pagehelper.reasonable=true
pagehelper.support-methods-arguments=true
pagehelper.params=count=countSql
################ email ##############
#请先填写下面的配置,不然可能运行不起来
spring.mail.host=
spring.mail.username=
spring.mail.password=
spring.mail.properties.mail.smtp.auth=true
spring.mail.properties.mail.smtp.starttls.enable=true
spring.mail.properties.mail.smtp.starttls.required=true
spring.mail.default-encoding=UTF-8
spring.mail.port=465
spring.mail.properties.mail.smtp.socketFactory.port=465
spring.mail.properties.mail.smtp.socketFactory.class=javax.net.ssl.SSLSocketFactory
spring.mail.properties.mail.smtp.socketFactory.fallback=false
#### 用于nginx的代理 获取真实ip
server.use-forward-headers = true
server.tomcat.remote-ip-header = X-Real-IP
server.tomcat.protocol-header = X-Forwarded-Proto
############### redis ##############
# REDIS (RedisProperties)
# Redis数据库索引默认为0
spring.redis.database=0
# Redis服务器地址
spring.redis.host=
# Redis服务器连接端口
spring.redis.port=6379
# Redis服务器连接密码默认为空
spring.redis.password=
# 连接池最大连接数(使用负值表示没有限制)
spring.redis.jedis.pool.max-active=-1
# 连接池最大阻塞等待时间(使用负值表示没有限制)
spring.redis.jedis.pool.max-wait=-1
# 连接池中的最大空闲连接
spring.redis.jedis.pool.max-idle=8
# 连接池中的最小空闲连接
spring.redis.jedis.pool.min-idle=0
# 连接超时时间(毫秒)
spring.redis.timeout=5000

View File

@@ -0,0 +1,80 @@
server.port=8081
sitemap.path=C:\\Users\\zh564\\Desktop\\sitemap.xml
##spring.jpa.show-sql=false
##spring.jpa.hibernate.ddl-auto=update
mybatis.type-handlers-package=cn.celess.blog.mapper.typehandler
# 上传单个文件的大小
spring.servlet.multipart.max-file-size=10MB
# 上传文件的总大小
spring.servlet.multipart.max-request-size=10MB
spring.jackson.default-property-inclusion=non_null
################# 数据库 ##################
spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
spring.datasource.url=jdbc:mysql://localhost:3306/test_blog?serverTimezone=UCT&allowPublicKeyRetrieval=true&useSSL=false
spring.datasource.username=root
spring.datasource.password=zhenghai
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
################## mybatis ##################
mybatis.mapper-locations=classpath:mapper/*.xml
mybatis.type-aliases-package=cn.celess.blog.entity
pagehelper.helper-dialect=mysql
pagehelper.reasonable=true
pagehelper.support-methods-arguments=true
pagehelper.params=count=countSql
#### 用于nginx的代理 获取真实ip
server.use-forward-headers = true
server.tomcat.remote-ip-header = X-Real-IP
server.tomcat.protocol-header = X-Forwarded-Proto
############### email ##############
spring.mail.host=smtp.163.com
spring.mail.username=
spring.mail.password=
spring.mail.properties.mail.smtp.auth=true
spring.mail.properties.mail.smtp.starttls.enable=true
spring.mail.properties.mail.smtp.starttls.required=true
spring.mail.default-encoding=UTF-8
spring.mail.port=465
spring.mail.properties.mail.smtp.socketFactory.port=465
spring.mail.properties.mail.smtp.socketFactory.class=javax.net.ssl.SSLSocketFactory
spring.mail.properties.mail.smtp.socketFactory.fallback=false
############### redis ##############
# REDIS (RedisProperties)
# Redis数据库索引默认为0
spring.redis.database=1
# Redis服务器地址
spring.redis.host=127.0.0.1
# Redis服务器连接端口
spring.redis.port=6379
# Redis服务器连接密码默认为空
spring.redis.password=
# 连接池最大连接数(使用负值表示没有限制)
spring.redis.jedis.pool.max-active=-1
# 连接池最大阻塞等待时间(使用负值表示没有限制)
spring.redis.jedis.pool.max-wait=-1
# 连接池中的最大空闲连接
spring.redis.jedis.pool.max-idle=8
# 连接池中的最小空闲连接
spring.redis.jedis.pool.min-idle=0
# 连接超时时间(毫秒)
spring.redis.timeout=5000

View File

@@ -0,0 +1,5 @@
spring.profiles.active=prod
####七牛的配置
####cn.celess.blog.service.serviceimpl.QiniuServiceImpl
logging.level.cn.celess.blog=debug
logging.level.cn.celess.blog.mapper=info

View File

@@ -0,0 +1,84 @@
<?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="cn.celess.blog.mapper.CategoryMapper">
<resultMap id="categoryResultMap" type="cn.celess.blog.entity.Category">
<id column="c_id" property="id"/>
<result column="c_name" property="name"/>
</resultMap>
<insert id="insert">
insert into category (c_name, articles)
values (#{name}, #{articles});
<selectKey resultType="java.lang.Long" keyProperty="id">
SELECT LAST_INSERT_ID() AS id
</selectKey>
</insert>
<update id="update">
update category
set c_name=#{name},
articles=#{articles}
where c_id = #{id}
</update>
<delete id="delete">
delete
from category
where c_id = #{id}
</delete>
<select id="findCategoryByName" resultMap="categoryResultMap">
select *
from category
where c_name = #{name}
</select>
<select id="findCategoryById" resultMap="categoryResultMap">
select *
from category
where c_id = #{id}
</select>
<select id="findAll" resultMap="categoryResultMap">
select *
from category
</select>
<select id="getAllName" resultType="java.lang.String">
select c_name
from category
</select>
<select id="getNameById" resultType="java.lang.String">
select c_name
from category
where c_id = #{id}
</select>
<select id="getIDByName" resultType="java.lang.Long">
select c_id
from category
where c_name = #{name}
</select>
<select id="existsByName" resultType="java.lang.Boolean">
SELECT EXISTS(SELECT * FROM category WHERE c_name = #{name})
</select>
<select id="existsById" resultType="java.lang.Boolean">
SELECT EXISTS(SELECT * FROM category WHERE c_id = #{id})
</select>
<select id="getLastestCategory" resultMap="categoryResultMap">
select *
from category
order by c_id desc
limit 1;
</select>
<select id="count" resultType="java.lang.Long">
select count(*)
from category;
</select>
</mapper>

View File

@@ -0,0 +1,98 @@
<?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="cn.celess.blog.mapper.CommentMapper">
<resultMap id="commentResultMap" type="cn.celess.blog.entity.Comment">
<id column="co_id" property="id"/>
<result column="co_article_id" property="articleID"/>
<result column="is_comment" property="type"/>
<result column="author_id" property="authorID"/>
<result column="co_content" property="content"/>
<result column="co_date" property="date"/>
<result column="co_pid" property="pid"/>
<result column="co_response_id" property="responseId"/>
</resultMap>
<insert id="insert">
insert into comment (co_article_id, is_comment, author_id, co_content, co_date, co_pid)
VALUES (#{articleID}, #{type}, #{authorID}, #{content}, #{date}, #{pid})
<selectKey resultType="java.lang.Long" keyProperty="id">
SELECT LAST_INSERT_ID() AS id
</selectKey>
</insert>
<update id="updateContent">
update comment
set co_content=#{content}
where co_id = #{id}
</update>
<update id="updateResponder">
update comment
set co_response_id =#{responder}
where co_id = #{id}
</update>
<delete id="delete">
delete
from comment
where co_id = #{id}
</delete>
<delete id="deleteByArticleId">
delete
from comment
where co_article_id = #{articleId}
</delete>
<select id="existsById" resultType="java.lang.Boolean">
SELECT EXISTS(SELECT * FROM comment WHERE co_id = #{id})
</select>
<select id="findCommentById" resultMap="commentResultMap">
select *
from comment
where co_id = #{id}
</select>
<select id="findAllByAuthorIDAndType" resultMap="commentResultMap">
select *
from comment
where author_id = #{id}
and is_comment = #{isComment}
</select>
<select id="findAllByPId" resultMap="commentResultMap">
select *
from comment
where co_pid = #{pid}
</select>
<select id="findAllByArticleID" resultMap="commentResultMap">
select *
from comment
where co_article_id = #{articleId}
</select>
<select id="findAllByArticleIDAndPId" resultMap="commentResultMap">
select *
from comment
where co_article_id = #{articleID}
and co_pid = #{pid}
</select>
<select id="findCommentsByTypeAndPId" resultMap="commentResultMap">
select *
from comment
where is_comment = #{isComment}
and co_pid = #{pid}
</select>
<select id="findAllByType" resultMap="commentResultMap">
select *
from comment
where is_comment = #{isComment}
</select>
<select id="countByType" resultType="java.lang.Long">
select count(*)
from comment
where is_comment = #{isComment}
</select>
<select id="getLastestComment" resultMap="commentResultMap">
select *
from comment
order by co_id desc
limit 1
</select>
</mapper>

View File

@@ -0,0 +1,76 @@
<?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="cn.celess.blog.mapper.PartnerMapper">
<resultMap id="partnerSiteResultMap" type="cn.celess.blog.entity.PartnerSite">
<id column="site_id" property="id"/>
<result column="site_name" property="name"/>
<result column="site_url" property="url"/>
<result column="is_open" property="open"/>
</resultMap>
<insert id="insert" parameterType="cn.celess.blog.entity.PartnerSite">
insert into links (site_name, is_open, site_url)
values (#{name}, #{open}, #{url})
<selectKey resultType="java.lang.Long" keyProperty="id">
SELECT LAST_INSERT_ID() AS id
</selectKey>
</insert>
<update id="update" parameterType="cn.celess.blog.entity.PartnerSite">
update links set
<if test="name!=null">site_name=#{name},</if>
<if test="url!=null">site_url=#{url},</if>
<if test="open!=null">is_open=#{open}</if>
where site_id=#{id}
</update>
<delete id="delete">
delete
from links
where site_id = #{id}
</delete>
<select id="existsById" resultType="boolean">
SELECT EXISTS(SELECT * FROM links WHERE site_id = #{id})
</select>
<select id="existsByName" resultType="boolean">
SELECT EXISTS(SELECT * FROM links WHERE site_name = #{name})
</select>
<select id="existsByUrl" resultType="boolean">
SELECT EXISTS(SELECT * FROM links WHERE site_url = #{url})
</select>
<select id="findById" resultMap="partnerSiteResultMap">
select *
from links
where site_id = #{id}
</select>
<select id="findByName" resultMap="partnerSiteResultMap">
select *
from links
where site_name = #{name}
</select>
<select id="findByUrl" resultMap="partnerSiteResultMap">
select *
from links
where site_url = #{url}
</select>
<select id="getLastest" resultMap="partnerSiteResultMap">
select *
from links
order by site_id desc
limit 1
</select>
<select id="findAll" resultMap="partnerSiteResultMap">
select *
from links
</select>
</mapper>

View File

@@ -0,0 +1,127 @@
<?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="cn.celess.blog.mapper.UserMapper">
<resultMap id="userResultMap" type="cn.celess.blog.entity.User">
<id column="u_id" property="id"/>
<result column="u_email" property="email"/>
<result column="u_uid" property="uid"/>
<result column="u_pwd" property="pwd"/>
<result column="email_status" property="emailStatus"/>
<result column="u_avatar" property="avatarImgUrl"/>
<result column="u_desc" property="desc"/>
<result column="recently_landed_time" property="recentlyLandedDate"/>
<result column="email_verify_id" property="emailVerifyId"/>
<result column="display_name" property="displayName"/>
<result column="role" property="role"/>
</resultMap>
<insert id="addUser">
insert into user(u_email, u_pwd)
values (#{email}, #{pwd})
</insert>
<update id="updateInfo">
update user set
<if test="desc!=null">`u_desc`=#{desc},</if>
<if test="displayName!=null">`display_name`=#{displayName}</if>
where u_id=#{id}
</update>
<update id="updateLoginTime">
update user
set `recently_landed_time`=#{date}
where `u_email` = #{email}
</update>
<update id="updateAvatarImgUrl">
update user
set `u_avatar`=#{avatarImgUrl}
where `u_id` = #{id}
</update>
<update id="updateEmailStatus">
update user
set `email_status`=#{status}
where `u_email` = #{email}
</update>
<update id="updatePwd">
update user
set `u_pwd`=#{pwd}
where `u_email` = #{email}
</update>
<update id="setUserRole">
update user
set role=#{role}
where u_id = #{uid}
</update>
<update id="update">
update user
set `u_email` = #{email},
`u_pwd` = #{pwd},
`email_status` = #{emailStatus},
`u_desc` = #{desc},
`display_name` = #{displayName},
`role` = #{role}
where `u_id` = #{id}
</update>
<delete id="delete">
delete
from user
where u_id = #{id}
</delete>
<select id="existsByEmail" resultType="java.lang.Boolean">
select exists(select * from user where u_email = #{email})
</select>
<select id="findByEmail" resultMap="userResultMap">
select *
from user
where u_email = #{email}
</select>
<select id="findById" resultMap="userResultMap">
select *
from user
where u_id = #{id}
</select>
<select id="getAvatarImgUrlById" resultType="string">
select u_avatar
from user
where u_id = #{id};
</select>
<select id="getEmail" resultType="java.lang.String">
select u_email
from user
where u_id = #{id}
</select>
<select id="getDisPlayName" resultType="java.lang.String">
select display_name
from user
where u_id = #{id}
</select>
<select id="getPwd" resultType="java.lang.String">
select u_pwd
from user
where u_email = #{email}
</select>
<select id="getRoleByEmail" resultType="java.lang.String">
select role
from user
where u_email = #{emai}
</select>
<select id="count" resultType="java.lang.Long">
select count(*)
from user
</select>
<select id="getRoleById" resultType="java.lang.String">
select role
from user
where u_id = #{id}
</select>
<select id="findAll" resultMap="userResultMap">
select *
from user
</select>
</mapper>

View File

@@ -0,0 +1,33 @@
<?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="cn.celess.blog.mapper.VisitorMapper">
<resultMap id="partnerSiteResultMap" type="cn.celess.blog.entity.Visitor">
<id column="v_id" property="id"/>
<result column="v_date" property="date"/>
<result column="v_user_agent" property="ua"/>
<result column="v_ip" property="ip"/>
</resultMap>
<insert id="insert">
insert into visitor (v_date, v_ip, v_user_agent)
values (#{date}, #{ip}, #{ua})
<selectKey resultType="java.lang.Long" keyProperty="id">
SELECT LAST_INSERT_ID() AS id
</selectKey>
</insert>
<delete id="delete">
delete
from visitor
where v_id = #{id}
</delete>
<select id="findAll" resultMap="partnerSiteResultMap">
select *
from visitor order by v_id desc
</select>
<select id="count" resultType="java.lang.Long">
select count(*)
from visitor
</select>
</mapper>

View File

@@ -0,0 +1,50 @@
<?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="cn.celess.blog.mapper.WebUpdateInfoMapper">
<resultMap id="webUpdateResultMap" type="cn.celess.blog.entity.WebUpdate">
<id column="update_id" property="id"/>
<result column="update_info" property="updateInfo"/>
<result column="update_time" property="updateTime"/>
</resultMap>
<insert id="insert" parameterType="cn.celess.blog.entity.WebUpdate">
insert into web_update(update_info, update_time)
values (#{updateInfo}, #{updateTime})
<selectKey resultType="java.lang.Long" keyProperty="id">
SELECT LAST_INSERT_ID() AS id
</selectKey>
</insert>
<update id="update">
update web_update
set update_info=#{info}
where update_id = #{id};
</update>
<delete id="delete">
delete
from web_update
where update_id = #{id}
</delete>
<select id="existsById" resultType="java.lang.Boolean">
select EXISTS(select * from web_update where update_id = #{id})
</select>
<select id="findById" resultMap="webUpdateResultMap">
select *
from web_update
where update_id = #{id}
</select>
<select id="findAll" resultMap="webUpdateResultMap">
select *
from web_update
</select>
<select id="getLastestOne" resultType="date">
select update_time
from web_update
order by update_id desc
limit 1
</select>
</mapper>

View File

@@ -0,0 +1,163 @@
<?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="cn.celess.blog.mapper.ArticleMapper">
<resultMap id="articleResultMap" type="cn.celess.blog.entity.Article">
<id column="a_id" property="id"/>
<result column="a_title" property="title"/>
<result column="a_summary" property="summary"/>
<result column="a_md_content" property="mdContent"/>
<result column="a_tags_id" property="tagsId"/>
<result column="a_category_id" property="categoryId"/>
<result column="a_url" property="url"/>
<result column="a_author_id" property="authorId"/>
<result column="a_is_open" property="open"/>
<result column="a_is_original" property="type"/>
<result column="next_a_id" property="nextArticleId"/>
<result column="pre_a_id" property="preArticleId"/>
<result column="a_reading_number" property="readingNumber"/>
<result column="a_publish_date" property="publishDate"/>
<result column="a_update_date" property="updateDate"/>
</resultMap>
<insert id="insert" parameterType="cn.celess.blog.entity.Article">
insert into article (a_author_id, a_category_id, a_tags_id, a_md_content, a_publish_date,
a_summary, a_title, a_url)
values (#{authorId}, #{categoryId}, #{tagsId}, #{mdContent}, #{publishDate},
#{summary}, #{title}, #{url})
<selectKey resultType="java.lang.Long" keyProperty="id">
SELECT LAST_INSERT_ID() AS id
</selectKey>
</insert>
<delete id="delete">
delete
from article
where a_id = #{id}
</delete>
<update id="update">
update article
set
<if test="title!=null">a_title=#{title},</if>
<if test="mdContent!=null">a_md_content=#{mdContent},</if>
<if test="summary!=null">a_summary=#{summary},</if>
<if test="type!=null">a_is_original=#{type},</if>
<if test="url!=null">a_url=#{url},</if>
<if test="updateDate!=null">a_update_date=#{updateDate},</if>
<if test="categoryId!=null">a_category_id=#{categoryId},</if>
<if test="tagsId!=null">a_tags_id=#{tagsId},</if>
<if test="nextArticleId!=null">next_a_id=#{nextArticleId},</if>
<if test="preArticleId!=null">pre_a_id=#{preArticleId},</if>
<if test="open!=null">a_is_open=#{open}</if>
where a_id = #{id}
</update>
<update id="updateNextArticleId">
update article
set next_a_id=#{nextArticleID}
where a_id = #{targetArticleID}
</update>
<update id="updatePreArticleId">
update article
set pre_a_id=#{preArticleID}
where a_id = #{targetArticleID}
</update>
<update id="setReadingNumber">
update article
set a_reading_number=#{number}
where a_id = #{id}
</update>
<select id="getLastestArticleId" resultType="long">
select a_id
from article
order by a_id desc
limit 1
</select>
<select id="getLastestArticle" resultMap="articleResultMap" resultType="cn.celess.blog.entity.Article">
select *
from article
order by a_id desc
limit 1
</select>
<select id="findArticleById" resultMap="articleResultMap">
select *
from article
where a_id = #{id}
</select>
<select id="existsByTitle" resultType="boolean">
SELECT EXISTS(SELECT * FROM article WHERE a_title = #{title})
</select>
<select id="existsById" resultType="boolean">
SELECT EXISTS(SELECT * FROM article WHERE a_id = #{id})
</select>
<select id="findAllByAuthorId" resultMap="articleResultMap">
select *
from article
where a_author_id = #{authorID}
order by a_id desc
</select>
<select id="findAllByOpen" resultMap="articleResultMap">
select *
from article
where a_is_open = #{isOpen}
order by a_id desc
</select>
<select id="getTitleById" resultType="string">
SELECT a_title
from article
where a_id = #{id}
</select>
<select id="findAllByCategoryId" resultMap="articleResultMap">
select a_id, a_title, a_summary
from article
where a_category_id = #{id}
order by a_id desc
</select>
<select id="findAll" resultMap="articleResultMap">
select *
from article
order by a_id desc
</select>
<select id="getSimpleInfo" resultMap="articleResultMap">
select a_id, a_summary, a_title
from article
where a_id = #{id}
</select>
<select id="getSimpleInfoByCategory" resultMap="articleResultMap">
select a_id, a_summary, a_title
from article
where a_category_id = #{categoryId}
order by a_id desc
</select>
<select id="getSimpleInfoByTag" resultMap="articleResultMap">
Select
a_id, a_summary, a_title
from article where a_id in
<foreach item="item" index="index" collection="list" open="(" separator="," close=")">
#{item}
</foreach>
order by a_id desc
</select>
<select id="count" resultType="long">
select count(*)
from article;
</select>
</mapper>

View File

@@ -0,0 +1,75 @@
<?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="cn.celess.blog.mapper.TagMapper">
<resultMap id="tagResultMap" type="cn.celess.blog.entity.Tag">
<id column="tag_id" property="id"/>
<result column="tag_name" property="name"/>
</resultMap>
<insert id="insert">
insert into tag (tag_name, articles)
VALUES (#{name}, #{articles});
<selectKey resultType="java.lang.Long" keyProperty="id">
SELECT LAST_INSERT_ID() AS id
</selectKey>
</insert>
<update id="update">
update tag
set tag_name=#{name},
articles=#{articles}
where tag_id = #{id}
</update>
<delete id="delete">
delete
from tag
where tag_id = #{id}
</delete>
<select id="findTagById" resultMap="tagResultMap">
select *
from tag
where tag_id = #{id}
</select>
<select id="findTagByName" resultMap="tagResultMap">
select *
from tag
where tag_name = #{name}
</select>
<select id="existsByName" resultType="boolean">
SELECT EXISTS(SELECT * FROM tag WHERE tag_name = #{name})
</select>
<select id="getIDByName" resultType="long">
select tag_id
from tag
where tag_name = #{name}
</select>
<select id="getNameById" resultType="string">
select tag_name
from tag
where tag_id = #{id}
</select>
<select id="getLastestTag" resultMap="tagResultMap">
select *
from tag
order by tag_id desc
limit 1
</select>
<select id="findAll" resultMap="tagResultMap">
select *
from tag
</select>
<select id="count" resultType="long">
select count(*)
from tag;
</select>
</mapper>