database

package
v0.1.3-alpha Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DatabaseInitialize

func DatabaseInitialize()

初始化数据库表

Types

type CommonID

type CommonID struct {
	ID int `gorm:"primaryKey;column:id;type:INT UNSIGNED NOT NULL AUTO_INCREMENT;"`
}

type HistProcDef

type HistProcDef struct {
	CommonID
	ProcID    int       `gorm:"column:proc_id;type:INT UNSIGNED NOT NULL;comment:流程ID"`
	Name      string    `gorm:"column:name;type:VARCHAR(250) NOT NULL;comment:流程名字;"`
	Version   int       `gorm:"column:version;type:INT UNSIGNED NOT NULL DEFAULT 1;default:1;comment:版本号"`
	Resource  string    `gorm:"column:resource;type:TEXT NOT NULL;comment:流程定义模板"`
	UserID    string    `gorm:"column:user_id;type:VARCHAR(250) NOT NULL;comment:创建者ID"`
	Source    string    `` /* 155-byte string literal not displayed */
	CreatTime time.Time `gorm:"column:create_time;type:DATETIME DEFAULT NOW();default:NOW();comment:创建时间"`
}

流程定义历史表

type HistProcExecution

type HistProcExecution struct {
	ID          int       `gorm:"primaryKey;column:id;type:INT UNSIGNED NOT NULL AUTO_INCREMENT;"`
	ProcID      int       `gorm:"index:ix_proc_id;column:proc_id;type:INT UNSIGNED NOT NULL;comment:流程ID"`
	ProcVersion int       `gorm:"column:proc_version;type:INT UNSIGNED NOT NULL;comment:流程版本号"`
	NodeID      string    `gorm:"column:node_id;type:VARCHAR(250) NOT NULL;comment:节点ID"`
	NodeName    string    `gorm:"column:node_name;type:VARCHAR(250) NOT NULL;comment:节点名称"`
	PrevNodeID  string    `gorm:"column:prev_node_id;type:VARCHAR(250) DEFAULT NULL;default NULL;comment:上级节点ID"`
	NodeType    int       `` /* 126-byte string literal not displayed */
	IsCosigned  int       `gorm:"column:is_cosigned;type:TINYINT NOT NULL;comment:是否会签"`
	CreateTime  time.Time `gorm:"column:create_time;type:DATETIME DEFAULT NOW();default NOW();comment:创建时间"`
}

流程节点执行关系定义历史表

type HistProcInst

type HistProcInst struct {
	CommonID
	ProcInstID    int       `gorm:"column:proc_inst_id;type:INT UNSIGNED NOT NULL;comment:流程实例ID"`
	ProcID        int       `gorm:"column:proc_id;type:INT NOT NULL;index:ix_proc_id;comment:流程ID"`
	ProcVersion   int       `gorm:"column:proc_version;type:INT UNSIGNED NOT NULL;comment:流程版本号"`
	BusinessID    string    `gorm:"column:business_id;type:VARCHAR(250) DEFAULT NULL;default:NULL;comment:业务ID"`
	CurrentNodeID string    `gorm:"column:current_node_id;type:VARCHAR(250) NOT NULL;comment:当前进行节点ID"`
	CreateTime    time.Time `gorm:"column:create_time;type:DATETIME DEFAULT NOW();default:NOW();comment:创建时间"`
	Status        int       `gorm:"column:status;type:TINYINT DEFAULT 0 ;default 0;comment:0:未完成 1:已完成 2:撤销"`
}

流程实例历史表

type HistProcInstVariable

type HistProcInstVariable struct {
	ID         int    `gorm:"primaryKey;column:id;type:INT UNSIGNED NOT NULL AUTO_INCREMENT;"`
	ProcInstID int    `gorm:"index:ix_proc_inst_id;column:proc_inst_id;type:INT UNSIGNED NOT NULL;comment:流程实例ID"`
	Key        string `gorm:"column:key;type:VARCHAR(250) NOT NULL;comment:变量key"`
	Value      string `gorm:"column:value;type:VARCHAR(250) NOT NULL;comment:变量value"`
}

流程实例变量历史表

type HistTask

