diff --git a/springboot-multisource/pom.xml b/springboot-multisource/pom.xml index 1f504e4..33b5f7e 100644 --- a/springboot-multisource/pom.xml +++ b/springboot-multisource/pom.xml @@ -34,10 +34,6 @@ org.springframework.boot spring-boot-starter-aop - - org.springframework.boot - spring-boot-starter-jdbc - mysql mysql-connector-java diff --git a/springboot-multisource/src/main/java/com/xncoding/pos/config/MybatisPlusConfig.java b/springboot-multisource/src/main/java/com/xncoding/pos/config/MybatisPlusConfig.java index 4e8cfe6..a14108f 100644 --- a/springboot-multisource/src/main/java/com/xncoding/pos/config/MybatisPlusConfig.java +++ b/springboot-multisource/src/main/java/com/xncoding/pos/config/MybatisPlusConfig.java @@ -24,9 +24,7 @@ import java.util.HashMap; */ @Configuration @EnableTransactionManagement(order = 2) -@MapperScan(basePackages = { - "com.xncoding.pos.common.dao.repository", - "com.xncoding.pos.dao.repository"}) +@MapperScan(basePackages = {"com.xncoding.pos.common.dao.repository"}) public class MybatisPlusConfig { @Autowired diff --git a/springboot-multisource/src/main/resources/application.yml b/springboot-multisource/src/main/resources/application.yml index 9f45001..f771764 100644 --- a/springboot-multisource/src/main/resources/application.yml +++ b/springboot-multisource/src/main/resources/application.yml @@ -13,7 +13,7 @@ spring: ################### mybatis-plus配置 ################### mybatis-plus: - mapper-locations: classpath*:com/xncoding/pos/dao/repository/mapping/*.xml + mapper-locations: classpath*:com/xncoding/pos/common/dao/repository/mapping/*.xml typeAliasesPackage: > com.xncoding.pos.common.dao.entity global-config: @@ -41,8 +41,6 @@ spring: url: jdbc:mysql://127.0.0.1:3306/pos?useSSL=false&autoReconnect=true&tinyInt1isBit=false&useUnicode=true&characterEncoding=utf8 username: root password: 123456 - thymeleaf: - cache: false #多数据源 biz: @@ -70,8 +68,6 @@ spring: url: jdbc:mysql://127.0.0.1:3306/pos?useSSL=false&autoReconnect=true&tinyInt1isBit=false&useUnicode=true&characterEncoding=utf8 username: root password: 123456 - thymeleaf: - cache: false #多数据源 biz: diff --git a/springboot-multisource/src/main/resources/sql/schema.sql b/springboot-multisource/src/main/resources/sql/schema.sql index b31468c..2b3b17b 100644 --- a/springboot-multisource/src/main/resources/sql/schema.sql +++ b/springboot-multisource/src/main/resources/sql/schema.sql @@ -1,14 +1,7 @@ -# -------------------------------------以下核心库开始------------------------------------------- -# CREATE DATABASE IF NOT EXISTS pos default charset utf8 COLLATE utf8_general_ci; -# SET FOREIGN_KEY_CHECKS=0; -# USE pos; - -# -------------------------------------以下其他业务库开始------------------------------------------- -# CREATE DATABASE IF NOT EXISTS pos default charset utf8 COLLATE utf8_general_ci; -# SET FOREIGN_KEY_CHECKS=0; -# USE biz; - -# -------------------------------------以下用户管理表开始------------------------------------------- +# -------------------------------------以下是pos业务库开始------------------------------------------- +CREATE DATABASE IF NOT EXISTS pos default charset utf8 COLLATE utf8_general_ci; +SET FOREIGN_KEY_CHECKS=0; +USE pos; -- 后台管理用户表 DROP TABLE IF EXISTS `t_user`; @@ -25,13 +18,32 @@ CREATE TABLE `t_user` ( `updated_time` DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间' ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='后台管理用户表'; -# 下面是核心数据库中的插入数据 +# 下面是pos数据库中的插入数据 INSERT INTO `t_user` VALUES (1,'admin','系统管理员','123456','www', '17890908889', '系统管理员', 1, '2017-12-12 09:46:12', '2017-12-12 09:46:12'); INSERT INTO `t_user` VALUES (2,'aix','张三','123456','eee', '17859569358', '', 1, '2017-12-12 09:46:12', '2017-12-12 09:46:12'); + +# -------------------------------------以下biz业务库开始------------------------------------------- +CREATE DATABASE IF NOT EXISTS pos default charset utf8 COLLATE utf8_general_ci; +SET FOREIGN_KEY_CHECKS=0; +USE biz; + +-- 后台管理用户表 +DROP TABLE IF EXISTS `t_user`; +CREATE TABLE `t_user` ( + `id` INT(11) PRIMARY KEY AUTO_INCREMENT COMMENT '主键ID', + `username` VARCHAR(32) NOT NULL COMMENT '账号', + `name` VARCHAR(16) DEFAULT '' COMMENT '名字', + `password` VARCHAR(128) DEFAULT '' COMMENT '密码', + `salt` VARCHAR(64) DEFAULT '' COMMENT 'md5密码盐', + `phone` VARCHAR(32) DEFAULT '' COMMENT '联系电话', + `tips` VARCHAR(255) COMMENT '备注', + `state` TINYINT(1) DEFAULT 1 COMMENT '状态 1:正常 2:禁用', + `created_time` DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `updated_time` DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间' +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='后台管理用户表'; + + # 下面是biz数据库中的插入数据 INSERT INTO `t_user` VALUES (1,'admin1','系统管理员','123456','www', '17890908889', '系统管理员', 1, '2017-12-12 09:46:12', '2017-12-12 09:46:12'); INSERT INTO `t_user` VALUES (2,'aix1','张三','123456','eee', '17859569358', '', 1, '2017-12-12 09:46:12', '2017-12-12 09:46:12'); - - -