All Projects → davidfantasy → Mybatis Plus Generator Ui

davidfantasy / Mybatis Plus Generator Ui

Licence: apache-2.0
对mybatis-plus-generator进行封装,通过Web UI快速生成兼容Spring boot,mybatis-plus框架的各类业务代码

Programming Languages

java
68154 projects - #9 most used programming language

Labels

Projects that are alternatives of or similar to Mybatis Plus Generator Ui

Spring Boot Leaning
Spring Boot 2.X 最全课程代码
Stars: ✭ 2,008 (+968.09%)
Mutual labels:  mybatis
Source Code Hunter
😱 从源码层面,剖析挖掘互联网行业主流技术的底层实现原理,为广大开发者 “提升技术深度” 提供便利。目前开放 Spring 全家桶,Mybatis、Netty、Dubbo 框架,及 Redis、Tomcat 中间件等
Stars: ✭ 7,392 (+3831.91%)
Mutual labels:  mybatis
Spring Boot Sample
Spring-boot 集成druid数据库连接池,Spring-boot实现druid的动态数据源,Spring-boot实现定时任务schedule,spring-boot集成mybatis
Stars: ✭ 180 (-4.26%)
Mutual labels:  mybatis
Roncoo Mybatis Generator
龙果开源-Mybatis代码自动生成工具
Stars: ✭ 165 (-12.23%)
Mutual labels:  mybatis
Lyonblog
基于Java8的SSM+Elasticsearch全文检索的个人博客系统
Stars: ✭ 169 (-10.11%)
Mutual labels:  mybatis
Spring Boot Plus
🔥 Spring-Boot-Plus is a easy-to-use, high-speed, high-efficient,feature-rich, open source spring boot scaffolding. 🚀
Stars: ✭ 2,198 (+1069.15%)
Mutual labels:  mybatis
Priest
dubbo mybatis springboot base soa rest api framework with customer code generator
Stars: ✭ 160 (-14.89%)
Mutual labels:  mybatis
Springboot Learning
《Spring Boot基础教程》,2.x版本持续连载中!点击下方链接直达教程目录!
Stars: ✭ 13,916 (+7302.13%)
Mutual labels:  mybatis
Easyadmin
简易的java后台管理框架,基于SpringBoot+FreeMark+ace admin+mysql
Stars: ✭ 169 (-10.11%)
Mutual labels:  mybatis
Seconds Kill
基于 Springboot + Redis + Kafka 的秒杀系统,乐观锁 + 缓存 + 限流 + 异步,TPS 从 500 优化到 3000
Stars: ✭ 180 (-4.26%)
Mutual labels:  mybatis
Springbootlearning
《Spring Boot教程》源码
Stars: ✭ 2,065 (+998.4%)
Mutual labels:  mybatis
Albert
这个是我个人网站的项目,欢迎贡献代码,力求能够应用到实际工作中java相关的大多数技术栈。有兴趣请Star一下,非常感谢。qq交流群:587577705 这个项目将不断地更新!生产环境:
Stars: ✭ 168 (-10.64%)
Mutual labels:  mybatis
Minidao
轻量级JAVA持久层,类似Mybatis一样的用法,基于SpringJdbc实现更轻量
Stars: ✭ 177 (-5.85%)
Mutual labels:  mybatis
My Blog
🌴A simple & beautiful blogging system implemented with spring-boot & thymeleaf & mybatis My Blog 是由 SpringBoot + Mybatis + Thymeleaf 等技术实现的 Java 博客系统,页面美观、功能齐全、部署简单及完善的代码,一定会给使用者无与伦比的体验
Stars: ✭ 2,400 (+1176.6%)
Mutual labels:  mybatis
Xbin Store
模仿国内知名B2C网站,实现的一个分布式B2C商城 使用Spring Boot 自动配置 Dubbox / MVC / MyBatis / Druid / Solr / Redis 等。使用Spring Cloud版本请查看
Stars: ✭ 2,140 (+1038.3%)
Mutual labels:  mybatis
Crown
Based on SpringBoot2, Crown builds a rapidly developed web application scaffolding.
Stars: ✭ 161 (-14.36%)
Mutual labels:  mybatis
Zebra
美团点评集团统一使用的MySQL数据库访问层的中间件。主要提供对业务开发透明、读写分库、分库分表能力,并提供了端到端SQL监控的集成方案。
Stars: ✭ 2,237 (+1089.89%)
Mutual labels:  mybatis
Springcloud Miaosha
一个基于spring cloud Greenwich的简单秒杀电子商城项目,适合新人阅读。A simple spring cloud based seckill shopping mall project, suitable for young people to read. It can be used as a paper material for academic defense.
Stars: ✭ 187 (-0.53%)
Mutual labels:  mybatis
Icloud
Stars: ✭ 184 (-2.13%)
Mutual labels:  mybatis
Myuploader Backend
单文件上传,多文件上传,大文件上传,断点续传,文件秒传,图片上传
Stars: ✭ 177 (-5.85%)
Mutual labels:  mybatis