type HistTask struct {
	CommonID
	TaskID       int       `gorm:"column:task_id;type:INT UNSIGNED NOT NULL;comment:任务ID"`
	ProcID       int       `gorm:"index:ix_proc_id;column:proc_id;type:INT UNSIGNED NOT NULL;comment:流程ID,冗余字段,偷懒用"`
	ProcInstID   int       `gorm:"index:ix_proc_inst_id;column:proc_inst_id;type:INT UNSIGNED NOT NULL;comment:流程实例ID"`
	NodeID       string    `gorm:"column:node_id;type:VARCHAR(250) NOT NULL;comment:节点ID"`
	PrevNodeID   string    `` /* 213-byte string literal not displayed */
	IsCosigned   int       `gorm:"column:is_cosigned;type:TINYINT DEFAULT 0;default:0;comment:0:任意一人通过即可 1:会签"`
	BatchCode    string    `` /* 180-byte string literal not displayed */
	UserID       string    `gorm:"column:user_id;type:VARCHAR(250) NOT NULL;comment:分配用户ID"`
	Status       int       `gorm:"column:status;type:TINYINT DEFAULT 0;default:0;comment:任务状态:0:初始 1:通过 2:驳回"`
	IsFinished   int       `` /* 205-byte string literal not displayed */
	CreateTime   time.Time `gorm:"column:create_time;type:DATETIME DEFAULT NOW();default:NOW();comment:系统创建任务时间"`
	FinishedTime time.Time `gorm:"column:finished_time;type:DATETIME DEFAULT NULL;default:NULL;comment:处理任务时间"`
}

任务历史表

type HistTaskComment

type HistTaskComment struct {
	ID         int    `gorm:"primaryKey;column:id;type:INT UNSIGNED NOT NULL AUTO_INCREMENT;"`
	ProcInstID int    `gorm:"index:ix_proc_inst_id;column:proc_inst_id;type:INT UNSIGNED NOT NULL;comment:流程实例ID"`
	TaskID     int    `gorm:"index:ix_task_id;column:task_id;type:INT UNSIGNED NOT NULL;comment:任务ID"`
	Comment    string `gorm:"column:comment;type:TEXT;comment:任务备注"`
}

任务备注历史表

type ProcDef

type ProcDef struct {
	ID        int       `gorm:"primaryKey;column:id;type:INT UNSIGNED NOT NULL AUTO_INCREMENT;comment:流程ID"`
	Name      string    `gorm:"column:name;type:VARCHAR(250) NOT NULL;comment:流程名字;uniqueIndex:uix_name_source"`
	Version   int       `gorm:"column:version;type:INT UNSIGNED NOT NULL DEFAULT 1;default:1;comment:版本号"`
	Resource  string    `gorm:"column:resource;type:TEXT NOT NULL;comment:流程定义模板"`
	UserID    string    `gorm:"column:user_id;type:VARCHAR(250) NOT NULL;comment:创建者ID"`
	Source    string    `` /* 183-byte string literal not displayed */
	CreatTime time.Time `gorm:"column:create_time;type:DATETIME DEFAULT NOW();default:NOW();comment:创建时间"`
}

流程定义表

type ProcExecution

type ProcExecution struct {
	ID          int       `gorm:"primaryKey;column:id;type:INT UNSIGNED NOT NULL AUTO_INCREMENT;"`
	ProcID      int       `gorm:"index:ix_proc_id;column:proc_id;type:INT UNSIGNED NOT NULL;comment:流程ID"`
	ProcVersion int       `gorm:"column:proc_version;type:INT UNSIGNED NOT NULL;comment:流程版本号"`
	NodeID      string    `gorm:"column:node_id;type:VARCHAR(250) NOT NULL;comment:节点ID"`
	NodeName    string    `gorm:"column:node_name;type:VARCHAR(250) NOT NULL;comment:节点名称"`
	PrevNodeID  string    `gorm:"column:prev_node_id;type:VARCHAR(250) DEFAULT NULL;default NULL;comment:上级节点ID"`
	NodeType    int       `` /* 126-byte string literal not displayed */
	IsCosigned  int       `gorm:"column:is_cosigned;type:TINYINT NOT NULL;comment:是否会签"`
	CreateTime  time.Time `gorm:"column:create_time;type:DATETIME DEFAULT NOW();default NOW();comment:创建时间"`
}

