集成分表框架sharding-jdbc,内容表拆分

This commit is contained in:
xiongxiaoyang
2020-06-03 08:44:21 +08:00
parent 47b871909f
commit c66905fbea
14 changed files with 144 additions and 10 deletions

View File

@ -266,7 +266,7 @@ int insert(org.mybatis.dynamic.sql.insert.render.InsertStatementProvider&lt
<pre>@Generated(value="org.mybatis.generator.api.MyBatisGenerator")
@SelectProvider(type=org.mybatis.dynamic.sql.util.SqlProviderAdapter.class,
method="select")
@Results(id="BookContentResult",value={@Result(column="id",property="id",jdbcType=BIGINT,id=true),@Result(column="index_id",property="indexId",jdbcType=BIGINT),@Result(column="content",property="content",jdbcType=LONGVARCHAR)})
@Results(id="BookContentResult",value={@Result(column="id",property="id",jdbcType=BIGINT,id=true),@Result(column="index_id",property="indexId",jdbcType=BIGINT),@Result(column="content",property="content",jdbcType=VARCHAR)})
java.util.List&lt;<a href="../../../../../com/java2nb/novel/book/entity/BookContent.html" title="com.java2nb.novel.book.entity中的类">BookContent</a>&gt;&nbsp;selectMany(org.mybatis.dynamic.sql.select.render.SelectStatementProvider&nbsp;selectStatement)</pre>
</li>
</ul>

View File

@ -266,7 +266,7 @@ int&nbsp;insert(org.mybatis.dynamic.sql.insert.render.InsertStatementProvider&lt
<pre>@Generated(value="org.mybatis.generator.api.MyBatisGenerator")
@SelectProvider(type=org.mybatis.dynamic.sql.util.SqlProviderAdapter.class,
method="select")
@Results(id="NewsResult",value={@Result(column="id",property="id",jdbcType=BIGINT,id=true),@Result(column="cat_id",property="catId",jdbcType=INTEGER),@Result(column="cat_name",property="catName",jdbcType=VARCHAR),@Result(column="source_name",property="sourceName",jdbcType=VARCHAR),@Result(column="title",property="title",jdbcType=VARCHAR),@Result(column="create_time",property="createTime",jdbcType=TIMESTAMP),@Result(column="create_user_id",property="createUserId",jdbcType=BIGINT),@Result(column="update_time",property="updateTime",jdbcType=TIMESTAMP),@Result(column="update_user_id",property="updateUserId",jdbcType=BIGINT),@Result(column="content",property="content",jdbcType=LONGVARCHAR)})
@Results(id="NewsResult",value={@Result(column="id",property="id",jdbcType=BIGINT,id=true),@Result(column="cat_id",property="catId",jdbcType=INTEGER),@Result(column="cat_name",property="catName",jdbcType=VARCHAR),@Result(column="source_name",property="sourceName",jdbcType=VARCHAR),@Result(column="title",property="title",jdbcType=VARCHAR),@Result(column="create_time",property="createTime",jdbcType=TIMESTAMP),@Result(column="create_user_id",property="createUserId",jdbcType=BIGINT),@Result(column="update_time",property="updateTime",jdbcType=TIMESTAMP),@Result(column="update_user_id",property="updateUserId",jdbcType=BIGINT),@Result(column="content",property="content",jdbcType=VARCHAR)})
java.util.List&lt;<a href="../../../../../com/java2nb/novel/news/entity/News.html" title="com.java2nb.novel.news.entity中的类">News</a>&gt;&nbsp;selectMany(org.mybatis.dynamic.sql.select.render.SelectStatementProvider&nbsp;selectStatement)</pre>
</li>
</ul>

116
doc/sql/20200603.sql Normal file
View File

@ -0,0 +1,116 @@
DROP TABLE IF EXISTS `book_content0`;
CREATE TABLE `book_content0` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`index_id` bigint(20) DEFAULT NULL COMMENT '目录ID',
`content` mediumtext COMMENT '小说章节内容',
PRIMARY KEY (`id`),
UNIQUE KEY `key_uq_indexId` (`index_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1155 DEFAULT CHARSET=utf8mb4 COMMENT='小说内容表';
-- ----------------------------
-- Table structure for book_content1
-- ----------------------------
DROP TABLE IF EXISTS `book_content1`;
CREATE TABLE `book_content1` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`index_id` bigint(20) DEFAULT NULL COMMENT '目录ID',
`content` mediumtext COMMENT '小说章节内容',
PRIMARY KEY (`id`),
UNIQUE KEY `key_uq_indexId` (`index_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=406 DEFAULT CHARSET=utf8mb4 COMMENT='小说内容表';
-- ----------------------------
-- Table structure for book_content2
-- ----------------------------
DROP TABLE IF EXISTS `book_content2`;
CREATE TABLE `book_content2` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`index_id` bigint(20) DEFAULT NULL COMMENT '目录ID',
`content` mediumtext COMMENT '小说章节内容',
PRIMARY KEY (`id`),
UNIQUE KEY `key_uq_indexId` (`index_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1222 DEFAULT CHARSET=utf8mb4 COMMENT='小说内容表';
-- ----------------------------
-- Table structure for book_content3
-- ----------------------------
DROP TABLE IF EXISTS `book_content3`;
CREATE TABLE `book_content3` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`index_id` bigint(20) DEFAULT NULL COMMENT '目录ID',
`content` mediumtext COMMENT '小说章节内容',
PRIMARY KEY (`id`),
UNIQUE KEY `key_uq_indexId` (`index_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=410 DEFAULT CHARSET=utf8mb4 COMMENT='小说内容表';
-- ----------------------------
-- Table structure for book_content4
-- ----------------------------
DROP TABLE IF EXISTS `book_content4`;
CREATE TABLE `book_content4` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`index_id` bigint(20) DEFAULT NULL COMMENT '目录ID',
`content` mediumtext COMMENT '小说章节内容',
PRIMARY KEY (`id`),
UNIQUE KEY `key_uq_indexId` (`index_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1188 DEFAULT CHARSET=utf8mb4 COMMENT='小说内容表';
-- ----------------------------
-- Table structure for book_content5
-- ----------------------------
DROP TABLE IF EXISTS `book_content5`;
CREATE TABLE `book_content5` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`index_id` bigint(20) DEFAULT NULL COMMENT '目录ID',
`content` mediumtext COMMENT '小说章节内容',
PRIMARY KEY (`id`),
UNIQUE KEY `key_uq_indexId` (`index_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=416 DEFAULT CHARSET=utf8mb4 COMMENT='小说内容表';
-- ----------------------------
-- Table structure for book_content6
-- ----------------------------
DROP TABLE IF EXISTS `book_content6`;
CREATE TABLE `book_content6` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`index_id` bigint(20) DEFAULT NULL COMMENT '目录ID',
`content` mediumtext COMMENT '小说章节内容',
PRIMARY KEY (`id`),
UNIQUE KEY `key_uq_indexId` (`index_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1180 DEFAULT CHARSET=utf8mb4 COMMENT='小说内容表';
-- ----------------------------
-- Table structure for book_content7
-- ----------------------------
DROP TABLE IF EXISTS `book_content7`;
CREATE TABLE `book_content7` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`index_id` bigint(20) DEFAULT NULL COMMENT '目录ID',
`content` mediumtext COMMENT '小说章节内容',
PRIMARY KEY (`id`),
UNIQUE KEY `key_uq_indexId` (`index_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=404 DEFAULT CHARSET=utf8mb4 COMMENT='小说内容表';
-- ----------------------------
-- Table structure for book_content8
-- ----------------------------
DROP TABLE IF EXISTS `book_content8`;
CREATE TABLE `book_content8` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`index_id` bigint(20) DEFAULT NULL COMMENT '目录ID',
`content` mediumtext COMMENT '小说章节内容',
PRIMARY KEY (`id`),
UNIQUE KEY `key_uq_indexId` (`index_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1134 DEFAULT CHARSET=utf8mb4 COMMENT='小说内容表';
-- ----------------------------
-- Table structure for book_content9
-- ----------------------------
DROP TABLE IF EXISTS `book_content9`;
CREATE TABLE `book_content9` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`index_id` bigint(20) DEFAULT NULL COMMENT '目录ID',
`content` mediumtext COMMENT '小说章节内容',
PRIMARY KEY (`id`),
UNIQUE KEY `key_uq_indexId` (`index_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=415 DEFAULT CHARSET=utf8mb4 COMMENT='小说内容表';