﻿/*=========================================================================*/
/*   此 SQL DDL 脚本由 SpDevelop 生成。                                    */
/*   所用驱动程序：MySql 5.0  驱动程序。                                   */
/*   创建时间：2022/6/7  12:07:22。                                        */
/*=========================================================================*/



/*==========================================================================*/
/*  Tables                                                                  */
/*==========================================================================*/


/*创建新表 MyMessage [消息表]: 
* Id []:
* FromUserId [消息来源]:
* ToUserId [接收者]:结合t_org 表应用 001
001001 001002
* Mleve [消息级别]:0：DEBUG、INFO、WARN、ERROR、FATAL、OFF
* MessageRemark [消息内容]:
* Remark [备注]:
* LineNum [生产线]:
* CreateDate [产生时间]:
* NeedRec [需要确认]:
* IsRec [是否确认接收]:
* RecDate [接收时间]:
*/
CREATE TABLE MyMessage(
	Id INTEGER auto_increment  NOT NULL,
	FromUserId varchar(50) binary NULL,
	ToUserId varchar(50) binary NULL,
	Mleve INTEGER NULL,
	MessageRemark varchar(250) binary NULL,
	Remark varchar(50) binary NULL,
	LineNum varchar(50) binary NULL,
	CreateDate datetime NULL,
	NeedRec INTEGER NULL,
	IsRec INTEGER NULL,
	RecDate varchar(30) binary NULL,
	PRIMARY KEY (Id)
)
;

/*创建新表 EASLicence [许可证]: 
* Id []:
* ProNo [程序编号]:
* PublicKey [公钥]:
* PrivateKey [私钥]:
* EncryString [加密数据]:
*/
CREATE TABLE EASLicence(
	Id INTEGER auto_increment  NOT NULL,
	ProNo varchar(50) binary NULL,
	PublicKey varchar(250) binary NULL,
	PrivateKey varchar(250) binary NULL,
	EncryString text NULL,
	PRIMARY KEY (Id)
)
;

/*创建新表 EASLicenceSub [许可证]: 
* Id []:
* ProNo [程序编号]:
* PrivateKey [私钥]:
* EncryString [加密数据]:
* EndDate [结束时间]:
* Days [提前提示时间]:
* NetCartNo [网卡号]:
* IsSend [是否发送]:
*/
CREATE TABLE EASLicenceSub(
	Id INTEGER auto_increment  NOT NULL,
	ProNo varchar(50) binary NULL,
	PrivateKey varchar(250) binary NULL,
	EncryString text NULL,
	EndDate varchar(20) binary NULL,
	Days INTEGER NULL,
	NetCartNo varchar(50) binary NULL,
	IsSend INTEGER NULL,
	PRIMARY KEY (Id)
)
;

/*创建新表 TSType1 [边防态势一级分类]:不需要程序编辑、只初始化 
* id []:
* UID []:
* TypeName [分类名称]:
* Remark [备注]:
*/
CREATE TABLE TSType1(
	id INTEGER auto_increment  NOT NULL,
	UID varchar(50) binary NULL,
	TypeName varchar(50) binary NULL,
	Remark varchar(50) binary NULL,
	PRIMARY KEY (id)
)
;

/*创建新表 TSType2 [边防态势二级分类]:不需要程序编辑、只初始化 
* id []:
* UID []:
* TypeName [分类名称]:
* Remark [备注]:
* NEType [经纬度类型]:0：点
1：区域
* ShowType [显示类型]:0：图标
1：颜色
2：其他
* ShowColor [显示颜色]:
*/
CREATE TABLE TSType2(
	id INTEGER auto_increment  NOT NULL,
	UID varchar(50) binary NULL,
	TypeName varchar(50) binary NULL,
	Remark varchar(50) binary NULL,
	NEType INTEGER NULL,
	ShowType INTEGER NULL,
	ShowColor varchar(50) binary NULL,
	PRIMARY KEY (id)
)
;

/*创建新表 TSRecord [态势表]: 
* id []:
* UID []:
* TSType1UID [分类1]:
* TSType2UID [分类2]:
* TSName [态势名称]:
*/
CREATE TABLE TSRecord(
	id INTEGER auto_increment  NOT NULL,
	UID varchar(50) binary NULL,
	TSType1UID varchar(50) binary NULL,
	TSType2UID varchar(50) binary NULL,
	TSName varchar(50) binary NULL,
	PRIMARY KEY (id)
)
;

