mirror of
https://github.com/201206030/novel-cloud.git
synced 2025-04-27 01:40:50 +00:00
集成分表框架sharding-jdbc,内容表拆分
This commit is contained in:
parent
47b871909f
commit
c66905fbea
@ -266,7 +266,7 @@ int insert(org.mybatis.dynamic.sql.insert.render.InsertStatementProvider<
|
||||
<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<<a href="../../../../../com/java2nb/novel/book/entity/BookContent.html" title="com.java2nb.novel.book.entity中的类">BookContent</a>> selectMany(org.mybatis.dynamic.sql.select.render.SelectStatementProvider selectStatement)</pre>
|
||||
</li>
|
||||
</ul>
|
||||
|
@ -266,7 +266,7 @@ int insert(org.mybatis.dynamic.sql.insert.render.InsertStatementProvider<
|
||||
<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<<a href="../../../../../com/java2nb/novel/news/entity/News.html" title="com.java2nb.novel.news.entity中的类">News</a>> selectMany(org.mybatis.dynamic.sql.select.render.SelectStatementProvider selectStatement)</pre>
|
||||
</li>
|
||||
</ul>
|
||||
|
116
doc/sql/20200603.sql
Normal file
116
doc/sql/20200603.sql
Normal 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='小说内容表';
|
Binary file not shown.
@ -46,6 +46,21 @@
|
||||
<version>${redisson.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 分库分表-->
|
||||
<!-- sharding jdbc依赖 -->
|
||||
|
||||
<dependency>
|
||||
<groupId>io.shardingsphere</groupId>
|
||||
<artifactId>sharding-jdbc-spring-boot-starter</artifactId>
|
||||
<version>${sharding.jdbc.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.shardingsphere</groupId>
|
||||
<artifactId>sharding-jdbc-spring-namespace</artifactId>
|
||||
<version>${sharding.jdbc.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
@ -25,7 +25,7 @@ public final class BookContentDynamicSqlSupport {
|
||||
|
||||
public final SqlColumn<Long> indexId = column("index_id", JDBCType.BIGINT);
|
||||
|
||||
public final SqlColumn<String> content = column("content", JDBCType.LONGVARCHAR);
|
||||
public final SqlColumn<String> content = column("content", JDBCType.VARCHAR);
|
||||
|
||||
public BookContent() {
|
||||
super("book_content");
|
||||
|
@ -48,7 +48,7 @@ public interface BookContentMapper {
|
||||
@Results(id="BookContentResult", value = {
|
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
|
||||
@Result(column="index_id", property="indexId", jdbcType=JdbcType.BIGINT),
|
||||
@Result(column="content", property="content", jdbcType=JdbcType.LONGVARCHAR)
|
||||
@Result(column="content", property="content", jdbcType=JdbcType.VARCHAR)
|
||||
})
|
||||
List<BookContent> selectMany(SelectStatementProvider selectStatement);
|
||||
|
||||
|
@ -14,6 +14,9 @@ mybatis:
|
||||
logging:
|
||||
config: classpath:logback-boot.xml
|
||||
|
||||
spring:
|
||||
main:
|
||||
allow-bean-definition-overriding: true
|
||||
|
||||
feign:
|
||||
httpclient:
|
||||
|
@ -24,7 +24,7 @@ public final class BookContentDynamicSqlSupport {
|
||||
|
||||
public final SqlColumn<Long> indexId = column("index_id", JDBCType.BIGINT);
|
||||
|
||||
public final SqlColumn<String> content = column("content", JDBCType.LONGVARCHAR);
|
||||
public final SqlColumn<String> content = column("content", JDBCType.VARCHAR);
|
||||
|
||||
public BookContent() {
|
||||
super("book_content");
|
||||
|
@ -54,7 +54,7 @@ public interface BookContentMapper {
|
||||
@Results(id="BookContentResult", value = {
|
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
|
||||
@Result(column="index_id", property="indexId", jdbcType=JdbcType.BIGINT),
|
||||
@Result(column="content", property="content", jdbcType=JdbcType.LONGVARCHAR)
|
||||
@Result(column="content", property="content", jdbcType=JdbcType.VARCHAR)
|
||||
})
|
||||
List<BookContent> selectMany(SelectStatementProvider selectStatement);
|
||||
|
||||
|
@ -60,7 +60,7 @@ public final class NewsDynamicSqlSupport {
|
||||
|
||||
public final SqlColumn<Long> updateUserId = column("update_user_id", JDBCType.BIGINT);
|
||||
|
||||
public final SqlColumn<String> content = column("content", JDBCType.LONGVARCHAR);
|
||||
public final SqlColumn<String> content = column("content", JDBCType.VARCHAR);
|
||||
|
||||
public News() {
|
||||
super("news");
|
||||
|
@ -61,7 +61,7 @@ public interface NewsMapper {
|
||||
@Result(column="create_user_id", property="createUserId", jdbcType=JdbcType.BIGINT),
|
||||
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
|
||||
@Result(column="update_user_id", property="updateUserId", jdbcType=JdbcType.BIGINT),
|
||||
@Result(column="content", property="content", jdbcType=JdbcType.LONGVARCHAR)
|
||||
@Result(column="content", property="content", jdbcType=JdbcType.VARCHAR)
|
||||
})
|
||||
List<News> selectMany(SelectStatementProvider selectStatement);
|
||||
|
||||
|
@ -61,7 +61,7 @@ public final class NewsDynamicSqlSupport {
|
||||
|
||||
public final SqlColumn<Long> updateUserId = column("update_user_id", JDBCType.BIGINT);
|
||||
|
||||
public final SqlColumn<String> content = column("content", JDBCType.LONGVARCHAR);
|
||||
public final SqlColumn<String> content = column("content", JDBCType.VARCHAR);
|
||||
|
||||
public News() {
|
||||
super("news");
|
||||
|
@ -55,7 +55,7 @@ public interface NewsMapper {
|
||||
@Result(column="create_user_id", property="createUserId", jdbcType=JdbcType.BIGINT),
|
||||
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
|
||||
@Result(column="update_user_id", property="updateUserId", jdbcType=JdbcType.BIGINT),
|
||||
@Result(column="content", property="content", jdbcType=JdbcType.LONGVARCHAR)
|
||||
@Result(column="content", property="content", jdbcType=JdbcType.VARCHAR)
|
||||
})
|
||||
List<News> selectMany(SelectStatementProvider selectStatement);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user