diff --git a/newBlog.sql b/newBlog.sql index 7fc4317..bfaaafd 100644 --- a/newBlog.sql +++ b/newBlog.sql @@ -35,7 +35,6 @@ CREATE TABLE `tag_category` `t_id` bigint(20) primary key auto_increment, `t_name` varchar(255) not null, `is_category` boolean not null default true, - `is_delete` boolean not null default false comment '该数据是否被删除' ) comment '标签和分类表'; CREATE TABLE `comment` diff --git a/src/main/resources/mapper/ArticleTagMapper.xml b/src/main/resources/mapper/ArticleTagMapper.xml new file mode 100644 index 0000000..b8458e1 --- /dev/null +++ b/src/main/resources/mapper/ArticleTagMapper.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + insert into article_tag(a_id, t_id) + values (#{article.id}, #{tag.id}) + + + + + update article_tag + + + a_id = #{article.id}, + + + t_id = #{tag.id}, + + + where at_id = #{tag.id} + + + + + delete + from article_tag + where at_id = #{id}; + + + + delete from article_tag where at_id in + + (#{articleTag.id}) + + + + + + delete + from article_tag + where a_id = #{id} + + + + + + + + \ No newline at end of file