mybatis-plus-generator-ui

提供交互式的Web UI用于生成兼容mybatis-plus框架的相关功能代码,包括Entity,Mapper,Mapper.xml,Service,Controller等 ,可以自定义模板以及各类输出参数,也可通过SQL查询语句直接生成代码。

使用方法

  1. 引入maven的相关依赖,注意scope只需要写test就可以了
 <dependency>
    <groupId>com.github.davidfantasy</groupId>
    <artifactId>mybatis-plus-generator-ui</artifactId>
    <version>1.4.2</version>
    <scope>test</scope>
 </dependency>
  1. 在项目的test目录新建一个启动类,代码示例如下:
public class GeberatorUIServer {

    public static void main(String[] args) {
        GeneratorConfig config = GeneratorConfig.builder().jdbcUrl("jdbc:mysql://192.168.1.211:3306/example")
                .userName("root")
                .password("root")
                .driverClassName("com.mysql.cj.jdbc.Driver")
                 //数据库schema,POSTGRE_SQL,ORACLE,DB2类型的数据库需要指定
                .schemaName("myBusiness")
                 //如果需要修改各类生成文件的默认命名规则,可自定义一个NameConverter实例,覆盖相应的名称转换方法:                
                .nameConverter(new NameConverter() {
                    /**
                     * 自定义Service类文件的名称规则
                     */
                    @Override
                    public String serviceNameConvert(String tableName) {
                        return this.entityNameConvert(tableName) + "Service";
                    }
                    /**
                     * 自定义Controller类文件的名称规则
                     */
                    @Override
                    public String controllerNameConvert(String tableName) {
                        return this.entityNameConvert(tableName) + "Action";
                    }
                })
                .basePackage("com.github.davidfantasy.mybatisplustools.example")
                .port(8068)
                .build();
        MybatisPlusToolsApplication.run(config);
    }

}

GeneratorConfig还包含一些基本的配置参数以及各个可扩展的接口,比如自定义模板参数,具体的说明可查看源码注释。

  1. 运行该启动类,启动一个Generator Server。然后访问 http://localhost:8068 (端口是可配置的)即可进入到管理界面。

更新

1.4.0版本之后,可支持将GeberatorUIServer独立部署为一个单独的spring boot项目,通过页面指定目标项目根目录的方式为多个项目提供源码生成服务。

主要功能

  1. 数据表的查询和浏览:可以直接浏览和查询配置的数据源的数据表信息,可选择一个或多个生成模板代码:

数据表查询

  1. 输出文件的配置:内置Entity,Mapper,Service,Controller等6种类型代码的模板配置,可以上传模板进行替换,并修改各类参数,配置参数已经按照影响的文件类型重新进行了分类,并加入了部分文本说明;也可以自行添加其它类型的自定义输出文件。所有的配置项都会按照项目包名进行保存,只需一次性设置就可以了。

输出文件类型配置

文件输出选项配置

  1. 代码生成选项:将每次生成代码时可能变动的内容加入到代码生成选项中,方便调整每次的生成策略,比如:是否覆盖原文件,生成文件的种类等等:

代码生成选项

  1. SQL结果集自动生成代码:通过输入查询SQL,可自动在Mapper(Xml及Java)中生成对应的查询方法,DTO对象和ResultMap(结果集映射配置)

SQL编辑

SQL代码生成选项

  1. 动态SQL增强:自动识别含有mybatis动态参数的where条件,转换为mybatis的动态SQL条件

动态SQL增强

常见问题

Q:下载源码中怎么直接运行?

不建议直接下载源码运行,该项目是设计为直接嵌入到对应的业务项目中使用,可以自动识别项目路径等环境变量。如需采用源码运行,需要另行编译src\frontend中的静态资源(源码中不包含已编译的页面),在src\frontend文件夹中执行:

yarn install
yarn run build

然后修改src\test\java\TestApplication中数据库的相关配置,并运行。

Q:支持哪些类型的数据库?

支持几乎所有主流的数据库,具体可参考mybatis-plus-generator框架的文档。需要自行引入数据库的driver包,并在 GeneratorConfig中指定driverClassName。

Q:怎么自定义模板参数?

在GeneratorConfig中自定义TemplateVaribleInjecter,返回需要在模板中使用的参数,例如:

 GeneratorConfig config = GeneratorConfig.builder()
                .templateVaribleInjecter(new TemplateVaribleInjecter() {
                    @Override
                    public Map<String, Object> getCustomTemplateVaribles(TableInfo tableInfo) {
                        Map<String,Object> params = new HashMap<>();
                        return params;
                    }
                })

Q:保存的配置是存储到什么地方的?

所有的用户保存的配置是按照basePackage分组保存到user.home目录的.mybatis-plus-generator-ui中的,不同项目的配置不会互相影响。

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].