/*创建新表 message_exchange [文电交互]: 
* id []:
* uuid [UUID]:
* code [编号]:
* title [标题]:
* message_type [电文类型]:数据字典定义
* send_org [发送单位]:
* send_userid [发送人位]:
* send_date [发送时间]:
* rec_org [接收单位]:
* rec_userid [接收人]:
* isrec [是否接收]:
* rec_date [接收时间]:
* rec_reply [接收回复]:
* h5message [内容]:
* isencrypt [是否加密]:
* password [密码]:
*/
CREATE TABLE message_exchange(
	id INTEGER auto_increment  NOT NULL,
	uuid varchar(50) binary NULL,
	code varchar(50) binary NULL,
	title varchar(50) binary NULL,
	message_type varchar(50) binary NULL,
	send_org varchar(50) binary NULL,
	send_userid varchar(50) binary NULL,
	send_date datetime NULL,
	rec_org varchar(50) binary NULL,
	rec_userid varchar(50) binary NULL,
	isrec INTEGER NULL,
	rec_date datetime NULL,
	rec_reply text NULL,
	h5message text NULL,
	isencrypt INTEGER NULL,
	password varchar(50) binary NULL,
	PRIMARY KEY (id)
)
;

/*创建新表 message_attachment [电文附件]: 
* id []:
* uuid [UUID]:
* puuid [父编码]:
* file_name [文件名称]:
* file_url [文件路径]:
* isencrypt [是否加密]:
* password [密码]:
*/
CREATE TABLE message_attachment(
	id INTEGER auto_increment  NOT NULL,
	uuid varchar(50) binary NULL,
	puuid varchar(50) binary NULL,
	file_name varchar(50) binary NULL,
	file_url varchar(50) binary NULL,
	isencrypt INTEGER NULL,
	password varchar(50) binary NULL,
	PRIMARY KEY (id)
)
;

/*创建新表 system [制度规定]: 
* id []:
* uuid [UUID]:
* puuid [分类编码]:数据字典定义
* code [编号]:
* title [标题]:
* h5message [内容]:
* remark [备注]:
*/
CREATE TABLE system(
	id INTEGER auto_increment  NOT NULL,
	uuid varchar(50) binary NULL,
	puuid varchar(50) binary NULL,
	code varchar(50) binary NULL,
	title varchar(50) binary NULL,
	h5message text NULL,
	remark varchar(50) binary NULL,
	PRIMARY KEY (id)
)
;

/*创建新表 system_attachment [规定制度附件]: 
* id []:
* uuid [UUID]:
* file_name [文件名称]:
* file_url [文件路径]:
*/
CREATE TABLE system_attachment(
	id INTEGER auto_increment  NOT NULL,
	uuid varchar(50) binary NULL,
	file_name varchar(50) binary NULL,
	file_url varchar(50) binary NULL,
	PRIMARY KEY (id)
)
;

/*创建新表 system_type [制度规定分类]: 
* id []:
* uuid [UUID]:
* type_name [分类名称]:
* remark [备注]:
*/
CREATE TABLE system_type(
	id INTEGER auto_increment  NOT NULL,
	uuid varchar(50) binary NULL,
	type_name varchar(50) binary NULL,
	remark varchar(150) binary NULL,
	PRIMARY KEY (id)
)
;

/*创建新表 system_type190 [制度规定分类]: 
* id []:
* uuid [UUID]:
* type_name [分类名称]:
* remark [备注]:
*/
CREATE TABLE system_type190(
	id INTEGER auto_increment  NOT NULL,
	uuid varchar(0) binary NULL,
	type_name varchar(0) binary NULL,
	remark varchar(0) binary NULL,
	PRIMARY KEY (id)
)
;

/*创建新表 read_log [制度规定阅读记录]: 
* id []:
* uuid [UUID]:
* puuid [父编号]:
* userid [用户id]:
*/
CREATE TABLE read_log(
	id INTEGER auto_increment  NOT NULL,
	uuid varchar(50) binary NULL,
	puuid varchar(50) binary NULL,
	userid varchar(50) binary NULL,
	PRIMARY KEY (id)
)
;

/*==========================================================================*/
/*  Foreign Keys                                                            */
/*==========================================================================*/


/*==========================================================================*/
/*  Indexes                                                                 */
/*==========================================================================*/


/*==========================================================================*/
/*  Sequences                                                               */
/*==========================================================================*/


/*==========================================================================*/
/*  Views                                                                   */
/*==========================================================================*/


/*==========================================================================*/
/*  Triggers                                                                */
/*==========================================================================*/


