代码生成模块合并到框架包
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,8 @@
|
||||
|
||||
/* Drop Tables */
|
||||
|
||||
IF OBJECT_ID('[js_gen_table_column]') IS NOT NULL DROP TABLE [js_gen_table_column];
|
||||
IF OBJECT_ID('[js_gen_table]') IS NOT NULL DROP TABLE [js_gen_table];
|
||||
IF OBJECT_ID('[js_sys_company_office]') IS NOT NULL DROP TABLE [js_sys_company_office];
|
||||
IF OBJECT_ID('[js_sys_employee_post]') IS NOT NULL DROP TABLE [js_sys_employee_post];
|
||||
IF OBJECT_ID('[js_sys_user_data_scope]') IS NOT NULL DROP TABLE [js_sys_user_data_scope];
|
||||
@@ -36,6 +38,58 @@ IF OBJECT_ID('[js_sys_role]') IS NOT NULL DROP TABLE [js_sys_role];
|
||||
|
||||
/* Create Tables */
|
||||
|
||||
-- 代码生成表
|
||||
CREATE TABLE [js_gen_table]
|
||||
(
|
||||
[table_name] varchar(64) NOT NULL,
|
||||
[class_name] varchar(100) NOT NULL,
|
||||
[comments] nvarchar(500) NOT NULL,
|
||||
[parent_table_name] varchar(64),
|
||||
[parent_table_fk_name] varchar(64),
|
||||
[tpl_category] varchar(200),
|
||||
[package_name] varchar(500),
|
||||
[module_name] varchar(30),
|
||||
[sub_module_name] varchar(30),
|
||||
[function_name] nvarchar(200),
|
||||
[function_name_simple] nvarchar(50),
|
||||
[function_author] nvarchar(50),
|
||||
[gen_base_dir] nvarchar(1000),
|
||||
[options] nvarchar(1000),
|
||||
[create_by] varchar(64) NOT NULL,
|
||||
[create_date] datetime NOT NULL,
|
||||
[update_by] varchar(64) NOT NULL,
|
||||
[update_date] datetime NOT NULL,
|
||||
[remarks] nvarchar(500),
|
||||
PRIMARY KEY ([table_name])
|
||||
);
|
||||
|
||||
|
||||
-- 代码生成表列
|
||||
CREATE TABLE [js_gen_table_column]
|
||||
(
|
||||
[id] varchar(64) NOT NULL,
|
||||
[table_name] varchar(64) NOT NULL,
|
||||
[column_name] varchar(64) NOT NULL,
|
||||
[column_sort] decimal(10),
|
||||
[column_type] varchar(100) NOT NULL,
|
||||
[column_label] nvarchar(50),
|
||||
[comments] nvarchar(500) NOT NULL,
|
||||
[attr_name] varchar(200) NOT NULL,
|
||||
[attr_type] varchar(200) NOT NULL,
|
||||
[is_pk] char(1),
|
||||
[is_null] char(1),
|
||||
[is_insert] char(1),
|
||||
[is_update] char(1),
|
||||
[is_list] char(1),
|
||||
[is_query] char(1),
|
||||
[query_type] varchar(200),
|
||||
[is_edit] char(1),
|
||||
[show_type] varchar(200),
|
||||
[options] nvarchar(1000),
|
||||
PRIMARY KEY ([id])
|
||||
);
|
||||
|
||||
|
||||
-- 行政区划
|
||||
CREATE TABLE [js_sys_area]
|
||||
(
|
||||
@@ -734,6 +788,8 @@ CREATE TABLE [js_sys_user_role]
|
||||
|
||||
/* Create Indexes */
|
||||
|
||||
CREATE INDEX [idx_gen_table_ptn] ON [js_gen_table] ();
|
||||
CREATE INDEX [idx_gen_table_column_tn] ON [js_gen_table_column] ();
|
||||
CREATE INDEX [idx_sys_area_pc] ON [js_sys_area] ([parent_code]);
|
||||
CREATE INDEX [idx_sys_area_ts] ON [js_sys_area] ([tree_sort]);
|
||||
CREATE INDEX [idx_sys_area_status] ON [js_sys_area] ([status]);
|
||||
|
||||
@@ -2,6 +2,8 @@ SET SESSION FOREIGN_KEY_CHECKS=0;
|
||||
|
||||
/* Drop Tables */
|
||||
|
||||
DROP TABLE IF EXISTS js_gen_table_column;
|
||||
DROP TABLE IF EXISTS js_gen_table;
|
||||
DROP TABLE IF EXISTS js_sys_company_office;
|
||||
DROP TABLE IF EXISTS js_sys_employee_post;
|
||||
DROP TABLE IF EXISTS js_sys_user_data_scope;
|
||||
@@ -37,6 +39,58 @@ DROP TABLE IF EXISTS js_sys_role;
|
||||
|
||||
/* Create Tables */
|
||||
|
||||
-- 代码生成表
|
||||
CREATE TABLE js_gen_table
|
||||
(
|
||||
table_name varchar(64) NOT NULL COMMENT '表名',
|
||||
class_name varchar(100) NOT NULL COMMENT '实体类名称',
|
||||
comments varchar(500) NOT NULL COMMENT '表说明',
|
||||
parent_table_name varchar(64) COMMENT '关联父表的表名',
|
||||
parent_table_fk_name varchar(64) COMMENT '本表关联父表的外键名',
|
||||
tpl_category varchar(200) COMMENT '使用的模板',
|
||||
package_name varchar(500) COMMENT '生成包路径',
|
||||
module_name varchar(30) COMMENT '生成模块名',
|
||||
sub_module_name varchar(30) COMMENT '生成子模块名',
|
||||
function_name varchar(200) COMMENT '生成功能名',
|
||||
function_name_simple varchar(50) COMMENT '生成功能名(简写)',
|
||||
function_author varchar(50) COMMENT '生成功能作者',
|
||||
gen_base_dir varchar(1000) COMMENT '生成基础路径',
|
||||
options varchar(1000) COMMENT '其它生成选项',
|
||||
create_by varchar(64) NOT NULL COMMENT '创建者',
|
||||
create_date datetime NOT NULL COMMENT '创建时间',
|
||||
update_by varchar(64) NOT NULL COMMENT '更新者',
|
||||
update_date datetime NOT NULL COMMENT '更新时间',
|
||||
remarks varchar(500) COMMENT '备注信息',
|
||||
PRIMARY KEY (table_name)
|
||||
) COMMENT = '代码生成表';
|
||||
|
||||
|
||||
-- 代码生成表列
|
||||
CREATE TABLE js_gen_table_column
|
||||
(
|
||||
id varchar(64) NOT NULL COMMENT '编号',
|
||||
table_name varchar(64) NOT NULL COMMENT '表名',
|
||||
column_name varchar(64) NOT NULL COMMENT '列名',
|
||||
column_sort decimal(10) COMMENT '列排序(升序)',
|
||||
column_type varchar(100) NOT NULL COMMENT '类型',
|
||||
column_label varchar(50) COMMENT '列标签名',
|
||||
comments varchar(500) NOT NULL COMMENT '列备注说明',
|
||||
attr_name varchar(200) NOT NULL COMMENT '类的属性名',
|
||||
attr_type varchar(200) NOT NULL COMMENT '类的属性类型',
|
||||
is_pk char(1) COMMENT '是否主键',
|
||||
is_null char(1) COMMENT '是否可为空',
|
||||
is_insert char(1) COMMENT '是否插入字段',
|
||||
is_update char(1) COMMENT '是否更新字段',
|
||||
is_list char(1) COMMENT '是否列表字段',
|
||||
is_query char(1) COMMENT '是否查询字段',
|
||||
query_type varchar(200) COMMENT '查询方式',
|
||||
is_edit char(1) COMMENT '是否编辑字段',
|
||||
show_type varchar(200) COMMENT '表单类型',
|
||||
options varchar(1000) COMMENT '其它生成选项',
|
||||
PRIMARY KEY (id)
|
||||
) COMMENT = '代码生成表列';
|
||||
|
||||
|
||||
-- 行政区划
|
||||
CREATE TABLE js_sys_area
|
||||
(
|
||||
@@ -737,6 +791,8 @@ CREATE TABLE js_sys_user_role
|
||||
|
||||
/* Create Indexes */
|
||||
|
||||
CREATE INDEX idx_gen_table_ptn ON js_gen_table ();
|
||||
CREATE INDEX idx_gen_table_column_tn ON js_gen_table_column ();
|
||||
CREATE INDEX idx_sys_area_pc ON js_sys_area (parent_code ASC);
|
||||
CREATE INDEX idx_sys_area_ts ON js_sys_area (tree_sort ASC);
|
||||
CREATE INDEX idx_sys_area_status ON js_sys_area (status ASC);
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
|
||||
/* Drop Tables */
|
||||
|
||||
DROP TABLE js_gen_table_column CASCADE CONSTRAINTS;
|
||||
DROP TABLE js_gen_table CASCADE CONSTRAINTS;
|
||||
DROP TABLE js_sys_company_office CASCADE CONSTRAINTS;
|
||||
DROP TABLE js_sys_employee_post CASCADE CONSTRAINTS;
|
||||
DROP TABLE js_sys_user_data_scope CASCADE CONSTRAINTS;
|
||||
@@ -36,6 +38,58 @@ DROP TABLE js_sys_role CASCADE CONSTRAINTS;
|
||||
|
||||
/* Create Tables */
|
||||
|
||||
-- 代码生成表
|
||||
CREATE TABLE js_gen_table
|
||||
(
|
||||
table_name varchar2(64) NOT NULL,
|
||||
class_name varchar2(100) NOT NULL,
|
||||
comments nvarchar2(500) NOT NULL,
|
||||
parent_table_name varchar2(64),
|
||||
parent_table_fk_name varchar2(64),
|
||||
tpl_category varchar2(200),
|
||||
package_name varchar2(500),
|
||||
module_name varchar2(30),
|
||||
sub_module_name varchar2(30),
|
||||
function_name nvarchar2(200),
|
||||
function_name_simple nvarchar2(50),
|
||||
function_author nvarchar2(50),
|
||||
gen_base_dir nvarchar2(1000),
|
||||
options nvarchar2(1000),
|
||||
create_by varchar2(64) NOT NULL,
|
||||
create_date timestamp NOT NULL,
|
||||
update_by varchar2(64) NOT NULL,
|
||||
update_date timestamp NOT NULL,
|
||||
remarks nvarchar2(500),
|
||||
PRIMARY KEY (table_name)
|
||||
);
|
||||
|
||||
|
||||
-- 代码生成表列
|
||||
CREATE TABLE js_gen_table_column
|
||||
(
|
||||
id varchar2(64) NOT NULL,
|
||||
table_name varchar2(64) NOT NULL,
|
||||
column_name varchar2(64) NOT NULL,
|
||||
column_sort number(10),
|
||||
column_type varchar2(100) NOT NULL,
|
||||
column_label nvarchar2(50),
|
||||
comments nvarchar2(500) NOT NULL,
|
||||
attr_name varchar2(200) NOT NULL,
|
||||
attr_type varchar2(200) NOT NULL,
|
||||
is_pk char(1),
|
||||
is_null char(1),
|
||||
is_insert char(1),
|
||||
is_update char(1),
|
||||
is_list char(1),
|
||||
is_query char(1),
|
||||
query_type varchar2(200),
|
||||
is_edit char(1),
|
||||
show_type varchar2(200),
|
||||
options nvarchar2(1000),
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
|
||||
-- 行政区划
|
||||
CREATE TABLE js_sys_area
|
||||
(
|
||||
@@ -734,6 +788,8 @@ CREATE TABLE js_sys_user_role
|
||||
|
||||
/* Create Indexes */
|
||||
|
||||
CREATE INDEX idx_gen_table_ptn ON js_gen_table ();
|
||||
CREATE INDEX idx_gen_table_column_tn ON js_gen_table_column ();
|
||||
CREATE INDEX idx_sys_area_pc ON js_sys_area (parent_code);
|
||||
CREATE INDEX idx_sys_area_ts ON js_sys_area (tree_sort);
|
||||
CREATE INDEX idx_sys_area_status ON js_sys_area (status);
|
||||
@@ -861,6 +917,46 @@ CREATE INDEX idx_sys_user_cc ON js_sys_user (corp_code);
|
||||
|
||||
/* Comments */
|
||||
|
||||
COMMENT ON TABLE js_gen_table IS '代码生成表';
|
||||
COMMENT ON COLUMN js_gen_table.table_name IS '表名';
|
||||
COMMENT ON COLUMN js_gen_table.class_name IS '实体类名称';
|
||||
COMMENT ON COLUMN js_gen_table.comments IS '表说明';
|
||||
COMMENT ON COLUMN js_gen_table.parent_table_name IS '关联父表的表名';
|
||||
COMMENT ON COLUMN js_gen_table.parent_table_fk_name IS '本表关联父表的外键名';
|
||||
COMMENT ON COLUMN js_gen_table.tpl_category IS '使用的模板';
|
||||
COMMENT ON COLUMN js_gen_table.package_name IS '生成包路径';
|
||||
COMMENT ON COLUMN js_gen_table.module_name IS '生成模块名';
|
||||
COMMENT ON COLUMN js_gen_table.sub_module_name IS '生成子模块名';
|
||||
COMMENT ON COLUMN js_gen_table.function_name IS '生成功能名';
|
||||
COMMENT ON COLUMN js_gen_table.function_name_simple IS '生成功能名(简写)';
|
||||
COMMENT ON COLUMN js_gen_table.function_author IS '生成功能作者';
|
||||
COMMENT ON COLUMN js_gen_table.gen_base_dir IS '生成基础路径';
|
||||
COMMENT ON COLUMN js_gen_table.options IS '其它生成选项';
|
||||
COMMENT ON COLUMN js_gen_table.create_by IS '创建者';
|
||||
COMMENT ON COLUMN js_gen_table.create_date IS '创建时间';
|
||||
COMMENT ON COLUMN js_gen_table.update_by IS '更新者';
|
||||
COMMENT ON COLUMN js_gen_table.update_date IS '更新时间';
|
||||
COMMENT ON COLUMN js_gen_table.remarks IS '备注信息';
|
||||
COMMENT ON TABLE js_gen_table_column IS '代码生成表列';
|
||||
COMMENT ON COLUMN js_gen_table_column.id IS '编号';
|
||||
COMMENT ON COLUMN js_gen_table_column.table_name IS '表名';
|
||||
COMMENT ON COLUMN js_gen_table_column.column_name IS '列名';
|
||||
COMMENT ON COLUMN js_gen_table_column.column_sort IS '列排序(升序)';
|
||||
COMMENT ON COLUMN js_gen_table_column.column_type IS '类型';
|
||||
COMMENT ON COLUMN js_gen_table_column.column_label IS '列标签名';
|
||||
COMMENT ON COLUMN js_gen_table_column.comments IS '列备注说明';
|
||||
COMMENT ON COLUMN js_gen_table_column.attr_name IS '类的属性名';
|
||||
COMMENT ON COLUMN js_gen_table_column.attr_type IS '类的属性类型';
|
||||
COMMENT ON COLUMN js_gen_table_column.is_pk IS '是否主键';
|
||||
COMMENT ON COLUMN js_gen_table_column.is_null IS '是否可为空';
|
||||
COMMENT ON COLUMN js_gen_table_column.is_insert IS '是否插入字段';
|
||||
COMMENT ON COLUMN js_gen_table_column.is_update IS '是否更新字段';
|
||||
COMMENT ON COLUMN js_gen_table_column.is_list IS '是否列表字段';
|
||||
COMMENT ON COLUMN js_gen_table_column.is_query IS '是否查询字段';
|
||||
COMMENT ON COLUMN js_gen_table_column.query_type IS '查询方式';
|
||||
COMMENT ON COLUMN js_gen_table_column.is_edit IS '是否编辑字段';
|
||||
COMMENT ON COLUMN js_gen_table_column.show_type IS '表单类型';
|
||||
COMMENT ON COLUMN js_gen_table_column.options IS '其它生成选项';
|
||||
COMMENT ON TABLE js_sys_area IS '行政区划';
|
||||
COMMENT ON COLUMN js_sys_area.area_code IS '区域编码';
|
||||
COMMENT ON COLUMN js_sys_area.parent_code IS '父级编号';
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
|
||||
/* Drop Tables */
|
||||
|
||||
DROP TABLE IF EXISTS js_gen_table_column;
|
||||
DROP TABLE IF EXISTS js_gen_table;
|
||||
DROP TABLE IF EXISTS js_sys_company_office;
|
||||
DROP TABLE IF EXISTS js_sys_employee_post;
|
||||
DROP TABLE IF EXISTS js_sys_user_data_scope;
|
||||
@@ -36,6 +38,58 @@ DROP TABLE IF EXISTS js_sys_role;
|
||||
|
||||
/* Create Tables */
|
||||
|
||||
-- 代码生成表
|
||||
CREATE TABLE js_gen_table
|
||||
(
|
||||
table_name varchar(64) NOT NULL,
|
||||
class_name varchar(100) NOT NULL,
|
||||
comments varchar(500) NOT NULL,
|
||||
parent_table_name varchar(64),
|
||||
parent_table_fk_name varchar(64),
|
||||
tpl_category varchar(200),
|
||||
package_name varchar(500),
|
||||
module_name varchar(30),
|
||||
sub_module_name varchar(30),
|
||||
function_name varchar(200),
|
||||
function_name_simple varchar(50),
|
||||
function_author varchar(50),
|
||||
gen_base_dir varchar(1000),
|
||||
options varchar(1000),
|
||||
create_by varchar(64) NOT NULL,
|
||||
create_date timestamp NOT NULL,
|
||||
update_by varchar(64) NOT NULL,
|
||||
update_date timestamp NOT NULL,
|
||||
remarks varchar(500),
|
||||
PRIMARY KEY (table_name)
|
||||
) WITHOUT OIDS;
|
||||
|
||||
|
||||
-- 代码生成表列
|
||||
CREATE TABLE js_gen_table_column
|
||||
(
|
||||
id varchar(64) NOT NULL,
|
||||
table_name varchar(64) NOT NULL,
|
||||
column_name varchar(64) NOT NULL,
|
||||
column_sort decimal(10),
|
||||
column_type varchar(100) NOT NULL,
|
||||
column_label varchar(50),
|
||||
comments varchar(500) NOT NULL,
|
||||
attr_name varchar(200) NOT NULL,
|
||||
attr_type varchar(200) NOT NULL,
|
||||
is_pk char(1),
|
||||
is_null char(1),
|
||||
is_insert char(1),
|
||||
is_update char(1),
|
||||
is_list char(1),
|
||||
is_query char(1),
|
||||
query_type varchar(200),
|
||||
is_edit char(1),
|
||||
show_type varchar(200),
|
||||
options varchar(1000),
|
||||
PRIMARY KEY (id)
|
||||
) WITHOUT OIDS;
|
||||
|
||||
|
||||
-- 行政区划
|
||||
CREATE TABLE js_sys_area
|
||||
(
|
||||
@@ -734,6 +788,8 @@ CREATE TABLE js_sys_user_role
|
||||
|
||||
/* Create Indexes */
|
||||
|
||||
CREATE INDEX idx_gen_table_ptn ON js_gen_table ();
|
||||
CREATE INDEX idx_gen_table_column_tn ON js_gen_table_column ();
|
||||
CREATE INDEX idx_sys_area_pc ON js_sys_area (parent_code);
|
||||
CREATE INDEX idx_sys_area_ts ON js_sys_area (tree_sort);
|
||||
CREATE INDEX idx_sys_area_status ON js_sys_area (status);
|
||||
@@ -861,6 +917,46 @@ CREATE INDEX idx_sys_user_cc ON js_sys_user (corp_code);
|
||||
|
||||
/* Comments */
|
||||
|
||||
COMMENT ON TABLE js_gen_table IS '代码生成表';
|
||||
COMMENT ON COLUMN js_gen_table.table_name IS '表名';
|
||||
COMMENT ON COLUMN js_gen_table.class_name IS '实体类名称';
|
||||
COMMENT ON COLUMN js_gen_table.comments IS '表说明';
|
||||
COMMENT ON COLUMN js_gen_table.parent_table_name IS '关联父表的表名';
|
||||
COMMENT ON COLUMN js_gen_table.parent_table_fk_name IS '本表关联父表的外键名';
|
||||
COMMENT ON COLUMN js_gen_table.tpl_category IS '使用的模板';
|
||||
COMMENT ON COLUMN js_gen_table.package_name IS '生成包路径';
|
||||
COMMENT ON COLUMN js_gen_table.module_name IS '生成模块名';
|
||||
COMMENT ON COLUMN js_gen_table.sub_module_name IS '生成子模块名';
|
||||
COMMENT ON COLUMN js_gen_table.function_name IS '生成功能名';
|
||||
COMMENT ON COLUMN js_gen_table.function_name_simple IS '生成功能名(简写)';
|
||||
COMMENT ON COLUMN js_gen_table.function_author IS '生成功能作者';
|
||||
COMMENT ON COLUMN js_gen_table.gen_base_dir IS '生成基础路径';
|
||||
COMMENT ON COLUMN js_gen_table.options IS '其它生成选项';
|
||||
COMMENT ON COLUMN js_gen_table.create_by IS '创建者';
|
||||
COMMENT ON COLUMN js_gen_table.create_date IS '创建时间';
|
||||
COMMENT ON COLUMN js_gen_table.update_by IS '更新者';
|
||||
COMMENT ON COLUMN js_gen_table.update_date IS '更新时间';
|
||||
COMMENT ON COLUMN js_gen_table.remarks IS '备注信息';
|
||||
COMMENT ON TABLE js_gen_table_column IS '代码生成表列';
|
||||
COMMENT ON COLUMN js_gen_table_column.id IS '编号';
|
||||
COMMENT ON COLUMN js_gen_table_column.table_name IS '表名';
|
||||
COMMENT ON COLUMN js_gen_table_column.column_name IS '列名';
|
||||
COMMENT ON COLUMN js_gen_table_column.column_sort IS '列排序(升序)';
|
||||
COMMENT ON COLUMN js_gen_table_column.column_type IS '类型';
|
||||
COMMENT ON COLUMN js_gen_table_column.column_label IS '列标签名';
|
||||
COMMENT ON COLUMN js_gen_table_column.comments IS '列备注说明';
|
||||
COMMENT ON COLUMN js_gen_table_column.attr_name IS '类的属性名';
|
||||
COMMENT ON COLUMN js_gen_table_column.attr_type IS '类的属性类型';
|
||||
COMMENT ON COLUMN js_gen_table_column.is_pk IS '是否主键';
|
||||
COMMENT ON COLUMN js_gen_table_column.is_null IS '是否可为空';
|
||||
COMMENT ON COLUMN js_gen_table_column.is_insert IS '是否插入字段';
|
||||
COMMENT ON COLUMN js_gen_table_column.is_update IS '是否更新字段';
|
||||
COMMENT ON COLUMN js_gen_table_column.is_list IS '是否列表字段';
|
||||
COMMENT ON COLUMN js_gen_table_column.is_query IS '是否查询字段';
|
||||
COMMENT ON COLUMN js_gen_table_column.query_type IS '查询方式';
|
||||
COMMENT ON COLUMN js_gen_table_column.is_edit IS '是否编辑字段';
|
||||
COMMENT ON COLUMN js_gen_table_column.show_type IS '表单类型';
|
||||
COMMENT ON COLUMN js_gen_table_column.options IS '其它生成选项';
|
||||
COMMENT ON TABLE js_sys_area IS '行政区划';
|
||||
COMMENT ON COLUMN js_sys_area.area_code IS '区域编码';
|
||||
COMMENT ON COLUMN js_sys_area.parent_code IS '父级编号';
|
||||
|
||||
@@ -35,13 +35,6 @@
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 代码生成模块 -->
|
||||
<dependency>
|
||||
<groupId>com.jeesite</groupId>
|
||||
<artifactId>jeesite-module-devtools</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
@@ -6,8 +6,13 @@ package com.jeesite.modules.sys.db;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import com.jeesite.common.callback.MethodCallback;
|
||||
import com.jeesite.common.config.Global;
|
||||
import com.jeesite.common.idgen.IdGen;
|
||||
import com.jeesite.common.lang.StringUtils;
|
||||
import com.jeesite.common.tests.BaseInitDataTests;
|
||||
import com.jeesite.modules.gen.entity.GenTable;
|
||||
import com.jeesite.modules.gen.entity.GenTableColumn;
|
||||
import com.jeesite.modules.gen.service.GenTableService;
|
||||
import com.jeesite.modules.sys.dao.RoleMenuDao;
|
||||
import com.jeesite.modules.sys.entity.Area;
|
||||
import com.jeesite.modules.sys.entity.Company;
|
||||
@@ -61,6 +66,7 @@ public class InitCoreData extends BaseInitDataTests {
|
||||
public void createTable() throws Exception{
|
||||
runScript("core.sql");
|
||||
runScript("job.sql");
|
||||
runScript("test.sql");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -360,4 +366,135 @@ public class InitCoreData extends BaseInitDataTests {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private GenTableService genTableService;
|
||||
/**
|
||||
* 代码生成测试数据
|
||||
*/
|
||||
public void initGenTestData() throws Exception{
|
||||
GenTable genTable = new GenTable();
|
||||
genTable.setIsNewRecord(true);
|
||||
genTable.setTableName("test_data");
|
||||
genTable = genTableService.getFromDb(genTable);
|
||||
genTable.setIsNewRecord(true);
|
||||
genTable.setClassName("TestData");
|
||||
genTable.setFunctionAuthor("ThinkGem");
|
||||
genTable.setTplCategory("crud");
|
||||
genTable.setPackageName("com.jeesite.modules");
|
||||
genTable.setModuleName("test");
|
||||
genTable.setSubModuleName("");
|
||||
genTable.setFunctionName("测试数据");
|
||||
genTable.setFunctionNameSimple("数据");
|
||||
genTable.getOptionMap().put("isHaveDisableEnable", Global.YES);
|
||||
genTable.getOptionMap().put("isHaveDelete", Global.YES);
|
||||
genTable.getOptionMap().put("isFileUpload", Global.YES);
|
||||
genTable.getOptionMap().put("isImageUpload", Global.YES);
|
||||
initGenTableColumn(genTable);
|
||||
genTableService.save(genTable);
|
||||
// 子表
|
||||
GenTable genTableChild = new GenTable();
|
||||
genTableChild.setIsNewRecord(true);
|
||||
genTableChild.setTableName("test_data_child");
|
||||
genTableChild = genTableService.getFromDb(genTableChild);
|
||||
genTableChild.setIsNewRecord(true);
|
||||
genTableChild.setClassName("TestDataChild");
|
||||
genTableChild.setFunctionAuthor("ThinkGem");
|
||||
genTableChild.setTplCategory("crud");
|
||||
genTableChild.setPackageName("com.jeesite.modules");
|
||||
genTableChild.setModuleName("test");
|
||||
genTableChild.setSubModuleName("");
|
||||
genTableChild.setFunctionName("测试子表");
|
||||
genTableChild.setFunctionNameSimple("数据");
|
||||
genTableChild.setParentTableName("test_data");
|
||||
genTableChild.setParentTableFkName("test_data_id");
|
||||
initGenTableColumn(genTableChild);
|
||||
genTableService.save(genTableChild);
|
||||
}
|
||||
|
||||
/**
|
||||
* 代码生成测试数据(列初始化)
|
||||
*/
|
||||
private void initGenTableColumn(GenTable genTable){
|
||||
for(GenTableColumn column : genTable.getColumnList()){
|
||||
if ("test_input".equals(column.getColumnName())
|
||||
|| "test_textarea".equals(column.getColumnName())
|
||||
|| "test_select".equals(column.getColumnName())
|
||||
|| "test_select_multiple".equals(column.getColumnName())
|
||||
|| "test_checkbox".equals(column.getColumnName())
|
||||
|| "test_radio".equals(column.getColumnName())
|
||||
|| "test_date".equals(column.getColumnName())
|
||||
|| "test_datetime".equals(column.getColumnName())
|
||||
){
|
||||
column.setShowType(StringUtils.substringAfter(
|
||||
column.getColumnName(), "test_"));
|
||||
if ("test_input".equals(column.getColumnName())
|
||||
){
|
||||
column.setQueryType("LIKE");
|
||||
}
|
||||
else if ("test_textarea".equals(column.getColumnName())
|
||||
){
|
||||
column.setQueryType("LIKE");
|
||||
column.getOptionMap().put("isNewLine", Global.YES);
|
||||
column.getOptionMap().put("gridRowCol", "12/2/10");
|
||||
}
|
||||
else if ("test_select".equals(column.getColumnName())
|
||||
|| "test_select_multiple".equals(column.getColumnName())
|
||||
|| "test_radio".equals(column.getColumnName())
|
||||
|| "test_checkbox".equals(column.getColumnName())
|
||||
){
|
||||
column.getOptionMap().put("dictType", "sys_menu_type");
|
||||
column.getOptionMap().put("dictName", "sys_menu_type");
|
||||
}
|
||||
else if ("test_date".equals(column.getColumnName())
|
||||
|| "test_datetime".equals(column.getColumnName())
|
||||
){
|
||||
column.setQueryType("BETWEEN");
|
||||
}
|
||||
}else if ("test_user_code".equals(column.getColumnName())){
|
||||
column.setAttrType("com.jeesite.modules.sys.entity.User");
|
||||
column.setFullAttrName("testUser");
|
||||
column.setShowType("userselect");
|
||||
}else if ("test_office_code".equals(column.getColumnName())){
|
||||
column.setAttrType("com.jeesite.modules.sys.entity.Office");
|
||||
column.setFullAttrName("testOffice");
|
||||
column.setShowType("officeselect");
|
||||
}else if ("test_area_code".equals(column.getColumnName())){
|
||||
column.setFullAttrName("testAreaCode|testAreaName");
|
||||
column.setShowType("areaselect");
|
||||
}else if ("test_area_name".equals(column.getColumnName())){
|
||||
column.setIsEdit(Global.NO);
|
||||
column.setIsQuery(Global.NO);
|
||||
}else if ("test_data_id".equals(column.getColumnName())){
|
||||
column.setFullAttrName("testData");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 代码生成树表测试数据
|
||||
*/
|
||||
public void initGenTreeData() throws Exception{
|
||||
GenTable genTable = new GenTable();
|
||||
genTable.setIsNewRecord(true);
|
||||
genTable.setTableName("test_tree");
|
||||
genTable = genTableService.getFromDb(genTable);
|
||||
genTable.setIsNewRecord(true);
|
||||
genTable.setClassName("TestTree");
|
||||
genTable.setFunctionAuthor("ThinkGem");
|
||||
genTable.setTplCategory("treeGrid");
|
||||
genTable.setPackageName("com.jeesite.modules");
|
||||
genTable.setModuleName("test");
|
||||
genTable.setSubModuleName("");
|
||||
genTable.setFunctionName("测试树表");
|
||||
genTable.setFunctionNameSimple("数据");
|
||||
genTable.getOptionMap().put("isHaveDisableEnable", Global.YES);
|
||||
genTable.getOptionMap().put("isHaveDelete", Global.YES);
|
||||
genTable.getOptionMap().put("isFileUpload", Global.YES);
|
||||
genTable.getOptionMap().put("isImageUpload", Global.YES);
|
||||
genTable.getOptionMap().put("treeViewCode", "tree_code");
|
||||
genTable.getOptionMap().put("treeViewName", "tree_name");
|
||||
initGenTableColumn(genTable);
|
||||
genTableService.save(genTable);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
<label class="control-label col-sm-2" title="">
|
||||
<span class="required hide">*</span> 提交的数据:<i class="fa icon-question hide"></i></label>
|
||||
<div class="col-sm-10">
|
||||
<#form:input path="requestParams" class="form-control "/>
|
||||
<#form:textarea path="requestParams" rows="1" class="form-control "/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -9,9 +9,6 @@
|
||||
<dependent-module archiveName="jeesite-framework-4.0.3-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/jeesite-framework/jeesite-framework">
|
||||
<dependency-type>uses</dependency-type>
|
||||
</dependent-module>
|
||||
<dependent-module archiveName="jeesite-module-devtools-4.0.3-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/jeesite-module-devtools/jeesite-module-devtools">
|
||||
<dependency-type>uses</dependency-type>
|
||||
</dependent-module>
|
||||
<property name="component.exclusion.patterns"/>
|
||||
<property name="java-output-path" value="/src/main/webapp/WEB-INF/classes"/>
|
||||
<property name="context-root" value="js"/>
|
||||
|
||||
@@ -36,6 +36,6 @@ echo.
|
||||
cd %~dp0
|
||||
|
||||
cd ..
|
||||
call mvn test -Dtest=com.jeesite.test.InitCoreData,com.jeesite.test.InitGenData
|
||||
call mvn test -Dtest=com.jeesite.test.InitCoreData
|
||||
|
||||
pause
|
||||
@@ -29,4 +29,4 @@ read -s -n1 -p "请按任意键继续 ... "
|
||||
echo ""
|
||||
|
||||
cd ..
|
||||
mvn test -Dtest=com.jeesite.test.InitCoreData,com.jeesite.test.InitGenData
|
||||
mvn test -Dtest=com.jeesite.test.InitCoreData
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
|
||||
/* Drop Tables */
|
||||
|
||||
IF OBJECT_ID('[js_gen_table_column]') IS NOT NULL DROP TABLE [js_gen_table_column];
|
||||
IF OBJECT_ID('[js_gen_table]') IS NOT NULL DROP TABLE [js_gen_table];
|
||||
IF OBJECT_ID('[js_sys_company_office]') IS NOT NULL DROP TABLE [js_sys_company_office];
|
||||
IF OBJECT_ID('[js_sys_employee_post]') IS NOT NULL DROP TABLE [js_sys_employee_post];
|
||||
IF OBJECT_ID('[js_sys_user_data_scope]') IS NOT NULL DROP TABLE [js_sys_user_data_scope];
|
||||
@@ -36,6 +38,58 @@ IF OBJECT_ID('[js_sys_role]') IS NOT NULL DROP TABLE [js_sys_role];
|
||||
|
||||
/* Create Tables */
|
||||
|
||||
-- 代码生成表
|
||||
CREATE TABLE [js_gen_table]
|
||||
(
|
||||
[table_name] varchar(64) NOT NULL,
|
||||
[class_name] varchar(100) NOT NULL,
|
||||
[comments] nvarchar(500) NOT NULL,
|
||||
[parent_table_name] varchar(64),
|
||||
[parent_table_fk_name] varchar(64),
|
||||
[tpl_category] varchar(200),
|
||||
[package_name] varchar(500),
|
||||
[module_name] varchar(30),
|
||||
[sub_module_name] varchar(30),
|
||||
[function_name] nvarchar(200),
|
||||
[function_name_simple] nvarchar(50),
|
||||
[function_author] nvarchar(50),
|
||||
[gen_base_dir] nvarchar(1000),
|
||||
[options] nvarchar(1000),
|
||||
[create_by] varchar(64) NOT NULL,
|
||||
[create_date] datetime NOT NULL,
|
||||
[update_by] varchar(64) NOT NULL,
|
||||
[update_date] datetime NOT NULL,
|
||||
[remarks] nvarchar(500),
|
||||
PRIMARY KEY ([table_name])
|
||||
);
|
||||
|
||||
|
||||
-- 代码生成表列
|
||||
CREATE TABLE [js_gen_table_column]
|
||||
(
|
||||
[id] varchar(64) NOT NULL,
|
||||
[table_name] varchar(64) NOT NULL,
|
||||
[column_name] varchar(64) NOT NULL,
|
||||
[column_sort] decimal(10),
|
||||
[column_type] varchar(100) NOT NULL,
|
||||
[column_label] nvarchar(50),
|
||||
[comments] nvarchar(500) NOT NULL,
|
||||
[attr_name] varchar(200) NOT NULL,
|
||||
[attr_type] varchar(200) NOT NULL,
|
||||
[is_pk] char(1),
|
||||
[is_null] char(1),
|
||||
[is_insert] char(1),
|
||||
[is_update] char(1),
|
||||
[is_list] char(1),
|
||||
[is_query] char(1),
|
||||
[query_type] varchar(200),
|
||||
[is_edit] char(1),
|
||||
[show_type] varchar(200),
|
||||
[options] nvarchar(1000),
|
||||
PRIMARY KEY ([id])
|
||||
);
|
||||
|
||||
|
||||
-- 行政区划
|
||||
CREATE TABLE [js_sys_area]
|
||||
(
|
||||
@@ -734,6 +788,8 @@ CREATE TABLE [js_sys_user_role]
|
||||
|
||||
/* Create Indexes */
|
||||
|
||||
CREATE INDEX [idx_gen_table_ptn] ON [js_gen_table] ();
|
||||
CREATE INDEX [idx_gen_table_column_tn] ON [js_gen_table_column] ();
|
||||
CREATE INDEX [idx_sys_area_pc] ON [js_sys_area] ([parent_code]);
|
||||
CREATE INDEX [idx_sys_area_ts] ON [js_sys_area] ([tree_sort]);
|
||||
CREATE INDEX [idx_sys_area_status] ON [js_sys_area] ([status]);
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
|
||||
/* Drop Tables */
|
||||
|
||||
IF OBJECT_ID('[js_gen_table_column]') IS NOT NULL DROP TABLE [js_gen_table_column];
|
||||
IF OBJECT_ID('[js_gen_table]') IS NOT NULL DROP TABLE [js_gen_table];
|
||||
|
||||
|
||||
|
||||
|
||||
/* Create Tables */
|
||||
|
||||
-- 代码生成表
|
||||
CREATE TABLE [js_gen_table]
|
||||
(
|
||||
[table_name] varchar(64) NOT NULL,
|
||||
[class_name] varchar(100) NOT NULL,
|
||||
[comments] nvarchar(500) NOT NULL,
|
||||
[parent_table_name] varchar(64),
|
||||
[parent_table_fk_name] varchar(64),
|
||||
[tpl_category] varchar(200),
|
||||
[package_name] varchar(500),
|
||||
[module_name] varchar(30),
|
||||
[sub_module_name] varchar(30),
|
||||
[function_name] nvarchar(200),
|
||||
[function_name_simple] nvarchar(50),
|
||||
[function_author] nvarchar(50),
|
||||
[gen_base_dir] nvarchar(1000),
|
||||
[options] nvarchar(1000),
|
||||
[create_by] varchar(64) NOT NULL,
|
||||
[create_date] datetime NOT NULL,
|
||||
[update_by] varchar(64) NOT NULL,
|
||||
[update_date] datetime NOT NULL,
|
||||
[remarks] nvarchar(500),
|
||||
PRIMARY KEY ([table_name])
|
||||
);
|
||||
|
||||
|
||||
-- 代码生成表列
|
||||
CREATE TABLE [js_gen_table_column]
|
||||
(
|
||||
[id] varchar(64) NOT NULL,
|
||||
[table_name] varchar(64) NOT NULL,
|
||||
[column_name] varchar(64) NOT NULL,
|
||||
[column_sort] decimal(10),
|
||||
[column_type] varchar(100) NOT NULL,
|
||||
[column_label] nvarchar(50),
|
||||
[comments] nvarchar(500) NOT NULL,
|
||||
[attr_name] varchar(200) NOT NULL,
|
||||
[attr_type] varchar(200) NOT NULL,
|
||||
[is_pk] char(1),
|
||||
[is_null] char(1),
|
||||
[is_insert] char(1),
|
||||
[is_update] char(1),
|
||||
[is_list] char(1),
|
||||
[is_query] char(1),
|
||||
[query_type] varchar(200),
|
||||
[is_edit] char(1),
|
||||
[show_type] varchar(200),
|
||||
[options] nvarchar(1000),
|
||||
PRIMARY KEY ([id])
|
||||
);
|
||||
|
||||
|
||||
|
||||
/* Create Indexes */
|
||||
|
||||
CREATE INDEX [idx_gen_table_ptn] ON [js_gen_table] ([parent_table_name]);
|
||||
CREATE INDEX [idx_gen_table_column_tn] ON [js_gen_table_column] ([table_name]);
|
||||
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@ SET SESSION FOREIGN_KEY_CHECKS=0;
|
||||
|
||||
/* Drop Tables */
|
||||
|
||||
DROP TABLE IF EXISTS js_gen_table_column;
|
||||
DROP TABLE IF EXISTS js_gen_table;
|
||||
DROP TABLE IF EXISTS js_sys_company_office;
|
||||
DROP TABLE IF EXISTS js_sys_employee_post;
|
||||
DROP TABLE IF EXISTS js_sys_user_data_scope;
|
||||
@@ -37,6 +39,58 @@ DROP TABLE IF EXISTS js_sys_role;
|
||||
|
||||
/* Create Tables */
|
||||
|
||||
-- 代码生成表
|
||||
CREATE TABLE js_gen_table
|
||||
(
|
||||
table_name varchar(64) NOT NULL COMMENT '表名',
|
||||
class_name varchar(100) NOT NULL COMMENT '实体类名称',
|
||||
comments varchar(500) NOT NULL COMMENT '表说明',
|
||||
parent_table_name varchar(64) COMMENT '关联父表的表名',
|
||||
parent_table_fk_name varchar(64) COMMENT '本表关联父表的外键名',
|
||||
tpl_category varchar(200) COMMENT '使用的模板',
|
||||
package_name varchar(500) COMMENT '生成包路径',
|
||||
module_name varchar(30) COMMENT '生成模块名',
|
||||
sub_module_name varchar(30) COMMENT '生成子模块名',
|
||||
function_name varchar(200) COMMENT '生成功能名',
|
||||
function_name_simple varchar(50) COMMENT '生成功能名(简写)',
|
||||
function_author varchar(50) COMMENT '生成功能作者',
|
||||
gen_base_dir varchar(1000) COMMENT '生成基础路径',
|
||||
options varchar(1000) COMMENT '其它生成选项',
|
||||
create_by varchar(64) NOT NULL COMMENT '创建者',
|
||||
create_date datetime NOT NULL COMMENT '创建时间',
|
||||
update_by varchar(64) NOT NULL COMMENT '更新者',
|
||||
update_date datetime NOT NULL COMMENT '更新时间',
|
||||
remarks varchar(500) COMMENT '备注信息',
|
||||
PRIMARY KEY (table_name)
|
||||
) COMMENT = '代码生成表';
|
||||
|
||||
|
||||
-- 代码生成表列
|
||||
CREATE TABLE js_gen_table_column
|
||||
(
|
||||
id varchar(64) NOT NULL COMMENT '编号',
|
||||
table_name varchar(64) NOT NULL COMMENT '表名',
|
||||
column_name varchar(64) NOT NULL COMMENT '列名',
|
||||
column_sort decimal(10) COMMENT '列排序(升序)',
|
||||
column_type varchar(100) NOT NULL COMMENT '类型',
|
||||
column_label varchar(50) COMMENT '列标签名',
|
||||
comments varchar(500) NOT NULL COMMENT '列备注说明',
|
||||
attr_name varchar(200) NOT NULL COMMENT '类的属性名',
|
||||
attr_type varchar(200) NOT NULL COMMENT '类的属性类型',
|
||||
is_pk char(1) COMMENT '是否主键',
|
||||
is_null char(1) COMMENT '是否可为空',
|
||||
is_insert char(1) COMMENT '是否插入字段',
|
||||
is_update char(1) COMMENT '是否更新字段',
|
||||
is_list char(1) COMMENT '是否列表字段',
|
||||
is_query char(1) COMMENT '是否查询字段',
|
||||
query_type varchar(200) COMMENT '查询方式',
|
||||
is_edit char(1) COMMENT '是否编辑字段',
|
||||
show_type varchar(200) COMMENT '表单类型',
|
||||
options varchar(1000) COMMENT '其它生成选项',
|
||||
PRIMARY KEY (id)
|
||||
) COMMENT = '代码生成表列';
|
||||
|
||||
|
||||
-- 行政区划
|
||||
CREATE TABLE js_sys_area
|
||||
(
|
||||
@@ -737,6 +791,8 @@ CREATE TABLE js_sys_user_role
|
||||
|
||||
/* Create Indexes */
|
||||
|
||||
CREATE INDEX idx_gen_table_ptn ON js_gen_table ();
|
||||
CREATE INDEX idx_gen_table_column_tn ON js_gen_table_column ();
|
||||
CREATE INDEX idx_sys_area_pc ON js_sys_area (parent_code ASC);
|
||||
CREATE INDEX idx_sys_area_ts ON js_sys_area (tree_sort ASC);
|
||||
CREATE INDEX idx_sys_area_status ON js_sys_area (status ASC);
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
SET SESSION FOREIGN_KEY_CHECKS=0;
|
||||
|
||||
/* Drop Tables */
|
||||
|
||||
DROP TABLE IF EXISTS js_gen_table_column;
|
||||
DROP TABLE IF EXISTS js_gen_table;
|
||||
|
||||
|
||||
|
||||
|
||||
/* Create Tables */
|
||||
|
||||
-- 代码生成表
|
||||
CREATE TABLE js_gen_table
|
||||
(
|
||||
table_name varchar(64) NOT NULL COMMENT '表名',
|
||||
class_name varchar(100) NOT NULL COMMENT '实体类名称',
|
||||
comments varchar(500) NOT NULL COMMENT '表说明',
|
||||
parent_table_name varchar(64) COMMENT '关联父表的表名',
|
||||
parent_table_fk_name varchar(64) COMMENT '本表关联父表的外键名',
|
||||
tpl_category varchar(200) COMMENT '使用的模板',
|
||||
package_name varchar(500) COMMENT '生成包路径',
|
||||
module_name varchar(30) COMMENT '生成模块名',
|
||||
sub_module_name varchar(30) COMMENT '生成子模块名',
|
||||
function_name varchar(200) COMMENT '生成功能名',
|
||||
function_name_simple varchar(50) COMMENT '生成功能名(简写)',
|
||||
function_author varchar(50) COMMENT '生成功能作者',
|
||||
gen_base_dir varchar(1000) COMMENT '生成基础路径',
|
||||
options varchar(1000) COMMENT '其它生成选项',
|
||||
create_by varchar(64) NOT NULL COMMENT '创建者',
|
||||
create_date datetime NOT NULL COMMENT '创建时间',
|
||||
update_by varchar(64) NOT NULL COMMENT '更新者',
|
||||
update_date datetime NOT NULL COMMENT '更新时间',
|
||||
remarks varchar(500) COMMENT '备注信息',
|
||||
PRIMARY KEY (table_name)
|
||||
) COMMENT = '代码生成表';
|
||||
|
||||
|
||||
-- 代码生成表列
|
||||
CREATE TABLE js_gen_table_column
|
||||
(
|
||||
id varchar(64) NOT NULL COMMENT '编号',
|
||||
table_name varchar(64) NOT NULL COMMENT '表名',
|
||||
column_name varchar(64) NOT NULL COMMENT '列名',
|
||||
column_sort decimal(10) COMMENT '列排序(升序)',
|
||||
column_type varchar(100) NOT NULL COMMENT '类型',
|
||||
column_label varchar(50) COMMENT '列标签名',
|
||||
comments varchar(500) NOT NULL COMMENT '列备注说明',
|
||||
attr_name varchar(200) NOT NULL COMMENT '类的属性名',
|
||||
attr_type varchar(200) NOT NULL COMMENT '类的属性类型',
|
||||
is_pk char(1) COMMENT '是否主键',
|
||||
is_null char(1) COMMENT '是否可为空',
|
||||
is_insert char(1) COMMENT '是否插入字段',
|
||||
is_update char(1) COMMENT '是否更新字段',
|
||||
is_list char(1) COMMENT '是否列表字段',
|
||||
is_query char(1) COMMENT '是否查询字段',
|
||||
query_type varchar(200) COMMENT '查询方式',
|
||||
is_edit char(1) COMMENT '是否编辑字段',
|
||||
show_type varchar(200) COMMENT '表单类型',
|
||||
options varchar(1000) COMMENT '其它生成选项',
|
||||
PRIMARY KEY (id)
|
||||
) COMMENT = '代码生成表列';
|
||||
|
||||
|
||||
|
||||
/* Create Indexes */
|
||||
|
||||
CREATE INDEX idx_gen_table_ptn ON js_gen_table (parent_table_name ASC);
|
||||
CREATE INDEX idx_gen_table_column_tn ON js_gen_table_column (table_name ASC);
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
|
||||
/* Drop Tables */
|
||||
|
||||
DROP TABLE js_gen_table_column CASCADE CONSTRAINTS;
|
||||
DROP TABLE js_gen_table CASCADE CONSTRAINTS;
|
||||
DROP TABLE js_sys_company_office CASCADE CONSTRAINTS;
|
||||
DROP TABLE js_sys_employee_post CASCADE CONSTRAINTS;
|
||||
DROP TABLE js_sys_user_data_scope CASCADE CONSTRAINTS;
|
||||
@@ -36,6 +38,58 @@ DROP TABLE js_sys_role CASCADE CONSTRAINTS;
|
||||
|
||||
/* Create Tables */
|
||||
|
||||
-- 代码生成表
|
||||
CREATE TABLE js_gen_table
|
||||
(
|
||||
table_name varchar2(64) NOT NULL,
|
||||
class_name varchar2(100) NOT NULL,
|
||||
comments nvarchar2(500) NOT NULL,
|
||||
parent_table_name varchar2(64),
|
||||
parent_table_fk_name varchar2(64),
|
||||
tpl_category varchar2(200),
|
||||
package_name varchar2(500),
|
||||
module_name varchar2(30),
|
||||
sub_module_name varchar2(30),
|
||||
function_name nvarchar2(200),
|
||||
function_name_simple nvarchar2(50),
|
||||
function_author nvarchar2(50),
|
||||
gen_base_dir nvarchar2(1000),
|
||||
options nvarchar2(1000),
|
||||
create_by varchar2(64) NOT NULL,
|
||||
create_date timestamp NOT NULL,
|
||||
update_by varchar2(64) NOT NULL,
|
||||
update_date timestamp NOT NULL,
|
||||
remarks nvarchar2(500),
|
||||
PRIMARY KEY (table_name)
|
||||
);
|
||||
|
||||
|
||||
-- 代码生成表列
|
||||
CREATE TABLE js_gen_table_column
|
||||
(
|
||||
id varchar2(64) NOT NULL,
|
||||
table_name varchar2(64) NOT NULL,
|
||||
column_name varchar2(64) NOT NULL,
|
||||
column_sort number(10),
|
||||
column_type varchar2(100) NOT NULL,
|
||||
column_label nvarchar2(50),
|
||||
comments nvarchar2(500) NOT NULL,
|
||||
attr_name varchar2(200) NOT NULL,
|
||||
attr_type varchar2(200) NOT NULL,
|
||||
is_pk char(1),
|
||||
is_null char(1),
|
||||
is_insert char(1),
|
||||
is_update char(1),
|
||||
is_list char(1),
|
||||
is_query char(1),
|
||||
query_type varchar2(200),
|
||||
is_edit char(1),
|
||||
show_type varchar2(200),
|
||||
options nvarchar2(1000),
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
|
||||
-- 行政区划
|
||||
CREATE TABLE js_sys_area
|
||||
(
|
||||
@@ -734,6 +788,8 @@ CREATE TABLE js_sys_user_role
|
||||
|
||||
/* Create Indexes */
|
||||
|
||||
CREATE INDEX idx_gen_table_ptn ON js_gen_table ();
|
||||
CREATE INDEX idx_gen_table_column_tn ON js_gen_table_column ();
|
||||
CREATE INDEX idx_sys_area_pc ON js_sys_area (parent_code);
|
||||
CREATE INDEX idx_sys_area_ts ON js_sys_area (tree_sort);
|
||||
CREATE INDEX idx_sys_area_status ON js_sys_area (status);
|
||||
@@ -861,6 +917,46 @@ CREATE INDEX idx_sys_user_cc ON js_sys_user (corp_code);
|
||||
|
||||
/* Comments */
|
||||
|
||||
COMMENT ON TABLE js_gen_table IS '代码生成表';
|
||||
COMMENT ON COLUMN js_gen_table.table_name IS '表名';
|
||||
COMMENT ON COLUMN js_gen_table.class_name IS '实体类名称';
|
||||
COMMENT ON COLUMN js_gen_table.comments IS '表说明';
|
||||
COMMENT ON COLUMN js_gen_table.parent_table_name IS '关联父表的表名';
|
||||
COMMENT ON COLUMN js_gen_table.parent_table_fk_name IS '本表关联父表的外键名';
|
||||
COMMENT ON COLUMN js_gen_table.tpl_category IS '使用的模板';
|
||||
COMMENT ON COLUMN js_gen_table.package_name IS '生成包路径';
|
||||
COMMENT ON COLUMN js_gen_table.module_name IS '生成模块名';
|
||||
COMMENT ON COLUMN js_gen_table.sub_module_name IS '生成子模块名';
|
||||
COMMENT ON COLUMN js_gen_table.function_name IS '生成功能名';
|
||||
COMMENT ON COLUMN js_gen_table.function_name_simple IS '生成功能名(简写)';
|
||||
COMMENT ON COLUMN js_gen_table.function_author IS '生成功能作者';
|
||||
COMMENT ON COLUMN js_gen_table.gen_base_dir IS '生成基础路径';
|
||||
COMMENT ON COLUMN js_gen_table.options IS '其它生成选项';
|
||||
COMMENT ON COLUMN js_gen_table.create_by IS '创建者';
|
||||
COMMENT ON COLUMN js_gen_table.create_date IS '创建时间';
|
||||
COMMENT ON COLUMN js_gen_table.update_by IS '更新者';
|
||||
COMMENT ON COLUMN js_gen_table.update_date IS '更新时间';
|
||||
COMMENT ON COLUMN js_gen_table.remarks IS '备注信息';
|
||||
COMMENT ON TABLE js_gen_table_column IS '代码生成表列';
|
||||
COMMENT ON COLUMN js_gen_table_column.id IS '编号';
|
||||
COMMENT ON COLUMN js_gen_table_column.table_name IS '表名';
|
||||
COMMENT ON COLUMN js_gen_table_column.column_name IS '列名';
|
||||
COMMENT ON COLUMN js_gen_table_column.column_sort IS '列排序(升序)';
|
||||
COMMENT ON COLUMN js_gen_table_column.column_type IS '类型';
|
||||
COMMENT ON COLUMN js_gen_table_column.column_label IS '列标签名';
|
||||
COMMENT ON COLUMN js_gen_table_column.comments IS '列备注说明';
|
||||
COMMENT ON COLUMN js_gen_table_column.attr_name IS '类的属性名';
|
||||
COMMENT ON COLUMN js_gen_table_column.attr_type IS '类的属性类型';
|
||||
COMMENT ON COLUMN js_gen_table_column.is_pk IS '是否主键';
|
||||
COMMENT ON COLUMN js_gen_table_column.is_null IS '是否可为空';
|
||||
COMMENT ON COLUMN js_gen_table_column.is_insert IS '是否插入字段';
|
||||
COMMENT ON COLUMN js_gen_table_column.is_update IS '是否更新字段';
|
||||
COMMENT ON COLUMN js_gen_table_column.is_list IS '是否列表字段';
|
||||
COMMENT ON COLUMN js_gen_table_column.is_query IS '是否查询字段';
|
||||
COMMENT ON COLUMN js_gen_table_column.query_type IS '查询方式';
|
||||
COMMENT ON COLUMN js_gen_table_column.is_edit IS '是否编辑字段';
|
||||
COMMENT ON COLUMN js_gen_table_column.show_type IS '表单类型';
|
||||
COMMENT ON COLUMN js_gen_table_column.options IS '其它生成选项';
|
||||
COMMENT ON TABLE js_sys_area IS '行政区划';
|
||||
COMMENT ON COLUMN js_sys_area.area_code IS '区域编码';
|
||||
COMMENT ON COLUMN js_sys_area.parent_code IS '父级编号';
|
||||
|
||||
@@ -6,4 +6,10 @@ create user jeesite
|
||||
grant connect,resource,create session,select any table,
|
||||
create any view,create any table,create any index,
|
||||
drop any table,drop any view,drop any index
|
||||
to jeesite;
|
||||
to jeesite;
|
||||
|
||||
-- 多数据源分布式事务下,需要对目标用户进行如下授权,否则会提示错误:ResourceException: Error in recovery
|
||||
grant select on sys.dba_pending_transactions to jeesite;
|
||||
grant select on sys.pending_trans$ to jeesite;
|
||||
grant select on sys.dba_2pc_pending to jeesite;
|
||||
grant execute on sys.dbms_system to jeesite;
|
||||
|
||||
@@ -1,116 +0,0 @@
|
||||
|
||||
/* Drop Tables */
|
||||
|
||||
DROP TABLE js_gen_table_column CASCADE CONSTRAINTS;
|
||||
DROP TABLE js_gen_table CASCADE CONSTRAINTS;
|
||||
|
||||
|
||||
|
||||
|
||||
/* Create Tables */
|
||||
|
||||
-- 代码生成表
|
||||
CREATE TABLE js_gen_table
|
||||
(
|
||||
table_name varchar2(64) NOT NULL,
|
||||
class_name varchar2(100) NOT NULL,
|
||||
comments nvarchar2(500) NOT NULL,
|
||||
parent_table_name varchar2(64),
|
||||
parent_table_fk_name varchar2(64),
|
||||
tpl_category varchar2(200),
|
||||
package_name varchar2(500),
|
||||
module_name varchar2(30),
|
||||
sub_module_name varchar2(30),
|
||||
function_name nvarchar2(200),
|
||||
function_name_simple nvarchar2(50),
|
||||
function_author nvarchar2(50),
|
||||
gen_base_dir nvarchar2(1000),
|
||||
options nvarchar2(1000),
|
||||
create_by varchar2(64) NOT NULL,
|
||||
create_date timestamp NOT NULL,
|
||||
update_by varchar2(64) NOT NULL,
|
||||
update_date timestamp NOT NULL,
|
||||
remarks nvarchar2(500),
|
||||
PRIMARY KEY (table_name)
|
||||
);
|
||||
|
||||
|
||||
-- 代码生成表列
|
||||
CREATE TABLE js_gen_table_column
|
||||
(
|
||||
id varchar2(64) NOT NULL,
|
||||
table_name varchar2(64) NOT NULL,
|
||||
column_name varchar2(64) NOT NULL,
|
||||
column_sort number(10),
|
||||
column_type varchar2(100) NOT NULL,
|
||||
column_label nvarchar2(50),
|
||||
comments nvarchar2(500) NOT NULL,
|
||||
attr_name varchar2(200) NOT NULL,
|
||||
attr_type varchar2(200) NOT NULL,
|
||||
is_pk char(1),
|
||||
is_null char(1),
|
||||
is_insert char(1),
|
||||
is_update char(1),
|
||||
is_list char(1),
|
||||
is_query char(1),
|
||||
query_type varchar2(200),
|
||||
is_edit char(1),
|
||||
show_type varchar2(200),
|
||||
options nvarchar2(1000),
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
|
||||
|
||||
/* Create Indexes */
|
||||
|
||||
CREATE INDEX idx_gen_table_ptn ON js_gen_table (parent_table_name);
|
||||
CREATE INDEX idx_gen_table_column_tn ON js_gen_table_column (table_name);
|
||||
|
||||
|
||||
|
||||
/* Comments */
|
||||
|
||||
COMMENT ON TABLE js_gen_table IS '代码生成表';
|
||||
COMMENT ON COLUMN js_gen_table.table_name IS '表名';
|
||||
COMMENT ON COLUMN js_gen_table.class_name IS '实体类名称';
|
||||
COMMENT ON COLUMN js_gen_table.comments IS '表说明';
|
||||
COMMENT ON COLUMN js_gen_table.parent_table_name IS '关联父表的表名';
|
||||
COMMENT ON COLUMN js_gen_table.parent_table_fk_name IS '本表关联父表的外键名';
|
||||
COMMENT ON COLUMN js_gen_table.tpl_category IS '使用的模板';
|
||||
COMMENT ON COLUMN js_gen_table.package_name IS '生成包路径';
|
||||
COMMENT ON COLUMN js_gen_table.module_name IS '生成模块名';
|
||||
COMMENT ON COLUMN js_gen_table.sub_module_name IS '生成子模块名';
|
||||
COMMENT ON COLUMN js_gen_table.function_name IS '生成功能名';
|
||||
COMMENT ON COLUMN js_gen_table.function_name_simple IS '生成功能名(简写)';
|
||||
COMMENT ON COLUMN js_gen_table.function_author IS '生成功能作者';
|
||||
COMMENT ON COLUMN js_gen_table.gen_base_dir IS '生成基础路径';
|
||||
COMMENT ON COLUMN js_gen_table.options IS '其它生成选项';
|
||||
COMMENT ON COLUMN js_gen_table.create_by IS '创建者';
|
||||
COMMENT ON COLUMN js_gen_table.create_date IS '创建时间';
|
||||
COMMENT ON COLUMN js_gen_table.update_by IS '更新者';
|
||||
COMMENT ON COLUMN js_gen_table.update_date IS '更新时间';
|
||||
COMMENT ON COLUMN js_gen_table.remarks IS '备注信息';
|
||||
COMMENT ON TABLE js_gen_table_column IS '代码生成表列';
|
||||
COMMENT ON COLUMN js_gen_table_column.id IS '编号';
|
||||
COMMENT ON COLUMN js_gen_table_column.table_name IS '表名';
|
||||
COMMENT ON COLUMN js_gen_table_column.column_name IS '列名';
|
||||
COMMENT ON COLUMN js_gen_table_column.column_sort IS '列排序(升序)';
|
||||
COMMENT ON COLUMN js_gen_table_column.column_type IS '类型';
|
||||
COMMENT ON COLUMN js_gen_table_column.column_label IS '列标签名';
|
||||
COMMENT ON COLUMN js_gen_table_column.comments IS '列备注说明';
|
||||
COMMENT ON COLUMN js_gen_table_column.attr_name IS '类的属性名';
|
||||
COMMENT ON COLUMN js_gen_table_column.attr_type IS '类的属性类型';
|
||||
COMMENT ON COLUMN js_gen_table_column.is_pk IS '是否主键';
|
||||
COMMENT ON COLUMN js_gen_table_column.is_null IS '是否可为空';
|
||||
COMMENT ON COLUMN js_gen_table_column.is_insert IS '是否插入字段';
|
||||
COMMENT ON COLUMN js_gen_table_column.is_update IS '是否更新字段';
|
||||
COMMENT ON COLUMN js_gen_table_column.is_list IS '是否列表字段';
|
||||
COMMENT ON COLUMN js_gen_table_column.is_query IS '是否查询字段';
|
||||
COMMENT ON COLUMN js_gen_table_column.query_type IS '查询方式';
|
||||
COMMENT ON COLUMN js_gen_table_column.is_edit IS '是否编辑字段';
|
||||
COMMENT ON COLUMN js_gen_table_column.show_type IS '表单类型';
|
||||
COMMENT ON COLUMN js_gen_table_column.options IS '其它生成选项';
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
|
||||
/* Drop Tables */
|
||||
|
||||
DROP TABLE IF EXISTS js_gen_table_column;
|
||||
DROP TABLE IF EXISTS js_gen_table;
|
||||
DROP TABLE IF EXISTS js_sys_company_office;
|
||||
DROP TABLE IF EXISTS js_sys_employee_post;
|
||||
DROP TABLE IF EXISTS js_sys_user_data_scope;
|
||||
@@ -36,6 +38,58 @@ DROP TABLE IF EXISTS js_sys_role;
|
||||
|
||||
/* Create Tables */
|
||||
|
||||
-- 代码生成表
|
||||
CREATE TABLE js_gen_table
|
||||
(
|
||||
table_name varchar(64) NOT NULL,
|
||||
class_name varchar(100) NOT NULL,
|
||||
comments varchar(500) NOT NULL,
|
||||
parent_table_name varchar(64),
|
||||
parent_table_fk_name varchar(64),
|
||||
tpl_category varchar(200),
|
||||
package_name varchar(500),
|
||||
module_name varchar(30),
|
||||
sub_module_name varchar(30),
|
||||
function_name varchar(200),
|
||||
function_name_simple varchar(50),
|
||||
function_author varchar(50),
|
||||
gen_base_dir varchar(1000),
|
||||
options varchar(1000),
|
||||
create_by varchar(64) NOT NULL,
|
||||
create_date timestamp NOT NULL,
|
||||
update_by varchar(64) NOT NULL,
|
||||
update_date timestamp NOT NULL,
|
||||
remarks varchar(500),
|
||||
PRIMARY KEY (table_name)
|
||||
) WITHOUT OIDS;
|
||||
|
||||
|
||||
-- 代码生成表列
|
||||
CREATE TABLE js_gen_table_column
|
||||
(
|
||||
id varchar(64) NOT NULL,
|
||||
table_name varchar(64) NOT NULL,
|
||||
column_name varchar(64) NOT NULL,
|
||||
column_sort decimal(10),
|
||||
column_type varchar(100) NOT NULL,
|
||||
column_label varchar(50),
|
||||
comments varchar(500) NOT NULL,
|
||||
attr_name varchar(200) NOT NULL,
|
||||
attr_type varchar(200) NOT NULL,
|
||||
is_pk char(1),
|
||||
is_null char(1),
|
||||
is_insert char(1),
|
||||
is_update char(1),
|
||||
is_list char(1),
|
||||
is_query char(1),
|
||||
query_type varchar(200),
|
||||
is_edit char(1),
|
||||
show_type varchar(200),
|
||||
options varchar(1000),
|
||||
PRIMARY KEY (id)
|
||||
) WITHOUT OIDS;
|
||||
|
||||
|
||||
-- 行政区划
|
||||
CREATE TABLE js_sys_area
|
||||
(
|
||||
@@ -734,6 +788,8 @@ CREATE TABLE js_sys_user_role
|
||||
|
||||
/* Create Indexes */
|
||||
|
||||
CREATE INDEX idx_gen_table_ptn ON js_gen_table ();
|
||||
CREATE INDEX idx_gen_table_column_tn ON js_gen_table_column ();
|
||||
CREATE INDEX idx_sys_area_pc ON js_sys_area (parent_code);
|
||||
CREATE INDEX idx_sys_area_ts ON js_sys_area (tree_sort);
|
||||
CREATE INDEX idx_sys_area_status ON js_sys_area (status);
|
||||
@@ -861,6 +917,46 @@ CREATE INDEX idx_sys_user_cc ON js_sys_user (corp_code);
|
||||
|
||||
/* Comments */
|
||||
|
||||
COMMENT ON TABLE js_gen_table IS '代码生成表';
|
||||
COMMENT ON COLUMN js_gen_table.table_name IS '表名';
|
||||
COMMENT ON COLUMN js_gen_table.class_name IS '实体类名称';
|
||||
COMMENT ON COLUMN js_gen_table.comments IS '表说明';
|
||||
COMMENT ON COLUMN js_gen_table.parent_table_name IS '关联父表的表名';
|
||||
COMMENT ON COLUMN js_gen_table.parent_table_fk_name IS '本表关联父表的外键名';
|
||||
COMMENT ON COLUMN js_gen_table.tpl_category IS '使用的模板';
|
||||
COMMENT ON COLUMN js_gen_table.package_name IS '生成包路径';
|
||||
COMMENT ON COLUMN js_gen_table.module_name IS '生成模块名';
|
||||
COMMENT ON COLUMN js_gen_table.sub_module_name IS '生成子模块名';
|
||||
COMMENT ON COLUMN js_gen_table.function_name IS '生成功能名';
|
||||
COMMENT ON COLUMN js_gen_table.function_name_simple IS '生成功能名(简写)';
|
||||
COMMENT ON COLUMN js_gen_table.function_author IS '生成功能作者';
|
||||
COMMENT ON COLUMN js_gen_table.gen_base_dir IS '生成基础路径';
|
||||
COMMENT ON COLUMN js_gen_table.options IS '其它生成选项';
|
||||
COMMENT ON COLUMN js_gen_table.create_by IS '创建者';
|
||||
COMMENT ON COLUMN js_gen_table.create_date IS '创建时间';
|
||||
COMMENT ON COLUMN js_gen_table.update_by IS '更新者';
|
||||
COMMENT ON COLUMN js_gen_table.update_date IS '更新时间';
|
||||
COMMENT ON COLUMN js_gen_table.remarks IS '备注信息';
|
||||
COMMENT ON TABLE js_gen_table_column IS '代码生成表列';
|
||||
COMMENT ON COLUMN js_gen_table_column.id IS '编号';
|
||||
COMMENT ON COLUMN js_gen_table_column.table_name IS '表名';
|
||||
COMMENT ON COLUMN js_gen_table_column.column_name IS '列名';
|
||||
COMMENT ON COLUMN js_gen_table_column.column_sort IS '列排序(升序)';
|
||||
COMMENT ON COLUMN js_gen_table_column.column_type IS '类型';
|
||||
COMMENT ON COLUMN js_gen_table_column.column_label IS '列标签名';
|
||||
COMMENT ON COLUMN js_gen_table_column.comments IS '列备注说明';
|
||||
COMMENT ON COLUMN js_gen_table_column.attr_name IS '类的属性名';
|
||||
COMMENT ON COLUMN js_gen_table_column.attr_type IS '类的属性类型';
|
||||
COMMENT ON COLUMN js_gen_table_column.is_pk IS '是否主键';
|
||||
COMMENT ON COLUMN js_gen_table_column.is_null IS '是否可为空';
|
||||
COMMENT ON COLUMN js_gen_table_column.is_insert IS '是否插入字段';
|
||||
COMMENT ON COLUMN js_gen_table_column.is_update IS '是否更新字段';
|
||||
COMMENT ON COLUMN js_gen_table_column.is_list IS '是否列表字段';
|
||||
COMMENT ON COLUMN js_gen_table_column.is_query IS '是否查询字段';
|
||||
COMMENT ON COLUMN js_gen_table_column.query_type IS '查询方式';
|
||||
COMMENT ON COLUMN js_gen_table_column.is_edit IS '是否编辑字段';
|
||||
COMMENT ON COLUMN js_gen_table_column.show_type IS '表单类型';
|
||||
COMMENT ON COLUMN js_gen_table_column.options IS '其它生成选项';
|
||||
COMMENT ON TABLE js_sys_area IS '行政区划';
|
||||
COMMENT ON COLUMN js_sys_area.area_code IS '区域编码';
|
||||
COMMENT ON COLUMN js_sys_area.parent_code IS '父级编号';
|
||||
|
||||
@@ -1,116 +0,0 @@
|
||||
|
||||
/* Drop Tables */
|
||||
|
||||
DROP TABLE IF EXISTS js_gen_table_column;
|
||||
DROP TABLE IF EXISTS js_gen_table;
|
||||
|
||||
|
||||
|
||||
|
||||
/* Create Tables */
|
||||
|
||||
-- 代码生成表
|
||||
CREATE TABLE js_gen_table
|
||||
(
|
||||
table_name varchar(64) NOT NULL,
|
||||
class_name varchar(100) NOT NULL,
|
||||
comments varchar(500) NOT NULL,
|
||||
parent_table_name varchar(64),
|
||||
parent_table_fk_name varchar(64),
|
||||
tpl_category varchar(200),
|
||||
package_name varchar(500),
|
||||
module_name varchar(30),
|
||||
sub_module_name varchar(30),
|
||||
function_name varchar(200),
|
||||
function_name_simple varchar(50),
|
||||
function_author varchar(50),
|
||||
gen_base_dir varchar(1000),
|
||||
options varchar(1000),
|
||||
create_by varchar(64) NOT NULL,
|
||||
create_date timestamp NOT NULL,
|
||||
update_by varchar(64) NOT NULL,
|
||||
update_date timestamp NOT NULL,
|
||||
remarks varchar(500),
|
||||
PRIMARY KEY (table_name)
|
||||
) WITHOUT OIDS;
|
||||
|
||||
|
||||
-- 代码生成表列
|
||||
CREATE TABLE js_gen_table_column
|
||||
(
|
||||
id varchar(64) NOT NULL,
|
||||
table_name varchar(64) NOT NULL,
|
||||
column_name varchar(64) NOT NULL,
|
||||
column_sort decimal(10),
|
||||
column_type varchar(100) NOT NULL,
|
||||
column_label varchar(50),
|
||||
comments varchar(500) NOT NULL,
|
||||
attr_name varchar(200) NOT NULL,
|
||||
attr_type varchar(200) NOT NULL,
|
||||
is_pk char(1),
|
||||
is_null char(1),
|
||||
is_insert char(1),
|
||||
is_update char(1),
|
||||
is_list char(1),
|
||||
is_query char(1),
|
||||
query_type varchar(200),
|
||||
is_edit char(1),
|
||||
show_type varchar(200),
|
||||
options varchar(1000),
|
||||
PRIMARY KEY (id)
|
||||
) WITHOUT OIDS;
|
||||
|
||||
|
||||
|
||||
/* Create Indexes */
|
||||
|
||||
CREATE INDEX idx_gen_table_ptn ON js_gen_table (parent_table_name);
|
||||
CREATE INDEX idx_gen_table_column_tn ON js_gen_table_column (table_name);
|
||||
|
||||
|
||||
|
||||
/* Comments */
|
||||
|
||||
COMMENT ON TABLE js_gen_table IS '代码生成表';
|
||||
COMMENT ON COLUMN js_gen_table.table_name IS '表名';
|
||||
COMMENT ON COLUMN js_gen_table.class_name IS '实体类名称';
|
||||
COMMENT ON COLUMN js_gen_table.comments IS '表说明';
|
||||
COMMENT ON COLUMN js_gen_table.parent_table_name IS '关联父表的表名';
|
||||
COMMENT ON COLUMN js_gen_table.parent_table_fk_name IS '本表关联父表的外键名';
|
||||
COMMENT ON COLUMN js_gen_table.tpl_category IS '使用的模板';
|
||||
COMMENT ON COLUMN js_gen_table.package_name IS '生成包路径';
|
||||
COMMENT ON COLUMN js_gen_table.module_name IS '生成模块名';
|
||||
COMMENT ON COLUMN js_gen_table.sub_module_name IS '生成子模块名';
|
||||
COMMENT ON COLUMN js_gen_table.function_name IS '生成功能名';
|
||||
COMMENT ON COLUMN js_gen_table.function_name_simple IS '生成功能名(简写)';
|
||||
COMMENT ON COLUMN js_gen_table.function_author IS '生成功能作者';
|
||||
COMMENT ON COLUMN js_gen_table.gen_base_dir IS '生成基础路径';
|
||||
COMMENT ON COLUMN js_gen_table.options IS '其它生成选项';
|
||||
COMMENT ON COLUMN js_gen_table.create_by IS '创建者';
|
||||
COMMENT ON COLUMN js_gen_table.create_date IS '创建时间';
|
||||
COMMENT ON COLUMN js_gen_table.update_by IS '更新者';
|
||||
COMMENT ON COLUMN js_gen_table.update_date IS '更新时间';
|
||||
COMMENT ON COLUMN js_gen_table.remarks IS '备注信息';
|
||||
COMMENT ON TABLE js_gen_table_column IS '代码生成表列';
|
||||
COMMENT ON COLUMN js_gen_table_column.id IS '编号';
|
||||
COMMENT ON COLUMN js_gen_table_column.table_name IS '表名';
|
||||
COMMENT ON COLUMN js_gen_table_column.column_name IS '列名';
|
||||
COMMENT ON COLUMN js_gen_table_column.column_sort IS '列排序(升序)';
|
||||
COMMENT ON COLUMN js_gen_table_column.column_type IS '类型';
|
||||
COMMENT ON COLUMN js_gen_table_column.column_label IS '列标签名';
|
||||
COMMENT ON COLUMN js_gen_table_column.comments IS '列备注说明';
|
||||
COMMENT ON COLUMN js_gen_table_column.attr_name IS '类的属性名';
|
||||
COMMENT ON COLUMN js_gen_table_column.attr_type IS '类的属性类型';
|
||||
COMMENT ON COLUMN js_gen_table_column.is_pk IS '是否主键';
|
||||
COMMENT ON COLUMN js_gen_table_column.is_null IS '是否可为空';
|
||||
COMMENT ON COLUMN js_gen_table_column.is_insert IS '是否插入字段';
|
||||
COMMENT ON COLUMN js_gen_table_column.is_update IS '是否更新字段';
|
||||
COMMENT ON COLUMN js_gen_table_column.is_list IS '是否列表字段';
|
||||
COMMENT ON COLUMN js_gen_table_column.is_query IS '是否查询字段';
|
||||
COMMENT ON COLUMN js_gen_table_column.query_type IS '查询方式';
|
||||
COMMENT ON COLUMN js_gen_table_column.is_edit IS '是否编辑字段';
|
||||
COMMENT ON COLUMN js_gen_table_column.show_type IS '表单类型';
|
||||
COMMENT ON COLUMN js_gen_table_column.options IS '其它生成选项';
|
||||
|
||||
|
||||
|
||||
@@ -35,6 +35,8 @@ public class InitCoreData extends com.jeesite.modules.sys.db.InitCoreData {
|
||||
initCompany();
|
||||
initPost();
|
||||
initEmpUser();
|
||||
initGenTestData();
|
||||
initGenTreeData();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
/**
|
||||
* 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 org.springframework.test.context.ActiveProfiles;
|
||||
|
||||
import com.jeesite.modules.config.Application;
|
||||
|
||||
/**
|
||||
* 初始化代码生成表测试数据
|
||||
* @author ThinkGem
|
||||
* @version 2017-10-22
|
||||
*/
|
||||
@ActiveProfiles("test")
|
||||
@SpringBootTest(classes=Application.class)
|
||||
@Rollback(false)
|
||||
public class InitGenData extends com.jeesite.modules.gen.db.InitGenData {
|
||||
|
||||
@Test
|
||||
public void initGenData() throws Exception{
|
||||
createGenTable();
|
||||
initGenTestData();
|
||||
initGenTreeData();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user