From 6754051ae531b317b33ba31cebe68724671e44d7 Mon Sep 17 00:00:00 2001 From: gqzdev Date: Thu, 3 Sep 2020 22:51:55 +0800 Subject: [PATCH] mybatis-plus --- spring-boot-start-orm-mybatis-plus/README.md | 13 ++++++------- spring-boot-start-orm-mybatis-plus/pom.xml | 2 +- .../mybatis/plus/config/CommonFieldHandler.java | 2 +- .../mybatis/plus/config/MybatisPlusConfig.java | 2 +- .../com/gqzdev/orm/mybatis/plus/entity/User.java | 7 ------- .../src/main/resources/application.yml | 16 ++++++++-------- .../src/main/resources/db/schema.sql | 2 +- 7 files changed, 18 insertions(+), 26 deletions(-) diff --git a/spring-boot-start-orm-mybatis-plus/README.md b/spring-boot-start-orm-mybatis-plus/README.md index 3bfc74d..4410972 100644 --- a/spring-boot-start-orm-mybatis-plus/README.md +++ b/spring-boot-start-orm-mybatis-plus/README.md @@ -1,6 +1,6 @@ # spring-boot-demo-orm-mybatis-plus -> 此 demo 演示了 Spring Boot 如何集成 mybatis-plus,简化Mybatis开发,带给你难以置信的开发体验。 +> Spring Boot 如何集成 mybatis-plus,简化Mybatis开发,带给你难以置信的开发体验。 ## pom.xml @@ -10,15 +10,14 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - spring-boot-demo-orm-mybatis-plus + spring-boot-start-orm-mybatis-plus 1.0.0-SNAPSHOT jar - - spring-boot-demo-orm-mybatis-plus + spring-boot-start-orm-mybatis-plus Demo project for Spring Boot - com.xkcoding + com.gqzdev spring-boot-demo 1.0.0-SNAPSHOT @@ -100,7 +99,7 @@ * @modified: yangkai.shen */ @Configuration -@MapperScan(basePackages = {"com.xkcoding.orm.mybatis.plus.mapper"}) +@MapperScan(basePackages = {"com.gqzdev.orm.mybatis.plus.mapper"}) @EnableTransactionManagement public class MybatisPlusConfig { /** @@ -124,7 +123,7 @@ public class MybatisPlusConfig { ## CommonFieldHandler.java ```java -package com.xkcoding.orm.mybatis.plus.config; +package com.gqzdev.orm.mybatis.plus.config; import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler; import lombok.extern.slf4j.Slf4j; diff --git a/spring-boot-start-orm-mybatis-plus/pom.xml b/spring-boot-start-orm-mybatis-plus/pom.xml index 4cbe2a9..78b46d9 100644 --- a/spring-boot-start-orm-mybatis-plus/pom.xml +++ b/spring-boot-start-orm-mybatis-plus/pom.xml @@ -64,7 +64,7 @@ - spring-boot-demo-orm-mybatis-plus + spring-boot-start-orm-mybatis-plus org.springframework.boot diff --git a/spring-boot-start-orm-mybatis-plus/src/main/java/com/gqzdev/orm/mybatis/plus/config/CommonFieldHandler.java b/spring-boot-start-orm-mybatis-plus/src/main/java/com/gqzdev/orm/mybatis/plus/config/CommonFieldHandler.java index 547acaa..d6f6f45 100644 --- a/spring-boot-start-orm-mybatis-plus/src/main/java/com/gqzdev/orm/mybatis/plus/config/CommonFieldHandler.java +++ b/spring-boot-start-orm-mybatis-plus/src/main/java/com/gqzdev/orm/mybatis/plus/config/CommonFieldHandler.java @@ -12,7 +12,7 @@ * 通用字段填充 *

