-- JCL_ORG_SCHEME
CREATE TABLE JCL_ORG_SCHEME (
	id int IDENTITY(1,1) NOT NULL,
	scheme_no varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
	scheme_name varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
	scheme_description text COLLATE Chinese_PRC_CI_AS NULL,
	forbidden_tag int NULL,
	CONSTRAINT JCL_ORG_SCHEME_PK PRIMARY KEY (id)
);
-- JCL_ORG_LEVEL
CREATE TABLE JCL_ORG_LEVEL (
	id int IDENTITY(1,1) NOT NULL,
	level_no varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
	level_name varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
	description text COLLATE Chinese_PRC_CI_AS NULL,
	level_scheme int null,
	forbidden_tag int NULL,
	CONSTRAINT JCL_ORG_LEVEL_PK PRIMARY KEY (id)
);
-- JCL_ORG_GRADE
CREATE TABLE JCL_ORG_GRADE (
	id int IDENTITY(1,1) NOT NULL,
	grade_no varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
	grade_name varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
	description text COLLATE Chinese_PRC_CI_AS NULL,
	level_scheme int null,
	level_id int null,
	forbidden_tag int NULL,
	CONSTRAINT JCL_ORG_GRADE_PK PRIMARY KEY (id)
);

-- JCL_ORG_SEQUENCE
CREATE TABLE JCL_ORG_SEQUENCE (
	id int IDENTITY(1,1) NOT NULL,
	sequence_no varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
	sequence_name varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
	description text COLLATE Chinese_PRC_CI_AS NULL,
	level_scheme int null,
	forbidden_tag int NULL,
	CONSTRAINT JCL_ORG_SEQUENCE_PK PRIMARY KEY (id)
);

-- JCL_ORG_POST
CREATE TABLE JCL_ORG_POST (
	id int IDENTITY(1,1) NOT NULL,
	post_no int null,
	post_name varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
	description text COLLATE Chinese_PRC_CI_AS NULL,
	CONSTRAINT JCL_ORG_POST_PK PRIMARY KEY (id)
);

-- JCL_ORG_POST_INFO
CREATE TABLE JCL_ORG_POST_INFO (
	id int IDENTITY(1,1) NOT NULL,
	post_info_no int null,
	post_info_name varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
	post_info_authority text null,
	post_info_duty text null,
	post_info_qualification text null,
	post_type int null,
	description text COLLATE Chinese_PRC_CI_AS NULL,
	CONSTRAINT JCL_ORG_POST_INFO_PK PRIMARY KEY (id)
);

-- JCL_ORG_COMP
CREATE TABLE JCL_ORG_COMP (
	id int IDENTITY(1,1) NOT NULL,
	comp_no varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
	comp_name varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
	comp_name_short varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
	parent_company int null,
	org_code varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
	industry int null,
	comp_principal int null,
	description text COLLATE Chinese_PRC_CI_AS NULL,
	forbidden_tag int NULL,
	CONSTRAINT JCL_ORG_COMP_PK PRIMARY KEY (id)
);

-- JCL_FIELD_EXTENDGROUP
CREATE TABLE JCL_FIELD_EXTENDGROUP (
	id int IDENTITY(1,1) NOT NULL,
	extend_type int null,
	group_name varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
	CONSTRAINT JCL_FIELD_EXTENDGROUP_PK PRIMARY KEY (id)
);

-- JCL_FIELD_EXTENDINFO
CREATE TABLE JCL_FIELD_EXTENDINFO (
	id int IDENTITY(1,1) NOT NULL,
	extend_type int null,
	table_name varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
	field_name varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
	field_name_desc varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
	field_type varchar(1000) COLLATE Chinese_PRC_CI_AS NULL,
	control_type int null,
	extend_group int null,
	isenable int null,
	isrequired int null,
	list_show int null,
	search_show int null,
	edit_show int null,
	add_show int null,
	button_show int null,
	show_order int null,
	CONSTRAINT JCL_FIELD_EXTENDINFO_PK PRIMARY KEY (id)
);

-- JCL_ORG_COMPEXT
CREATE TABLE JCL_ORG_COMPEXT (
	id int IDENTITY(1,1) NOT NULL,
	CONSTRAINT JCL_ORG_COMPEXT_PK PRIMARY KEY (id)
);

-- JCL_ORG_COMPEXT_DT1
CREATE TABLE JCL_ORG_COMPEXT_DT1 (
	id int IDENTITY(1,1) NOT NULL,
	mainid int NULL,
	CONSTRAINT JCL_ORG_COMPEXT_DT1_PK PRIMARY KEY (id)
);

-- JCL_ORG_DEPT
CREATE TABLE JCL_ORG_DEPT (
	id int IDENTITY(1,1) NOT NULL,
	dept_no varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
	dept_name varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
	dept_name_short varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
	parent_comp int null,
	parent_dept int null,
	dept_principal int null,
	show_order int null,
	description text COLLATE Chinese_PRC_CI_AS NULL,
	forbidden_tag int NULL,
	CONSTRAINT JCL_ORG_DEPT_PK PRIMARY KEY (id)
);

-- JCL_FIELD_EXTENDGROUP_DEPT
CREATE TABLE JCL_FIELD_EXTENDGROUP_DEPT (
	id int IDENTITY(1,1) NOT NULL,
	extend_type int null,
	group_name varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
	CONSTRAINT JCL_FIELD_EXTENDGROUP_DEPT_PK PRIMARY KEY (id)
);