流程节点执行关系定义表

type ProcInst

type ProcInst struct {
	ID            int       `gorm:"primaryKey;column:id;type:INT UNSIGNED NOT NULL AUTO_INCREMENT;comment:流程实例ID"`
	ProcID        int       `gorm:"column:proc_id;type:INT NOT NULL;index:ix_proc_id;comment:流程ID"`
	ProcVersion   int       `gorm:"column:proc_version;type:INT UNSIGNED NOT NULL;comment:流程版本号"`
	BusinessID    string    `gorm:"column:business_id;type:VARCHAR(250) DEFAULT NULL;default:NULL;comment:业务ID"`
	CurrentNodeID string    `gorm:"column:current_node_id;type:VARCHAR(250) NOT NULL;comment:当前进行节点ID"`
	CreateTime    time.Time `gorm:"column:create_time;type:DATETIME DEFAULT NOW();default:NOW();comment:创建时间"`
	Status        int       `gorm:"column:status;type:TINYINT DEFAULT 0 ;default 0;comment:0:未完成 1:已完成 2:撤销"`
}

流程实例表

type ProcInstVariable

type ProcInstVariable struct {
	ID         int    `gorm:"primaryKey;column:id;type:INT UNSIGNED NOT NULL AUTO_INCREMENT;"`
	ProcInstID int    `gorm:"index:ix_proc_inst_id;column:proc_inst_id;type:INT UNSIGNED NOT NULL;comment:流程实例ID"`
	Key        string `gorm:"column:key;type:VARCHAR(250) NOT NULL;comment:变量key"`
	Value      string `gorm:"column:value;type:VARCHAR(250) NOT NULL;comment:变量value"`
}

流程实例变量表

type Task

type Task struct {
	ID           int       `gorm:"primaryKey;column:id;type:INT UNSIGNED NOT NULL AUTO_INCREMENT;comment:任务ID"`
	ProcID       int       `gorm:"index:ix_proc_id;column:proc_id;type:INT UNSIGNED NOT NULL;comment:流程ID,冗余字段,偷懒用"`
	ProcInstID   int       `gorm:"index:ix_proc_inst_id;column:proc_inst_id;type:INT UNSIGNED NOT NULL;comment:流程实例ID"`
	NodeID       string    `gorm:"column:node_id;type:VARCHAR(250) NOT NULL;comment:节点ID"`
	PrevNodeID   string    `` /* 213-byte string literal not displayed */
	IsCosigned   int       `gorm:"column:is_cosigned;type:TINYINT DEFAULT 0;default:0;comment:0:任意一人通过即可 1:会签"`
	BatchCode    string    `` /* 180-byte string literal not displayed */
	UserID       string    `gorm:"column:user_id;type:VARCHAR(250) NOT NULL;comment:分配用户ID"`
	Status       int       `gorm:"column:status;type:TINYINT DEFAULT 0;default:0;comment:任务状态:0:初始 1:通过 2:驳回"`
	IsFinished   int       `` /* 205-byte string literal not displayed */
	CreateTime   time.Time `gorm:"column:create_time;type:DATETIME DEFAULT NOW();default:NOW();comment:系统创建任务时间"`
	FinishedTime time.Time `gorm:"column:finished_time;type:DATETIME DEFAULT NULL;default:NULL;comment:处理任务时间"`
}

任务表

type TaskComment

type TaskComment struct {
	ID         int    `gorm:"primaryKey;column:id;type:INT UNSIGNED NOT NULL AUTO_INCREMENT;"`
	ProcInstID int    `gorm:"index:ix_proc_inst_id;column:proc_inst_id;type:INT UNSIGNED NOT NULL;comment:流程实例ID"`
	TaskID     int    `gorm:"index:ix_task_id;column:task_id;type:INT UNSIGNED NOT NULL;comment:任务ID"`
	Comment    string `gorm:"column:comment;type:TEXT;comment:任务备注"`
}

任务备注表

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL