diff --git a/ForumDao.xml b/ForumDao.xml new file mode 100644 index 0000000..6d0c31a --- /dev/null +++ b/ForumDao.xml @@ -0,0 +1,202 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + delete from forum where id = #{id} + + + + + + + + + + + + + + + + + + + + + + + update forum set flag = #{flag} , + title = #{title}, content = #{content}, tag_ids = #{tagIds}, + avatars = #{avatars} , description = #{description} , + commentabled = #{commentabled} ,update_time = #{updateTime} where id = #{id}; + + + update forum b set b.views=b.views+1 where id=#{id}; + + + + insert into forum (title, content, avatars, flag, + views, commentabled, create_time, update_time, tag_ids, user_id, description) + values (#{title}, #{content}, #{avatars}, #{flag}, #{views}, #{commentabled}, #{createTime}, + #{updateTime}, #{tagIds}, #{userId}, #{description}); + + + + insert into forum_tags (tag_id, forum_id) values (#{tagId},#{forumId}); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + update forum b set b.like=b.like+1 where b.id=#{id} + + + + + + + + + update forum b set b.like=b.like-1 where b.id=#{forumId} + + +