-- JCL_FIELD_EXTENDINFO_DEPT
CREATE TABLE JCL_FIELD_EXTENDINFO_DEPT (
	id int IDENTITY(1,1) NOT NULL,
	extend_type int null,
	table_name varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
	field_name varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
	field_name_desc varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
	field_type varchar(1000) COLLATE Chinese_PRC_CI_AS NULL,
	control_type int null,
	extend_group int null,
	isenable int null,
	isrequired int null,
	list_show int null,
	search_show int null,
	edit_show int null,
	add_show int null,
	button_show int null,
	show_order int null,
	CONSTRAINT JCL_FIELD_EXTENDINFO_DEPT_PK PRIMARY KEY (id)
);

-- JCL_ORG_DEPTPEXT
CREATE TABLE JCL_ORG_DEPTPEXT (
	id int IDENTITY(1,1) NOT NULL,
	CONSTRAINT JCL_ORG_DEPTPEXT_PK PRIMARY KEY (id)
);

-- JCL_ORG_DEPTEXT_DT1
CREATE TABLE JCL_ORG_DEPTEXT_DT1 (
	id int IDENTITY(1,1) NOT NULL,
	mainid int NULL,
	CONSTRAINT JCL_ORG_DEPTEXT_DT1_PK PRIMARY KEY (id)
);

-- JCL_ORG_JOB
CREATE TABLE JCL_ORG_JOB (
	id int IDENTITY(1,1) NOT NULL,
	job_no varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
	job_name varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
	parent_comp int null,
	parent_dept int null,
	job_sequence int null,
	level_scheme int null,
	parent_job int null,
	is_key_job int null,
	workplace varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
	work_description text null,
	work_duty text null,
	work_authority text null,
	forbidden_tag int NULL,
	CONSTRAINT JCL_ORG_JOB_PK PRIMARY KEY (id)
);

-- JCL_ORG_JOBDT
CREATE TABLE JCL_ORG_JOBDT (
	id int IDENTITY(1,1) NOT NULL,
	mainid int NULL,
	job_rank int null,
	job_level int null,
	CONSTRAINT CL_ORG_DEPTPEXT_PK PRIMARY KEY (id)
);

-- JCL_FIELD_EXTENDGROUP_JOB
CREATE TABLE JCL_FIELD_EXTENDGROUP_JOB (
	id int IDENTITY(1,1) NOT NULL,
	extend_type int null,
	group_name varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
	CONSTRAINT JCL_FIELD_EXTENDGROUP_JOB_PK PRIMARY KEY (id)
);

-- JCL_FIELD_EXTENDINFO_JOB
CREATE TABLE JCL_FIELD_EXTENDINFO_JOB (
	id int IDENTITY(1,1) NOT NULL,
	extend_type int null,
	table_name varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
	field_name varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
	field_name_desc varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
	field_type varchar(1000) COLLATE Chinese_PRC_CI_AS NULL,
	control_type int null,
	extend_group int null,
	isenable int null,
	isrequired int null,
	list_show int null,
	search_show int null,
	edit_show int null,
	add_show int null,
	button_show int null,
	show_order int null,
	CONSTRAINT JCL_FIELD_EXTENDINFO_JOB_PK PRIMARY KEY (id)
);

-- JCL_ORG_JOBPEXT
CREATE TABLE JCL_ORG_JOBPEXT (
	id int IDENTITY(1,1) NOT NULL,
	CONSTRAINT JCL_ORG_JOBPEXT_PK PRIMARY KEY (id)
);

-- JCL_ORG_JOBEXT_DT1
CREATE TABLE JCL_ORG_JOBEXT_DT1 (
	id int IDENTITY(1,1) NOT NULL,
	mainid int NULL,
	CONSTRAINT JCL_ORG_JOBEXT_DT1_PK PRIMARY KEY (id)
);


-- JCL_ORG_STAFFPLAN
CREATE TABLE JCL_ORG_STAFFPLAN (
	id int IDENTITY(1,1) NOT NULL,
	staffplan_no varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
	staffplan_name varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
	staffplan_year varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
	time_start date NULL,
	time_end date NULL,
	apply_company int NULL,
	description text NULL,
	status int NULL,
	CONSTRAINT JCL_ORG_STAFFPLAN_PK PRIMARY KEY (id)
);

-- JCL_ORG_STAFF
CREATE TABLE JCL_ORG_STAFF (
	id int IDENTITY(1,1) NOT NULL,
	scheme_id int null,
	comp int null,
	dept int null,
	job int null,
	staff_num int null,
	control_policy int null,
	staff_permanent_num int null,
	freeze_num int null,
	lack_status int null,
	staff_description varchar(100) COLLATE Chinese_PRC_CI_AS NULL,
	instruction text null,
	CONSTRAINT JCL_ORG_STAFF_PK PRIMARY KEY (id)
);

-- JCL_ORG_STAFFS
CREATE TABLE JCL_ORG_STAFFS (
	id int IDENTITY(1,1) NOT NULL,
	staff_id int null,
	business_type int null,
	business_change_num int null,
	business_source int null,
	requestid int null,
	CONSTRAINT JCL_ORG_STAFFS_PK PRIMARY KEY (id)
);









