Giter Site home page Giter Site logo

panda's Introduction

Web版Mybatis代码生成器


目前仅在Mysql 数据库测试通过

基于数据库配置生成代码

  • 执行ddl(数据库配置表)
CREATE TABLE `db_conf` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `name` varchar(32) NOT NULL COMMENT '配置名称',
  `db_name` varchar(32) NOT NULL COMMENT '数据名',
  `type` tinyint(4) NOT NULL COMMENT '数据类型 1-mysql  2-oracle',
  `host` varchar(32) NOT NULL COMMENT '数据库地址',
  `port` int(11) NOT NULL COMMENT '端口',
  `user_name` varchar(32) NOT NULL COMMENT '用户名',
  `password` varchar(32) NOT NULL COMMENT '密码',
  `create_time` datetime NOT NULL COMMENT '创建时间',
  `modify_time` datetime DEFAULT NULL COMMENT '修改时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8 COMMENT='数据库配置表';
  • 修改项目配置
# database
spring.datasource.druid.name=spring-boot-echo
spring.datasource.druid.url=jdbc:mysql://127.0.0.1:3306/echo?useUnicode=true&characterEncoding=utf-8&useSSL=false
spring.datasource.druid.driverClassName=com.mysql.jdbc.Driver
spring.datasource.druid.username=root
spring.datasource.druid.password=123456
spring.datasource.druid.max-active=20
spring.datasource.druid.max-idle=8
spring.datasource.druid.min-idle=8
spring.datasource.druid.initial-size=10
spring.datasource.druid.maxWait=60000
spring.datasource.druid.timeBetweenEvictionRunsMillis=60000
spring.datasource.druid.minEvictableIdleTimeMillis=300000
spring.datasource.druid.validationQuery=SELECT 1 FROM DUAL
spring.datasource.druid.testWhileIdle=true
spring.datasource.druid.testOnBorrow=false
spring.datasource.druid.testOnReturn=false
spring.datasource.druid.logSlowSql=true



# server
spring.application.name=Panda
server.servlet.application-display-name=Panda
server.port=5321
debug=true

spring.jackson.date-format=yyyy-MM-dd HH:mm:ss


# host
server.host=localhost

download.prefix=http://${server.host}:${server.port}/generate/down?file=
  • 编译并启动应用

mvn clean install 

cd panda-web/target/panda-web-1.0.jar

java -jar  panda-web-1.0.jar

数据库配置

  • 生成指定的代码

    1. 点击左侧(代码生成)菜单
    2. 输入生成的对应的包名
    3. 选择对应的数据库配置
    4. 点击加载表信息来加载表数据信息。
    5. 勾选您要使用的表。
    6. 点击生成代码即可生成。

生成代码

非依赖数据库配置生成代码


  • 点击左侧自定义生成菜单 添加数据表

表

  • 点击添加字段信息

字段

  • 输入生成的对应的包名点击生成代码即可。

自定义

其他

如果不想使用web控制台版请移步AutoGenerator

panda's People

Watchers

James Cloos avatar zhaoxudong avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.