提交 70d1d96f 编写于 作者: W Wenyi Feng

将doc放到项目根目录

上级 93683daf
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
......@@ -8,7 +8,7 @@
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="jdk" jdkName="1.8 (1)" jdkType="JavaSDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus:3.0-RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-extension:3.0-RELEASE" level="project" />
......
/*
Navicat Premium Data Transfer
Source Server : localhost
Source Server Type : MySQL
Source Server Version : 50718
Source Host : localhost
Source Database : mybatis-plus
Target Server Type : MySQL
Target Server Version : 50718
File Encoding : utf-8
Date: 08/31/2018 03:14:59 AM
@author Wenyi Feng
*/
CREATE DATABASE `mybatis-plus` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
USE `mybatis-plus`;
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for `t_city`
-- ----------------------------
DROP TABLE IF EXISTS `t_city`;
CREATE TABLE `t_city` (
`id` bigint(20) NOT NULL,
`name` varchar(50) DEFAULT NULL COMMENT '城市名称',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- ----------------------------
-- Table structure for `t_idcard`
-- ----------------------------
DROP TABLE IF EXISTS `t_idcard`;
CREATE TABLE `t_idcard` (
`id` bigint(20) NOT NULL COMMENT '主键id',
`code` varchar(20) DEFAULT NULL COMMENT '身份证号码',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- ----------------------------
-- Table structure for `t_student`
-- ----------------------------
DROP TABLE IF EXISTS `t_student`;
CREATE TABLE `t_student` (
`id` bigint(20) NOT NULL COMMENT '唯一标识,主键',
`name` varchar(50) DEFAULT NULL COMMENT '姓名',
`age` int(3) DEFAULT NULL COMMENT '年龄',
`info` text COMMENT '介绍',
`is_delete` tinyint(1) DEFAULT '0' COMMENT '是否逻辑删除(ture:删除;false:正常(默认))',
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`gender` int(1) DEFAULT '0' COMMENT '性别(0:保密(默认);1:男;2:女)',
`idcard_id` bigint(20) DEFAULT NULL COMMENT '身份证号码表编号(id)',
`city_id` bigint(20) DEFAULT NULL COMMENT '城市表编号(id)',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
SET FOREIGN_KEY_CHECKS = 1;
/*
Navicat Premium Data Transfer
Source Server : localhost
Source Server Type : MySQL
Source Server Version : 80011
Source Host : localhost:3306
Source Schema : mybatis-plus
Target Server Type : MySQL
Target Server Version : 80011
File Encoding : 65001
Date: 01/09/2018 15:49:34
@author Wenyi Feng
*/
CREATE DATABASE `mybatis-plus` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
USE `mybatis-plus`;
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for t_city
-- ----------------------------
DROP TABLE IF EXISTS `t_city`;
CREATE TABLE `t_city` (
`id` bigint(20) NOT NULL,
`name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '城市名称',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of t_city
-- ----------------------------
INSERT INTO `t_city` VALUES (1035761969176342529, '北京');
INSERT INTO `t_city` VALUES (1035762001753501698, '成都');
INSERT INTO `t_city` VALUES (1035765839768121346, '上海');
INSERT INTO `t_city` VALUES (1035765875767832578, '深圳');
INSERT INTO `t_city` VALUES (1035788325201117185, '1');
-- ----------------------------
-- Table structure for t_idcard
-- ----------------------------
DROP TABLE IF EXISTS `t_idcard`;
CREATE TABLE `t_idcard` (
`id` bigint(20) NOT NULL COMMENT '主键id',
`code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '身份证号码',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of t_idcard
-- ----------------------------
INSERT INTO `t_idcard` VALUES (1035788325276614657, '1');
INSERT INTO `t_idcard` VALUES (1035789714388168706, '123456789012345678');
-- ----------------------------
-- Table structure for t_student
-- ----------------------------
DROP TABLE IF EXISTS `t_student`;
CREATE TABLE `t_student` (
`id` bigint(20) NOT NULL COMMENT '唯一标识,主键',
`name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '姓名',
`age` int(3) NULL DEFAULT NULL COMMENT '年龄',
`info` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '介绍',
`is_delete` tinyint(1) NULL DEFAULT 0 COMMENT '是否逻辑删除(true:删除;false:正常(默认))',
`create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '更新时间',
`gender` int(1) NULL DEFAULT 0 COMMENT '性别(0:保密(默认);1:男;2:女)',
`idcard_id` bigint(20) NULL DEFAULT NULL COMMENT '身份证号码表编号(id)',
`city_id` bigint(20) NULL DEFAULT NULL COMMENT '城市表编号(id)',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of t_student
-- ----------------------------
INSERT INTO `t_student` VALUES (1035788325322752001, '1', 1, '1', 0, '2018-09-01 15:15:55', '2018-09-01 15:15:55', 1, 1035788325276614657, 1035788325201117185);
INSERT INTO `t_student` VALUES (1035789714459471874, '冯文议', 26, '无畏造英雄', 0, '2018-09-01 15:21:26', '2018-09-01 15:21:26', 1, 1035789714388168706, 1035762001753501698);
SET FOREIGN_KEY_CHECKS = 1;
//package com.fengwenyi.codegenerator;
//
////import com.baomidou.mybatisplus.annotation.DbType;
////import com.baomidou.mybatisplus.annotation.IdType;
//import com.baomidou.mybatisplus.enums.IdType;
//import com.baomidou.mybatisplus.generator.AutoGenerator;
//import com.baomidou.mybatisplus.generator.config.DataSourceConfig;
//import com.baomidou.mybatisplus.generator.config.GlobalConfig;
//import com.baomidou.mybatisplus.generator.config.PackageConfig;
//import com.baomidou.mybatisplus.generator.config.StrategyConfig;
////import com.baomidou.mybatisplus.generator.config.rules.DateType;
//import com.baomidou.mybatisplus.generator.config.rules.DbType;
//import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
//
///**
// * 代码生成器工具类(测试)
// *
// * mp 2.3.1 生成的代码中包含字段的注解,@TableField("name")
// *
// * @author Wenyi Feng
// * @since 2018-08-31
// */
//public class UtilsV2 {
//
// /**
// * 执行生成代码
// */
// public static void generateCode() {
// String packageName = "com.fengwenyi.mpdemo";
// //generateByTables(packageName, "t_student", "t_city", "t_idcard");
// generateByTables(packageName, null);
// }
//
// private static void generateByTables(String packageName, String... tableNames) {
//
// // 数据库信息
// String dbUrl = "jdbc:mysql://localhost:3306/mybatis-plus?useSSL=true";
// DataSourceConfig dataSourceConfig = new DataSourceConfig()
// .setDbType(DbType.MYSQL)
// .setUrl(dbUrl)
// .setUsername("root")
// .setPassword("xfsy2017")
// //.setDriverName("com.mysql.jdbc.Driver") // mysql 5
// .setDriverName("com.mysql.cj.jdbc.Driver") // mysql 8
// /*.setTypeConvert(new MySqlTypeConvert() {
// @Override
// public PropertyInfo processTypeConvert(GlobalConfig globalConfig, String fieldType) {
// //.....
// // 当发现生成的类型并不能满足你的要求时,可以去这里看,然后重写
// }
// })*/
// ;
//
// // 配置
// GlobalConfig config = new GlobalConfig()
// .setActiveRecord(false)
// .setAuthor("Wenyi Feng")
// .setOutputDir("/Users/fengwenyi/Workspace/file/codeGen")
// .setFileOverride(true)
// .setActiveRecord(true)// 不需要ActiveRecord特性的请改为false
// .setEnableCache(false)// XML 二级缓存
// .setBaseResultMap(true)// XML ResultMap
// .setBaseColumnList(false)// XML columList
// .setKotlin(false) //是否生成 kotlin 代码
// // 自定义文件命名,注意 %s 会自动填充表实体属性!
// .setMapperName("%sDao")
// .setXmlName("%sMapper")
// .setServiceName("MP%sService")
// .setServiceImplName("%sServiceImpl")
// .setControllerName("%sController")
// //.setDateType(DateType.ONLY_DATE) //只使用 java.util.date 代替
// .setIdType(IdType.ID_WORKER)
// //.setSwagger2(true) // model swagger2
// //.setOpen(true) // 是否打开输出目录
// ;
//// if (!serviceNameStartWithI)
//// config.setServiceName("%sService");
//
//
// StrategyConfig strategyConfig = new StrategyConfig()
// .setCapitalMode(true) // 全局大写命名 ORACLE 注意
// //.setDbColumnUnderline(true)
// .setTablePrefix("t_")// 此处可以修改为您的表前缀(数组)
// .setNaming(NamingStrategy.underline_to_camel) // 表名生成策略
// .setInclude(tableNames)//修改替换成你需要的表名,多个表名传数组
// //.setExclude(new String[]{"test"}) // 排除生成的表
// .setEntityLombokModel(true) // lombok实体
// .setEntityBuilderModel(false) // 【实体】是否为构建者模型(默认 false)
// .setEntityColumnConstant(true) // 【实体】是否生成字段常量(默认 false)// 可通过常量名获取数据库字段名
// .setLogicDeleteFieldName("is_delete") // 逻辑删除属性名称
// //.setEntityTableFieldAnnotationEnable
// .entityTableFieldAnnotationEnable(true)
// ;
//
// // 包信息配置
// PackageConfig packageConfig = new PackageConfig()
// .setParent(packageName)
// .setController("controller")
// .setEntity("model")
// .setMapper("dao")
// .setXml("mapper")
//
// /*
// // 共同构建成包名
// .setParent("com.fengwenyi")
// .setModuleName("model")
// */
// ;
//
// // 执行器
// new AutoGenerator()
// .setGlobalConfig(config)
// .setDataSource(dataSourceConfig)
// .setStrategy(strategyConfig)
// .setPackageInfo(packageConfig)
// .execute();
// }
//
//}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册