This commit is contained in:
王鹏
2025-08-14 14:59:52 +08:00
commit e528aa4876
1229 changed files with 230350 additions and 0 deletions

View File

@@ -0,0 +1,191 @@
<?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.cms.blog.mapper.CmsBlogMapper">
<resultMap type="CmsBlog" id="CmsBlogResult">
<result property="id" column="id" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="title" column="title" />
<result property="type" column="type" />
<result property="content" column="content" />
<result property="contentType" column="content_type" />
<result property="contentMarkdown" column="content_markdown" />
<result property="top" column="Top" />
<result property="views" column="views" />
<result property="status" column="status" />
<result property="blogPicType" column="blog_pic_type" />
<result property="blogPic" column="blog_pic" />
<result property="blogPicLink" column="blog_pic_link" />
<result property="blogDesc" column="blog_desc" />
<result property="blogFiles" column="blog_files" />
</resultMap>
<sql id="selectCmsBlogVo">
select id, create_by, create_time, update_by, update_time, title, type, content, content_type, content_markdown, Top, views, status, blog_pic_type, blog_pic, blog_pic_link, blog_desc, blog_files from cms_blog
</sql>
<select id="selectCmsBlogList" parameterType="CmsBlog" resultMap="CmsBlogResult">
<include refid="selectCmsBlogVo"/>
<where>
<if test="title != null and title != ''"> and title like concat('%', #{title}, '%')</if>
<if test="type != null and type != ''"> and type = #{type}</if>
<if test="content != null and content != ''"> and content = #{content}</if>
<if test="top != null and top != ''"> and Top = #{top}</if>
<if test="views != null "> and views = #{views}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if>
</where>
ORDER BY Top DESC, create_time DESC
</select>
<select id="selectCmsBlogById" parameterType="Long" resultMap="CmsBlogResult">
<include refid="selectCmsBlogVo"/>
where id = #{id}
</select>
<select id="selectCmsBlogListByTypeId" parameterType="Long" resultMap="CmsBlogResult">
<include refid="selectCmsBlogVo"/>
<where>
<if test="id != null and id != ''"> and id in (SELECT blog_id FROM cms_blog_type WHERE type_id = #{id})</if>
</where>
</select>
<select id="selectCmsBlogListByTagId" parameterType="Long" resultMap="CmsBlogResult">
<include refid="selectCmsBlogVo"/>
<where>
<if test="id != null and id != ''"> and id in (SELECT blog_id FROM cms_blog_tag WHERE tag_id = #{id})</if>
</where>
</select>
<select id="selectCmsBlogListRecommend" parameterType="CmsBlog" resultMap="CmsBlogResult">
<include refid="selectCmsBlogVo"/>
<where>
<if test="title != null and title != ''"> and title like concat('%', #{title}, '%')</if>
<if test="type != null and type != ''"> and type = #{type}</if>
<if test="content != null and content != ''"> and content = #{content}</if>
<if test="top != null and top != ''"> and Top = #{top}</if>
<if test="views != null "> and views = #{views}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if>
</where>
ORDER BY views DESC, create_time DESC
</select>
<select id="selectCmsBlogListBetweenCreateTime" resultType="com.ruoyi.cms.blog.domain.CmsBlog">
<include refid="selectCmsBlogVo"/>
<where>
<if test="title != null and title != ''"> and title like concat('%', #{title}, '%')</if>
<if test="type != null and type != ''"> and type = #{type}</if>
<if test="top != null and top != ''"> and Top = #{top}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="createTimeBegin != null and createTimeBegin != ''"> and create_time >= #{createTimeBegin}</if>
<if test="createTimeEnd != null and createTimeEnd != ''"> and create_time &lt;= #{createTimeEnd}</if>
<if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if>
</where>
ORDER BY Top DESC, create_time DESC
</select>
<insert id="insertCmsBlog" parameterType="CmsBlog" useGeneratedKeys="true" keyProperty="id">
insert into cms_blog
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="title != null and title != ''">title,</if>
<if test="type != null and type != ''">type,</if>
<if test="content != null">content,</if>
<if test="contentType != null and contentType != ''">content_type,</if>
<if test="contentMarkdown != null">content_markdown,</if>
<if test="top != null">Top,</if>
<if test="views != null">views,</if>
<if test="status != null">status,</if>
<if test="blogPicType != null">blog_pic_type,</if>
<if test="blogPic != null and blogPic != ''">blog_pic,</if>
<if test="blogPicLink != null and blogPicLink != ''">blog_pic_link,</if>
<if test="blogDesc != null and blogDesc != ''">blog_desc,</if>
<if test="blogFiles != null and blogFiles != ''">blog_files,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="title != null and title != ''">#{title},</if>
<if test="type != null and type != ''">#{type},</if>
<if test="content != null">#{content},</if>
<if test="contentType != null and contentType != ''">#{contentType},</if>
<if test="contentMarkdown != null">#{contentMarkdown},</if>
<if test="top != null">#{top},</if>
<if test="views != null">#{views},</if>
<if test="status != null">#{status},</if>
<if test="blogPicType != null">#{blogPicType},</if>
<if test="blogPic != null and blogPic != ''">#{blogPic},</if>
<if test="blogPicLink != null and blogPicLink != ''">#{blogPicLink},</if>
<if test="blogDesc != null and blogDesc != ''">#{blogDesc},</if>
<if test="blogFiles != null and blogFiles != ''">#{blogFiles},</if>
</trim>
</insert>
<update id="updateCmsBlog" parameterType="CmsBlog">
update cms_blog
<trim prefix="SET" suffixOverrides=",">
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="title != null and title != ''">title = #{title},</if>
<if test="type != null and type != ''">type = #{type},</if>
<if test="content != null">content = #{content},</if>
<if test="contentType != null and contentType != ''">content_type = #{contentType},</if>
<if test="contentMarkdown != null">content_markdown = #{contentMarkdown},</if>
<if test="top != null">Top = #{top},</if>
<if test="views != null">views = #{views},</if>
<if test="status != null">status = #{status},</if>
<if test="blogPicType != null">blog_pic_type = #{blogPicType},</if>
<if test="blogPic != null">blog_pic = #{blogPic},</if>
<if test="blogPicLink != null">blog_pic_link = #{blogPicLink},</if>
<if test="blogDesc != null">blog_desc = #{blogDesc},</if>
<if test="blogFiles != null">blog_files = #{blogFiles},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteCmsBlogById" parameterType="Long">
delete from cms_blog where id = #{id}
</delete>
<delete id="deleteCmsBlogByIds" parameterType="String">
delete from cms_blog where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="countCmsBlog" parameterType="CmsBlog" resultType="int">
select count(*) from cms_blog
<where>
<if test="title != null and title != ''"> and title like concat('%', #{title}, '%')</if>
<if test="type != null and type != ''"> and type = #{type}</if>
<if test="content != null and content != ''"> and content = #{content}</if>
<if test="top != null and top != ''"> and Top = #{top}</if>
<if test="views != null "> and views = #{views}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if>
</where>
</select>
<select id="sumViews" parameterType="CmsBlog" resultType="long">
select COALESCE(sum(views), 0) from cms_blog
<where>
<if test="title != null and title != ''"> and title like concat('%', #{title}, '%')</if>
<if test="type != null and type != ''"> and type = #{type}</if>
<if test="content != null and content != ''"> and content = #{content}</if>
<if test="top != null and top != ''"> and Top = #{top}</if>
<if test="views != null "> and views = #{views}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if>
</where>
</select>
</mapper>

View File

@@ -0,0 +1,36 @@
<?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.cms.blog.mapper.CmsBlogTagMapper">
<resultMap type="cmsBlogTag" id="blogTagResult">
<result property="tagId" column="tag_id" />
<result property="blogId" column="blog_id" />
</resultMap>
<insert id="batchBlogTag">
insert into cms_blog_tag(tag_id, blog_id) values
<foreach item="item" index="index" collection="list" separator=",">
(#{item.tagId},#{item.blogId})
</foreach>
</insert>
<delete id="deleteBlogTagByBlogId" parameterType="Long">
delete from cms_blog_tag where blog_id=#{blogId}
</delete>
<delete id="deleteBlogTag" parameterType="Long">
delete from cms_blog_tag where blog_id in
<foreach collection="array" item="blogId" open="(" separator="," close=")">
#{blogId}
</foreach>
</delete>
<delete id="deleteBlogTagByTagId" parameterType="Long">
delete from cms_blog_tag where tag_id=#{tagId}
</delete>
<select id="selectBlogTagList" parameterType="Long" resultMap="blogTagResult">
select tag_id, blog_id from cms_blog_tag where blog_id = #{blogId}
</select>
<select id="countBlogByTagId" parameterType="Long" resultType="java.lang.Integer">
select count(*) from cms_blog_tag where tag_id=#{tagId}
</select>
</mapper>

View File

@@ -0,0 +1,36 @@
<?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.cms.blog.mapper.CmsBlogTypeMapper">
<resultMap type="CmsBlogType" id="blogTypeResult">
<result property="typeId" column="type_id" />
<result property="blogId" column="blog_id" />
</resultMap>
<insert id="batchBlogType">
insert into cms_blog_type(type_id, blog_id) values
<foreach item="item" index="index" collection="list" separator=",">
(#{item.typeId},#{item.blogId})
</foreach>
</insert>
<delete id="deleteBlogTypeByBlogId" parameterType="Long">
delete from cms_blog_type where blog_id=#{blogId}
</delete>
<delete id="deleteBlogType" parameterType="Long">
delete from cms_blog_type where blog_id in
<foreach collection="array" item="blogId" open="(" separator="," close=")">
#{blogId}
</foreach>
</delete>
<delete id="deleteBlogTypeByTypeId" parameterType="Long">
delete from cms_blog_type where type_id=#{typeId}
</delete>
<select id="selectBlogTypeList" parameterType="Long" resultMap="blogTypeResult">
select type_id, blog_id from cms_blog_type where blog_id = #{blogId}
</select>
<select id="countBlogByTypeId" parameterType="Long" resultType="java.lang.Integer">
select count(*) from cms_blog_type where type_id=#{typeId}
</select>
</mapper>

View File

@@ -0,0 +1,52 @@
<?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.cms.comment.mapper.CmsCommentLikeMapper">
<resultMap type="CmsCommentLike" id="commentLikeResult">
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="commentId" column="comment_id" />
<result property="userId" column="user_id" />
</resultMap>
<sql id="selectCmsMessageLikeVo">
select create_by, create_time, update_by, update_time, comment_id, user_id from cms_comment_like
</sql>
<select id="selectCmsCommentLikeList" parameterType="CmsCommentLike" resultMap="commentLikeResult">
<include refid="selectCmsMessageLikeVo"/>
<where>
<if test="commentId != null"> and comment_id = #{commentId}</if>
<if test="userId != null"> and user_id = #{userId}</if>
</where>
</select>
<insert id="addCmsCommentLike" parameterType="CmsCommentLike">
insert into cms_comment_like
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="commentId != null">comment_id,</if>
<if test="userId != null">user_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="commentId != null">#{commentId},</if>
<if test="userId != null">#{userId},</if>
</trim>
</insert>
<delete id="deleteCmsCommentLike" parameterType="CmsCommentLike">
delete from cms_comment_like
<where>
<if test="commentId != null"> and comment_id = #{commentId}</if>
<if test="userId != null"> and user_id = #{userId}</if>
</where>
</delete>
</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="com.ruoyi.cms.comment.mapper.CmsCommentMapper">
<resultMap type="CmsComment" id="CmsCommentResult">
<result property="id" column="id" />
<result property="parentId" column="parent_id" />
<result property="mainId" column="main_id" />
<result property="likeNum" column="like_num" />
<result property="content" column="content" />
<result property="type" column="type" />
<result property="blogId" column="blog_id" />
<result property="delFlag" column="del_flag" />
<result property="userId" column="user_id" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectCmsCommentVo">
select id, parent_id, main_id, like_num, content, type, blog_id, del_flag, user_id, create_by, create_time, update_by, update_time from cms_comment
</sql>
<select id="selectCmsCommentList" parameterType="CmsComment" resultMap="CmsCommentResult">
select c.id, c.parent_id, c.main_id, c.like_num, c.content, c.type, c.blog_id, c.del_flag, c.user_id, c.create_by, c.create_time, c.update_by, c.update_time from cms_comment c LEFT JOIN cms_blog b ON c.blog_id = b.id
<where>
<if test="parentId != null "> and c.parent_id = #{parentId}</if>
<if test="mainId != null "> and c.main_id = #{mainId}</if>
<if test="likeNum != null "> and c.like_num = #{likeNum}</if>
<if test="content != null and content != ''"> and c.content like concat('%', #{content}, '%')</if>
<if test="type != null and type != ''"> and c.type = #{type}</if>
<if test="blogId != null "> and c.blog_id = #{blogId}</if>
<if test="userId != null "> and c.user_id = #{userId}</if>
<if test="delFlag != null and delFlag != ''"> and c.del_flag = #{delFlag}</if>
<if test="createBy != null and createBy != ''"> and c.create_by = #{createBy}</if>
<if test="blogTitle != null and blogTitle != ''">
and b.title like concat('%', #{blogTitle}, '%')
</if>
</where>
ORDER BY c.create_time DESC
</select>
<select id="selectCmsCommentById" parameterType="Long" resultMap="CmsCommentResult">
<include refid="selectCmsCommentVo"/>
where id = #{id}
</select>
<select id="selectChildCommentList" parameterType="CmsComment" resultMap="CmsCommentResult">
<include refid="selectCmsCommentVo"/>
<where>
<if test="parentId != null "> and parent_id = #{parentId}</if>
<if test="mainId != null "> and main_id = #{mainId}</if>
<if test="likeNum != null "> and like_num = #{likeNum}</if>
<if test="content != null and content != ''"> and content like concat('%', #{content}, '%')</if>
<if test="type != null and type != ''"> and type = #{type}</if>
<if test="blogId != null "> and blog_id = #{blogId}</if>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="delFlag != null and delFlag != ''"> and del_flag = #{delFlag}</if>
<if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if>
</where>
ORDER BY create_time ASC
</select>
<select id="selectCmsCommentListBetweenCreateTime" resultType="com.ruoyi.cms.comment.domain.CmsComment">
<include refid="selectCmsCommentVo"/>
<where>
<if test="type != null and type != ''"> and type = #{type}</if>
<if test="delFlag != null and delFlag != ''"> and del_flag = #{delFlag}</if>
<if test="createTimeBegin != null and createTimeBegin != ''"> and create_time >= #{createTimeBegin}</if>
<if test="createTimeEnd != null and createTimeEnd != ''"> and create_time &lt;= #{createTimeEnd}</if>
</where>
</select>
<insert id="insertCmsComment" parameterType="CmsComment" useGeneratedKeys="true" keyProperty="id">
insert into cms_comment
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="parentId != null">parent_id,</if>
<if test="mainId != null">main_id,</if>
<if test="likeNum != null">like_num,</if>
<if test="content != null">content,</if>
<if test="type != null">type,</if>
<if test="blogId != null">blog_id,</if>
<if test="delFlag != null">del_flag,</if>
<if test="userId != null">user_id,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="parentId != null">#{parentId},</if>
<if test="mainId != null">#{mainId},</if>
<if test="likeNum != null">#{likeNum},</if>
<if test="content != null">#{content},</if>
<if test="type != null">#{type},</if>
<if test="blogId != null">#{blogId},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="userId != null">#{userId},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateCmsComment" parameterType="CmsComment">
update cms_comment
<trim prefix="SET" suffixOverrides=",">
<if test="parentId != null">parent_id = #{parentId},</if>
<if test="mainId != null">main_id = #{mainId},</if>
<if test="likeNum != null">like_num = #{likeNum},</if>
<if test="content != null">content = #{content},</if>
<if test="type != null">type = #{type},</if>
<if test="blogId != null">blog_id = #{blogId},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="userId != null">user_id = #{userId},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<update id="updateDelFlagById" parameterType="Long">
Update cms_comment Set del_flag = '1' where id = #{id}
</update>
<update id="updateDelFlagByIds" parameterType="Long">
Update cms_comment Set del_flag = '1' where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</update>
<delete id="deleteCmsCommentById" parameterType="Long">
delete from cms_comment where id = #{id}
</delete>
<delete id="deleteCmsCommentByIds" parameterType="String">
delete from cms_comment where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="countCmsComment" parameterType="CmsComment" resultType="int">
select count(*) from cms_comment c LEFT JOIN cms_blog b ON c.blog_id = b.id
<where>
<if test="parentId != null "> and c.parent_id = #{parentId}</if>
<if test="mainId != null "> and c.main_id = #{mainId}</if>
<if test="likeNum != null "> and c.like_num = #{likeNum}</if>
<if test="content != null and content != ''"> and c.content like concat('%', #{content}, '%')</if>
<if test="type != null and type != ''"> and c.type = #{type}</if>
<if test="blogId != null "> and c.blog_id = #{blogId}</if>
<if test="userId != null "> and c.user_id = #{userId}</if>
<if test="delFlag != null and delFlag != ''"> and c.del_flag = #{delFlag}</if>
<if test="createBy != null and createBy != ''"> and c.create_by = #{createBy}</if>
<if test="blogTitle != null and blogTitle != ''">
and b.title like concat('%', #{blogTitle}, '%')
</if>
</where>
</select>
</mapper>

View File

@@ -0,0 +1,52 @@
<?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.cms.message.mapper.CmsMessageLikeMapper">
<resultMap type="CmsMessageLike" id="messageLikeResult">
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="messageId" column="message_id" />
<result property="userId" column="user_id" />
</resultMap>
<sql id="selectCmsMessageLikeVo">
select create_by, create_time, update_by, update_time, message_id, user_id from cms_message_like
</sql>
<select id="selectCmsMessageLikeList" parameterType="CmsMessageLike" resultMap="messageLikeResult">
<include refid="selectCmsMessageLikeVo"/>
<where>
<if test="messageId != null"> and message_id = #{messageId}</if>
<if test="userId != null"> and user_id = #{userId}</if>
</where>
</select>
<insert id="addCmsMessageLike" parameterType="CmsMessageLike">
insert into cms_message_like
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="messageId != null">message_id,</if>
<if test="userId != null">user_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="messageId != null">#{messageId},</if>
<if test="userId != null">#{userId},</if>
</trim>
</insert>
<delete id="deleteCmsMessageLike" parameterType="CmsMessageLike">
delete from cms_message_like
<where>
<if test="messageId != null"> and message_id = #{messageId}</if>
<if test="userId != null"> and user_id = #{userId}</if>
</where>
</delete>
</mapper>

View File

@@ -0,0 +1,158 @@
<?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.cms.message.mapper.CmsMessageMapper">
<resultMap type="CmsMessage" id="CmsMessageResult">
<result property="id" column="id" />
<result property="parentId" column="parent_id" />
<result property="mainId" column="main_id" />
<result property="likeNum" column="like_num" />
<result property="content" column="content" />
<result property="type" column="type" />
<result property="blogId" column="blog_id" />
<result property="userId" column="user_id" />
<result property="delFlag" column="del_flag" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectCmsMessageVo">
select id, parent_id, main_id, like_num, content, type, blog_id, user_id, del_flag, create_by, create_time, update_by, update_time from cms_message
</sql>
<select id="selectCmsMessageList" parameterType="CmsMessage" resultMap="CmsMessageResult">
<include refid="selectCmsMessageVo"/>
<where>
<if test="parentId != null "> and parent_id = #{parentId}</if>
<if test="mainId != null "> and main_id = #{mainId}</if>
<if test="likeNum != null "> and like_num = #{likeNum}</if>
<if test="content != null and content != ''"> and content like concat('%', #{content}, '%')</if>
<if test="type != null and type != ''"> and type = #{type}</if>
<if test="blogId != null "> and blog_id = #{blogId}</if>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="delFlag != null and delFlag != ''"> and del_flag = #{delFlag}</if>
<if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if>
</where>
ORDER BY create_time DESC
</select>
<select id="selectChildMessageList" parameterType="CmsMessage" resultMap="CmsMessageResult">
<include refid="selectCmsMessageVo"/>
<where>
<if test="parentId != null "> and parent_id = #{parentId}</if>
<if test="mainId != null "> and main_id = #{mainId}</if>
<if test="likeNum != null "> and like_num = #{likeNum}</if>
<if test="content != null and content != ''"> and content like concat('%', #{content}, '%')</if>
<if test="type != null and type != ''"> and type = #{type}</if>
<if test="blogId != null "> and blog_id = #{blogId}</if>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="delFlag != null and delFlag != ''"> and del_flag = #{delFlag}</if>
<if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if>
</where>
ORDER BY create_time ASC
</select>
<select id="selectCmsMessageById" parameterType="Long" resultMap="CmsMessageResult">
<include refid="selectCmsMessageVo"/>
where id = #{id}
</select>
<select id="selectCmsMessageListBetweenCreateTime" resultType="com.ruoyi.cms.message.domain.CmsMessage">
<include refid="selectCmsMessageVo"/>
<where>
<if test="type != null and type != ''"> and type = #{type}</if>
<if test="delFlag != null and delFlag != ''"> and del_flag = #{delFlag}</if>
<if test="createTimeBegin != null and createTimeBegin != ''"> and create_time >= #{createTimeBegin}</if>
<if test="createTimeEnd != null and createTimeEnd != ''"> and create_time &lt;= #{createTimeEnd}</if>
</where>
</select>
<insert id="insertCmsMessage" parameterType="CmsMessage" useGeneratedKeys="true" keyProperty="id">
insert into cms_message
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="parentId != null">parent_id,</if>
<if test="mainId != null">main_id,</if>
<if test="likeNum != null">like_num,</if>
<if test="content != null">content,</if>
<if test="type != null">type,</if>
<if test="blogId != null">blog_id,</if>
<if test="userId != null">user_id,</if>
<if test="delFlag != null">del_flag,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="parentId != null">#{parentId},</if>
<if test="mainId != null">#{mainId},</if>
<if test="likeNum != null">#{likeNum},</if>
<if test="content != null">#{content},</if>
<if test="type != null">#{type},</if>
<if test="blogId != null">#{blogId},</if>
<if test="userId != null">#{userId},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateCmsMessage" parameterType="CmsMessage">
update cms_message
<trim prefix="SET" suffixOverrides=",">
<if test="parentId != null">parent_id = #{parentId},</if>
<if test="mainId != null">main_id = #{mainId},</if>
<if test="likeNum != null">like_num = #{likeNum},</if>
<if test="content != null">content = #{content},</if>
<if test="type != null">type = #{type},</if>
<if test="blogId != null">blog_id = #{blogId},</if>
<if test="userId != null">user_id = #{userId},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<update id="updateDelFlagById" parameterType="Long">
Update cms_message Set del_flag = '1' where id = #{id}
</update>
<update id="updateDelFlagByIds" parameterType="Long">
Update cms_message Set del_flag = '1' where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</update>
<delete id="deleteCmsMessageById" parameterType="Long">
delete from cms_message where id = #{id}
</delete>
<delete id="deleteCmsMessageByIds" parameterType="String">
delete from cms_message where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="countCmsMessage" parameterType="CmsMessage" resultType="int">
select count(*) from cms_message
<where>
<if test="parentId != null "> and parent_id = #{parentId}</if>
<if test="mainId != null "> and main_id = #{mainId}</if>
<if test="likeNum != null "> and like_num = #{likeNum}</if>
<if test="content != null and content != ''"> and content like concat('%', #{content}, '%')</if>
<if test="type != null and type != ''"> and type = #{type}</if>
<if test="blogId != null "> and blog_id = #{blogId}</if>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="delFlag != null and delFlag != ''"> and del_flag = #{delFlag}</if>
<if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if>
</where>
</select>
</mapper>

View File

@@ -0,0 +1,78 @@
<?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.cms.tag.mapper.CmsTagMapper">
<resultMap type="CmsTag" id="CmsTagResult">
<result property="tagId" column="tag_id" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="tagName" column="tag_name" />
</resultMap>
<sql id="selectCmsTagVo">
select tag_id, create_by, create_time, update_by, update_time, tag_name from cms_tag
</sql>
<select id="selectCmsTagList" parameterType="CmsTag" resultMap="CmsTagResult">
<include refid="selectCmsTagVo"/>
<where>
<if test="tagName != null and tagName != ''"> and tag_name like concat('%', #{tagName}, '%')</if>
<if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if>
</where>
ORDER BY create_time DESC
</select>
<select id="selectCmsTagByTagId" parameterType="Long" resultMap="CmsTagResult">
<include refid="selectCmsTagVo"/>
where tag_id = #{tagId}
</select>
<select id="selectCmsTagListByTagName" parameterType="String" resultMap="CmsTagResult">
<include refid="selectCmsTagVo"/>
where tag_name = #{tagName}
</select>
<insert id="insertCmsTag" parameterType="CmsTag" useGeneratedKeys="true" keyProperty="tagId">
insert into cms_tag
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="tagName != null and tagName != ''">tag_name,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="tagName != null and tagName != ''">#{tagName},</if>
</trim>
</insert>
<update id="updateCmsTag" parameterType="CmsTag">
update cms_tag
<trim prefix="SET" suffixOverrides=",">
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="tagName != null and tagName != ''">tag_name = #{tagName},</if>
</trim>
where tag_id = #{tagId}
</update>
<delete id="deleteCmsTagByTagId" parameterType="Long">
delete from cms_tag where tag_id = #{tagId}
</delete>
<delete id="deleteCmsTagByTagIds" parameterType="String">
delete from cms_tag where tag_id in
<foreach item="tagId" collection="array" open="(" separator="," close=")">
#{tagId}
</foreach>
</delete>
</mapper>

View File

@@ -0,0 +1,91 @@
<?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.cms.type.mapper.CmsTypeMapper">
<resultMap type="CmsType" id="CmsTypeResult">
<result property="typeId" column="type_id" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="typeName" column="type_name" />
<result property="typePicType" column="type_pic_type" />
<result property="typePic" column="type_pic" />
<result property="typePicLink" column="type_pic_link" />
</resultMap>
<sql id="selectCmsTypeVo">
select type_id, create_by, create_time, update_by, update_time, type_name, type_pic_type, type_pic, type_pic_link from cms_type
</sql>
<select id="selectCmsTypeList" parameterType="CmsType" resultMap="CmsTypeResult">
<include refid="selectCmsTypeVo"/>
<where>
<if test="typeName != null and typeName != ''"> and type_name like concat('%', #{typeName}, '%')</if>
<if test="typePic != null and typePic != ''"> and type_pic = #{typePic}</if>
<if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if>
</where>
ORDER BY create_time DESC
</select>
<select id="selectCmsTypeByTypeId" parameterType="Long" resultMap="CmsTypeResult">
<include refid="selectCmsTypeVo"/>
where type_id = #{typeId}
</select>
<select id="selectCmsTypeListByTypeName" parameterType="String" resultMap="CmsTypeResult">
<include refid="selectCmsTypeVo"/>
where type_name = #{typeName}
</select>
<insert id="insertCmsType" parameterType="CmsType" useGeneratedKeys="true" keyProperty="typeId">
insert into cms_type
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="typeName != null and typeName != ''">type_name,</if>
<if test="typePicType != null">type_pic_type,</if>
<if test="typePic != null">type_pic,</if>
<if test="typePicLink != null">type_pic_link,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="typeName != null and typeName != ''">#{typeName},</if>
<if test="typePicType != null">#{typePicType},</if>
<if test="typePic != null">#{typePic},</if>
<if test="typePicLink != null">#{typePicLink},</if>
</trim>
</insert>
<update id="updateCmsType" parameterType="CmsType">
update cms_type
<trim prefix="SET" suffixOverrides=",">
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="typeName != null and typeName != ''">type_name = #{typeName},</if>
<if test="typePicType != null">type_pic_type = #{typePicType},</if>
<if test="typePic != null">type_pic = #{typePic},</if>
<if test="typePicLink != null">type_pic_link = #{typePicLink},</if>
</trim>
where type_id = #{typeId}
</update>
<delete id="deleteCmsTypeByTypeId" parameterType="Long">
delete from cms_type where type_id = #{typeId}
</delete>
<delete id="deleteCmsTypeByTypeIds" parameterType="String">
delete from cms_type where type_id in
<foreach item="typeId" collection="array" open="(" separator="," close=")">
#{typeId}
</foreach>
</delete>
</mapper>

View File

@@ -0,0 +1,30 @@
<?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.cms.fileInfo.mapper.FileBlogInfoMapper">
<resultMap type="FileBlogInfo" id="FileBlogResult">
<result property="fileId" column="file_id" />
<result property="blogId" column="blog_id" />
</resultMap>
<insert id="batchFileBlog">
insert into cms_blog_file(file_id, blog_id) values
<foreach item="item" index="index" collection="list" separator=",">
(#{item.fileId},#{item.blogId})
</foreach>
</insert>
<delete id="deleteFileBlogByBlogId" parameterType="Long">
delete from cms_blog_file where blog_id=#{blogId}
</delete>
<delete id="deleteFileBlog" parameterType="Long">
delete from cms_blog_file where blog_id in
<foreach collection="array" item="blogId" open="(" separator="," close=")">
#{blogId}
</foreach>
</delete>
<select id="selectFileBlogList" parameterType="Long" resultMap="FileBlogResult">
select file_id, blog_id from cms_blog_file where blog_id = #{blogId}
</select>
</mapper>

View File

@@ -0,0 +1,30 @@
<?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.cms.fileInfo.mapper.FileNoticeInfoMapper">
<resultMap type="FileNoticeInfo" id="FileNoticeResult">
<result property="fileId" column="file_id" />
<result property="noticeId" column="notice_id" />
</resultMap>
<insert id="batchFileNotice">
insert into sys_notice_file(file_id, notice_id) values
<foreach item="item" index="index" collection="list" separator=",">
(#{item.fileId},#{item.noticeId})
</foreach>
</insert>
<delete id="deleteFileNoticeByNoticeId" parameterType="Long">
delete from sys_notice_file where notice_id=#{noticeId}
</delete>
<delete id="deleteFileNotice" parameterType="Long">
delete from sys_notice_file where notice_id in
<foreach collection="array" item="noticeId" open="(" separator="," close=")">
#{noticeId}
</foreach>
</delete>
<select id="selectFileNoticeList" parameterType="Long" resultMap="FileNoticeResult">
select file_id, notice_id from sys_notice_file where notice_id = #{noticeId}
</select>
</mapper>

View File

@@ -0,0 +1,105 @@
<?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.cms.fileInfo.mapper.SysFileInfoMapper">
<resultMap type="SysFileInfo" id="SysFileInfoResult">
<result property="fileId" column="file_id" />
<result property="fileOriginName" column="file_origin_name" />
<result property="fileSuffix" column="file_suffix" />
<result property="fileSizeInfo" column="file_size_info" />
<result property="fileObjectName" column="file_object_name" />
<result property="filePath" column="file_path" />
<result property="delFlag" column="del_flag" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectSysFileInfoVo">
select file_id, file_origin_name, file_suffix, file_size_info, file_object_name, file_path, del_flag, create_by, create_time, update_by, update_time from sys_file_info
</sql>
<select id="selectSysFileInfoList" parameterType="SysFileInfo" resultMap="SysFileInfoResult">
<include refid="selectSysFileInfoVo"/>
<where>
<if test="fileOriginName != null and fileOriginName != ''"> and file_origin_name like concat('%', #{fileOriginName}, '%')</if>
<if test="fileSuffix != null and fileSuffix != ''"> and file_suffix = #{fileSuffix}</if>
<if test="fileSizeInfo != null and fileSizeInfo != ''"> and file_size_info = #{fileSizeInfo}</if>
<if test="fileObjectName != null and fileObjectName != ''"> and file_object_name = #{fileObjectName}</if>
<if test="filePath != null and filePath != ''"> and file_path = #{filePath}</if>
<if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if>
</where>
ORDER BY create_time DESC
</select>
<select id="selectSysFileInfoByFileId" parameterType="Long" resultMap="SysFileInfoResult">
<include refid="selectSysFileInfoVo"/>
where file_id = #{fileId}
</select>
<select id="selectSysFileInfoByFileObjectName" parameterType="String" resultMap="SysFileInfoResult">
<include refid="selectSysFileInfoVo"/>
where file_object_name = #{fileObjectName}
</select>
<insert id="insertSysFileInfo" parameterType="SysFileInfo" useGeneratedKeys="true" keyProperty="fileId">
insert into sys_file_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="fileOriginName != null and fileOriginName != ''">file_origin_name,</if>
<if test="fileSuffix != null">file_suffix,</if>
<if test="fileSizeInfo != null">file_size_info,</if>
<if test="fileObjectName != null">file_object_name,</if>
<if test="filePath != null">file_path,</if>
<if test="delFlag != null and delFlag != ''">del_flag,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="fileOriginName != null and fileOriginName != ''">#{fileOriginName},</if>
<if test="fileSuffix != null">#{fileSuffix},</if>
<if test="fileSizeInfo != null">#{fileSizeInfo},</if>
<if test="fileObjectName != null">#{fileObjectName},</if>
<if test="filePath != null">#{filePath},</if>
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateSysFileInfo" parameterType="SysFileInfo">
update sys_file_info
<trim prefix="SET" suffixOverrides=",">
<if test="fileOriginName != null and fileOriginName != ''">file_origin_name = #{fileOriginName},</if>
<if test="fileSuffix != null">file_suffix = #{fileSuffix},</if>
<if test="fileSizeInfo != null">file_size_info = #{fileSizeInfo},</if>
<if test="fileObjectName != null">file_object_name = #{fileObjectName},</if>
<if test="filePath != null">file_path = #{filePath},</if>
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where file_id = #{fileId}
</update>
<delete id="deleteSysFileInfoByFileId" parameterType="Long">
delete from sys_file_info where file_id = #{fileId}
</delete>
<delete id="deleteSysFileInfoByFileIds" parameterType="String">
delete from sys_file_info where file_id in
<foreach item="fileId" collection="array" open="(" separator="," close=")">
#{fileId}
</foreach>
</delete>
<delete id="deleteSysFileInfoByFileObjectName" parameterType="String">
delete from sys_file_info where file_object_name = #{fileObjectName}
</delete>
</mapper>