单表代码生成,完美了,支持强制新行,栅格定义。

This commit is contained in:
thinkgem
2018-01-27 17:12:09 +08:00
parent b44d381253
commit 7864513be0
13 changed files with 782 additions and 514 deletions

View File

@@ -11,7 +11,7 @@ DROP TABLE IF EXISTS test_tree;
/* Create Tables */
-- test_data
-- 测试数据
CREATE TABLE test_data
(
id varchar(64) NOT NULL COMMENT '编号',
@@ -22,10 +22,11 @@ CREATE TABLE test_data
test_radio varchar(10) COMMENT '单选框',
test_checkbox varchar(200) COMMENT '复选框',
test_date timestamp COMMENT '日期选择',
test_datetime timestamp COMMENT '日期时间选择',
test_datetime timestamp COMMENT '日期时间',
test_user_code varchar(64) COMMENT '用户选择',
test_office_code varchar(64) COMMENT '部门选择',
test_company_code varchar(64) COMMENT '公司选择',
test_area_code varchar(64) COMMENT '区域选择',
status char(1) DEFAULT '0' NOT NULL COMMENT '状态0正常 1删除 2停用',
create_by varchar(64) NOT NULL COMMENT '创建者',
create_date timestamp NOT NULL COMMENT '创建时间',
@@ -33,10 +34,10 @@ CREATE TABLE test_data
update_date timestamp NOT NULL COMMENT '更新时间',
remarks varchar(500) COMMENT '备注信息',
PRIMARY KEY (id)
) COMMENT = 'test_data';
) ENGINE = InnoDB COMMENT = '测试数据' DEFAULT CHARACTER SET utf8;
-- test_data_child
-- 测试数据子表
CREATE TABLE test_data_child
(
id varchar(64) NOT NULL COMMENT '编号',
@@ -49,15 +50,16 @@ CREATE TABLE test_data_child
test_radio varchar(10) COMMENT '单选框',
test_checkbox varchar(200) COMMENT '复选框',
test_date timestamp COMMENT '日期选择',
test_datetime timestamp COMMENT '日期时间选择',
test_datetime timestamp COMMENT '日期时间',
test_user_code varchar(64) COMMENT '用户选择',
test_office_code varchar(64) COMMENT '部门选择',
test_company_code varchar(64) COMMENT '公司选择',
test_area_code varchar(64) COMMENT '区域选择',
PRIMARY KEY (id)
) COMMENT = 'test_data_child';
) ENGINE = InnoDB COMMENT = '测试数据子表' DEFAULT CHARACTER SET utf8;
-- test_tree
-- 测试树表
CREATE TABLE test_tree
(
id varchar(64) NOT NULL COMMENT '编号',
@@ -76,7 +78,7 @@ CREATE TABLE test_tree
update_date timestamp NOT NULL COMMENT '更新时间',
remarks varchar(500) COMMENT '备注信息',
PRIMARY KEY (id)
) COMMENT = 'test_tree';
) ENGINE = InnoDB COMMENT = '测试树表' DEFAULT CHARACTER SET utf8;

View File