* - * @package: com.xkcoding.orm.mybatis.plus.config + * @package: com.gqzdev.orm.mybatis.plus.config * @description: 通用字段填充 * @author: yangkai.shen * @date: Created in 2018/11/8 17:40 diff --git a/spring-boot-start-orm-mybatis-plus/src/main/java/com/gqzdev/orm/mybatis/plus/config/MybatisPlusConfig.java b/spring-boot-start-orm-mybatis-plus/src/main/java/com/gqzdev/orm/mybatis/plus/config/MybatisPlusConfig.java index 6501d5c..8be447e 100644 --- a/spring-boot-start-orm-mybatis-plus/src/main/java/com/gqzdev/orm/mybatis/plus/config/MybatisPlusConfig.java +++ b/spring-boot-start-orm-mybatis-plus/src/main/java/com/gqzdev/orm/mybatis/plus/config/MybatisPlusConfig.java @@ -21,7 +21,7 @@ * @modified: yangkai.shen */ @Configuration -@MapperScan(basePackages = {"com.xkcoding.orm.mybatis.plus.mapper"}) +@MapperScan(basePackages = {"com.gqzdev.orm.mybatis.plus.mapper"}) @EnableTransactionManagement public class MybatisPlusConfig { /** diff --git a/spring-boot-start-orm-mybatis-plus/src/main/java/com/gqzdev/orm/mybatis/plus/entity/User.java b/spring-boot-start-orm-mybatis-plus/src/main/java/com/gqzdev/orm/mybatis/plus/entity/User.java index a5792b9..deb9a87 100644 --- a/spring-boot-start-orm-mybatis-plus/src/main/java/com/gqzdev/orm/mybatis/plus/entity/User.java +++ b/spring-boot-start-orm-mybatis-plus/src/main/java/com/gqzdev/orm/mybatis/plus/entity/User.java @@ -14,17 +14,10 @@ import static com.baomidou.mybatisplus.annotation.FieldFill.INSERT_UPDATE; /** - *

- * 用户实体类 - *

- * - * @package: com.xkcoding.orm.mybatis.plus.entity * @description: 用户实体类 - * @author: yangkai.shen * @date: Created in 2018/11/8 16:49 * @copyright: Copyright (c) 2018 * @version: V1.0 - * @modified: yangkai.shen */ @Data @NoArgsConstructor diff --git a/spring-boot-start-orm-mybatis-plus/src/main/resources/application.yml b/spring-boot-start-orm-mybatis-plus/src/main/resources/application.yml index 875c3e2..ef70b17 100644 --- a/spring-boot-start-orm-mybatis-plus/src/main/resources/application.yml +++ b/spring-boot-start-orm-mybatis-plus/src/main/resources/application.yml @@ -1,16 +1,16 @@ spring: datasource: - url: jdbc:mysql://127.0.0.1:3306/spring-boot-demo?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&failOverReadOnly=false&serverTimezone=GMT%2B8 + url: jdbc:mysql://127.0.0.1:3306/spring-boot-start?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&failOverReadOnly=false&serverTimezone=GMT%2B8 username: root - password: root + password: ganquanzhong driver-class-name: com.mysql.cj.jdbc.Driver type: com.zaxxer.hikari.HikariDataSource initialization-mode: always continue-on-error: true - schema: - - "classpath:db/schema.sql" - data: - - "classpath:db/data.sql" +# schema: +# - "classpath:db/schema.sql" +# data: +# - "classpath:db/data.sql" hikari: minimum-idle: 5 connection-test-query: SELECT 1 FROM DUAL @@ -27,7 +27,7 @@ logging: mybatis-plus: mapper-locations: classpath:mappers/*.xml #实体扫描,多个package用逗号或者分号分隔 - typeAliasesPackage: com.xkcoding.orm.mybatis.plus.entity + typeAliasesPackage: com.gqzdev.orm.mybatis.plus.entity global-config: # 数据库相关配置 db-config: @@ -48,4 +48,4 @@ mybatis-plus: # 原生配置 configuration: map-underscore-to-camel-case: true - cache-enabled: true \ No newline at end of file + cache-enabled: true diff --git a/spring-boot-start-orm-mybatis-plus/src/main/resources/db/schema.sql b/spring-boot-start-orm-mybatis-plus/src/main/resources/db/schema.sql index 22804e5..c8f5081 100644 --- a/spring-boot-start-orm-mybatis-plus/src/main/resources/db/schema.sql +++ b/spring-boot-start-orm-mybatis-plus/src/main/resources/db/schema.sql @@ -10,4 +10,4 @@ CREATE TABLE `orm_user` ( `create_time` DATETIME NOT NULL DEFAULT NOW() COMMENT '创建时间', `last_login_time` DATETIME DEFAULT NULL COMMENT '上次登录时间', `last_update_time` DATETIME NOT NULL DEFAULT NOW() COMMENT '上次更新时间' -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Spring Boot Demo Orm 系列示例表'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Spring Boot Start Orm 系列示例表';