diff --git a/CommentDao.xml b/CommentDao.xml new file mode 100644 index 0000000..22f9f32 --- /dev/null +++ b/CommentDao.xml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + delete from comment where id=#{id} + + + + + + + insert into comment (username,email,content,avatar, + create_time,forum_id,parent_comment_id, usercomment) + values (#{username},#{email},#{content},#{avatar}, + #{createTime},#{forumId},#{parentCommentId}, #{userComment}); + + + + + + + + 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} + + + diff --git a/LinkDao.xml b/LinkDao.xml new file mode 100644 index 0000000..302f409 --- /dev/null +++ b/LinkDao.xml @@ -0,0 +1,27 @@ + + + + + + + + + insert into link(name ,address,create_time) values (#{name},#{address},#{createTime}); + + + + + + delete from link where id = #{id} + + + + + + diff --git a/MessageDao.xml b/MessageDao.xml new file mode 100644 index 0000000..ead3dd7 --- /dev/null +++ b/MessageDao.xml @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + delete from message where id=#{id} + + + + + + + + + insert into message (content,name,create_time,msg_avatar) + values (#{content},#{name},#{createTime},#{msg_avatar}) + + + + insert into reply (content,names,create_time,mes_id,avatar) + values (#{content},#{names},#{createTime},#{mes_id},#{avatar}) + + + diff --git a/NoticeDao.xml b/NoticeDao.xml new file mode 100644 index 0000000..967fa82 --- /dev/null +++ b/NoticeDao.xml @@ -0,0 +1,21 @@ + + + + + + + + insert into notice(content) values(#{content}) + + + + delete from notice where id=#{id} + + + diff --git a/ReplyDao.xml b/ReplyDao.xml new file mode 100644 index 0000000..414bc77 --- /dev/null +++ b/ReplyDao.xml @@ -0,0 +1,14 @@ + + + + + delete from reply where id=#{id} + + + + + diff --git a/TagDao.xml b/TagDao.xml new file mode 100644 index 0000000..74158ad --- /dev/null +++ b/TagDao.xml @@ -0,0 +1,54 @@ + + + + + + + + + insert into tag values (#{id},#{name}); + + + + + + + + + + + + + + + + + + + + + + delete from tag where id = #{id} + + + + update tag set name = #{name} where id = #{id}; + + + diff --git a/UserDao.xml b/UserDao.xml new file mode 100644 index 0000000..b3ba308 --- /dev/null +++ b/UserDao.xml @@ -0,0 +1,28 @@ + + + + + update user set password=#{password} where username=#{username} + + + + + + insert into user(username,password,email,create_time,update_time,type,school,avatar) + values(#{username},#{password},#{email},#{createTime},#{updateTime},#{type},#{school},#{avatar}) + + + + delete from user where id = #{id} + + +