@@ -24,7 +24,8 @@ CREATE TABLE test_data
test_datetime timestamp,
test_user_code varchar2(64),
test_office_code varchar2(64),
test_company_code varchar2(64),
test_area_code varchar2(64),
test_area_name nvarchar2(100),
status char(1) DEFAULT '0' NOT NULL,
create_by varchar2(64) NOT NULL,
create_date timestamp NOT NULL,
@@ -51,7 +52,8 @@ CREATE TABLE test_data_child
test_datetime timestamp,
test_user_code varchar2(64),
test_office_code varchar2(64),
test_company_code varchar2(64),
test_area_code varchar2(64),
test_area_name nvarchar2(100),
PRIMARY KEY (id)
);
@@ -93,7 +95,8 @@ COMMENT ON COLUMN test_data.test_date IS '日期选择';
COMMENT ON COLUMN test_data.test_datetime IS '日期时间';
COMMENT ON COLUMN test_data.test_user_code IS '用户选择';
COMMENT ON COLUMN test_data.test_office_code IS '部门选择';
COMMENT ON COLUMN test_data.test_company_code IS '公司选择';
COMMENT ON COLUMN test_data.test_area_code IS '区域选择';
COMMENT ON COLUMN test_data.test_area_name IS '区域名称';
COMMENT ON COLUMN test_data.status IS '状态0正常 1删除 2停用';
COMMENT ON COLUMN test_data.create_by IS '创建者';
COMMENT ON COLUMN test_data.create_date IS '创建时间';
@@ -114,7 +117,8 @@ COMMENT ON COLUMN test_data_child.test_date IS '日期选择';
COMMENT ON COLUMN test_data_child.test_datetime IS '日期时间';
COMMENT ON COLUMN test_data_child.test_user_code IS '用户选择';
COMMENT ON COLUMN test_data_child.test_office_code IS '部门选择';
COMMENT ON COLUMN test_data_child.test_company_code IS '公司选择';
COMMENT ON COLUMN test_data_child.test_area_code IS '区域选择';
COMMENT ON COLUMN test_data_child.test_area_name IS '区域名称';
COMMENT ON TABLE test_tree IS '测试树表';
COMMENT ON COLUMN test_tree.id IS '编号';
COMMENT ON COLUMN test_tree.parent_code IS '父级编号';

File diff suppressed because it is too large Load Diff

View File

@@ -6,6 +6,14 @@
# 数据库连接
jdbc:
# Mysql 数据库配置
# type: mysql
# driver: com.mysql.jdbc.Driver
# url: jdbc:mysql://127.0.0.1:3306/jeesite4?useUnicode=true&characterEncoding=utf-8
# username: root
# password: 123456
# testSql: SELECT 1
# Oracle 数据库配置
type: oracle
driver: oracle.jdbc.driver.OracleDriver
@@ -13,15 +21,7 @@ jdbc:
username: jeesite
password: jeesite
testSql: SELECT 1 FROM DUAL
# Mysql 数据库配置
# type: mysql
# driver: com.mysql.jdbc.Driver
# url: jdbc:mysql://127.0.0.1:3306/jeesite?useUnicode=true&characterEncoding=utf-8
# username: jeesite
# password: jeesite
# testSql: SELECT 1
# Redis 配置
redis:

View File

@@ -5,7 +5,7 @@ package com.jeesite.test;
import org.junit.Test;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.annotation.Commit;
import org.springframework.test.annotation.Rollback;
import com.jeesite.modules.config.Application;
@@ -15,23 +15,23 @@ import com.jeesite.modules.config.Application;
* @version 2017-10-22
*/
@SpringBootTest(classes=Application.class)
@Commit
public class InitCoreData extends com.jeesite.modules.db.InitCoreData {
@Rollback(false)
public class InitCoreData extends com.jeesite.modules.sys.db.InitCoreData {
@Test
public void initCoreData() throws Exception{
initLog();
initConfig();
initModule();
initDict();
initRole();
initMenu();
initUser();
// initConfig();
// initModule();
// initDict();
// initRole();
// initMenu();
// initUser();
// initArea();
initOffice();
initCompany();
initPost();
initEmpUser();
// initOffice();
// initCompany();
// initPost();
// initEmpUser();
}
}

View File

@@ -0,0 +1,28 @@
/**
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
*/
package com.jeesite.test;
import org.junit.Test;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.annotation.Rollback;
import com.jeesite.modules.config.Application;
/**
* 初始化代码生成表测试数据
* @author ThinkGem
* @version 2017-10-22
*/
@SpringBootTest(classes=Application.class)
@Rollback(false)
public class InitGenData extends com.jeesite.modules.gen.db.InitGenData {
@Test
public void initGenData() throws Exception{
initGenTestData();
initGenTreeData();
}
}