REPLACE INTO `zt_grouppriv`(`module`, `method`,`group`)
SELECT `module`, `method`, 14 from `zt_grouppriv` where `group` = 1;

REPLACE INTO `zt_grouppriv`(`module`, `method`,`group`)
SELECT `module`, `method`, 15 from `zt_grouppriv` where `group` = 4;

REPLACE INTO `zt_grouppriv`(`module`, `method`,`group`)
SELECT `module`, `method`, 16 from `zt_grouppriv` where `group` = 9;

-- DROP TABLE IF EXISTS `zt_workflow`;
CREATE TABLE IF NOT EXISTS `zt_workflow` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `parent` varchar(30) NOT NULL DEFAULT '',
  `child` varchar(30) NOT NULL DEFAULT '',
  `type` varchar(10) NOT NULL DEFAULT 'flow',
  `navigator` varchar(10) NOT NULL DEFAULT '',
  `app` varchar(20) NOT NULL DEFAULT '',
  `position` varchar(30) NOT NULL DEFAULT '',
  `module` varchar(30) NOT NULL DEFAULT '',
  `table` varchar(50) NOT NULL DEFAULT '',
  `name` varchar(30) NOT NULL DEFAULT '',
  `titleField` varchar(30) NOT NULL DEFAULT '',
  `contentField` text NULL,
  `flowchart` text NULL,
  `js` text NULL,
  `css` text NULL,
  `order` smallint(5) unsigned NOT NULL DEFAULT '0',
  `buildin` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `administrator` text NULL,
  `desc` text NULL,
  `version` varchar(10) NOT NULL DEFAULT '1.0',
  `status` varchar(10) NOT NULL DEFAULT 'wait',
  `vision` varchar(10) NOT NULL DEFAULT 'rnd',
  `approval` enum('enabled','disabled') NOT NULL DEFAULT 'disabled',
  `createdBy` varchar(30) NOT NULL DEFAULT '',
  `createdDate` datetime NULL,
  `editedBy` varchar(30) NOT NULL DEFAULT '',
  `editedDate` datetime NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE UNIQUE INDEX `unique` ON `zt_workflow`(`app`,`module`,`vision`);
CREATE INDEX `type`   ON `zt_workflow` (`type`);
CREATE INDEX `app`    ON `zt_workflow` (`app`);
CREATE INDEX `module` ON `zt_workflow` (`module`);
CREATE INDEX `order`  ON `zt_workflow` (`order`);

-- DROP TABLE IF EXISTS `zt_workflowaction`;
CREATE TABLE IF NOT EXISTS `zt_workflowaction` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `module` varchar(30) NOT NULL DEFAULT '',
  `action` varchar(50) NOT NULL DEFAULT '',
  `method` varchar(50) NOT NULL DEFAULT '',
  `name` varchar(50) NOT NULL DEFAULT '',
  `type` enum('single','batch') NOT NULL DEFAULT 'single',
  `batchMode` enum('same','different') NOT NULL DEFAULT 'different',
  `extensionType` varchar(10) NOT NULL DEFAULT 'override',
  `open` varchar(20) NOT NULL DEFAULT '',
  `position` enum('menu','browseandview','browse','view') NOT NULL DEFAULT 'browseandview',
  `layout` char(20) NOT NULL DEFAULT '',
  `show` enum('dropdownlist','direct') NOT NULL DEFAULT 'dropdownlist',
  `order` smallint(5) unsigned NOT NULL DEFAULT '0',
  `buildin` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `role` varchar(10) NOT NULL DEFAULT 'custom',
  `virtual` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `conditions` text NULL,
  `verifications` text NULL,
  `hooks` text NULL,
  `linkages` text NULL,
  `js` text NULL,
  `css` text NULL,
  `toList` char(255) NOT NULL DEFAULT '',
  `blocks` text NULL,
  `desc` text NULL,
  `status` varchar(10) NOT NULL DEFAULT 'enable',
  `vision` varchar(10) NOT NULL DEFAULT 'rnd',
  `createdBy` varchar(30) NOT NULL DEFAULT '',
  `createdDate` datetime NULL,
  `editedBy` varchar(30) NOT NULL DEFAULT '',
  `editedDate` datetime NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE UNIQUE INDEX `unique` ON `zt_workflowaction`(`module`,`action`,`vision`);
CREATE INDEX `module` ON `zt_workflowaction` (`module`);
CREATE INDEX `action` ON `zt_workflowaction` (`action`);
CREATE INDEX `order`  ON `zt_workflowaction` (`order`);

-- DROP TABLE IF EXISTS `zt_workflowdatasource`;
CREATE TABLE IF NOT EXISTS `zt_workflowdatasource` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `type` enum('system','sql','func','option','lang','category') NOT NULL DEFAULT 'option',
  `name` varchar(30) NOT NULL DEFAULT '',
  `code` varchar(30) NOT NULL DEFAULT '',
  `datasource` text NULL,
  `view` varchar(20) NOT NULL DEFAULT '',
  `keyField` varchar(50) NOT NULL DEFAULT '',
  `valueField` varchar(50) NOT NULL DEFAULT '',
  `buildin` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `vision` varchar(10) NOT NULL DEFAULT 'rnd',
  `createdBy` char(30) NOT NULL DEFAULT '',
  `createdDate` datetime NULL,
  `editedBy` char(30) NOT NULL DEFAULT '',
  `editedDate` datetime NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE INDEX `type` ON `zt_workflowdatasource` (`type`);

-- DROP TABLE IF EXISTS `zt_workflowfield`;
CREATE TABLE IF NOT EXISTS `zt_workflowfield` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `module` varchar(30) NOT NULL DEFAULT '',
  `field`  varchar(50) NOT NULL DEFAULT '',
  `type` varchar(20) NOT NULL DEFAULT 'varchar',
  `length` varchar(10) NOT NULL DEFAULT '',
  `name` varchar(50) NOT NULL DEFAULT '',
  `control` varchar(20) NOT NULL DEFAULT '',
  `expression` text NULL,
  `options` text NULL,
  `default` varchar(100) NOT NULL DEFAULT '',
  `rules` varchar(255) NOT NULL DEFAULT '',
  `placeholder` varchar(100) NOT NULL DEFAULT '',
  `order` smallint(5) unsigned NOT NULL DEFAULT '0',
  `searchOrder` smallint(5) unsigned NOT NULL DEFAULT '0',
  `exportOrder` smallint(5) unsigned NOT NULL DEFAULT '0',
  `canExport` enum('0', '1') NOT NULL DEFAULT '0',
  `canSearch` enum('0', '1') NOT NULL DEFAULT '0',
  `isValue` enum('0', '1') NOT NULL DEFAULT '0',
  `readonly` enum('0', '1') NOT NULL DEFAULT '0',
  `buildin` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `role` varchar(10) NOT NULL DEFAULT 'custom',
  `desc` text NULL,
  `createdBy` varchar(30) NOT NULL DEFAULT '',
  `createdDate` datetime NULL,
  `editedBy` varchar(30) NOT NULL DEFAULT '',
  `editedDate` datetime NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE UNIQUE INDEX `unique` ON `zt_workflowfield`(`module`, `field`);
CREATE INDEX `module` ON `zt_workflowfield` (`module`);
CREATE INDEX `field`  ON `zt_workflowfield` (`field`);
CREATE INDEX `order`  ON `zt_workflowfield` (`order`);

-- DROP TABLE IF EXISTS `zt_workflowlayout`;
CREATE TABLE IF NOT EXISTS `zt_workflowlayout` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `module` varchar(30) NOT NULL DEFAULT '',
  `action` varchar(50) NOT NULL DEFAULT '',
  `ui` mediumint(8) NOT NULL DEFAULT 0,
  `field` varchar(50) NOT NULL DEFAULT '',
  `order` smallint(5) unsigned NOT NULL DEFAULT '0',
  `width` varchar(50) NOT NULL DEFAULT '0',
  `position` text NULL,
  `readonly` enum('0','1') NOT NULL DEFAULT '0',
  `mobileShow` enum('0','1') NOT NULL DEFAULT '1',
  `summary` varchar(20) NOT NULL DEFAULT '',
  `defaultValue` text NULL,
  `layoutRules` varchar(255) NOT NULL DEFAULT '',
  `vision` varchar(10) NOT NULL DEFAULT 'rnd',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE UNIQUE INDEX `unique` ON `zt_workflowlayout`(`module`,`action`,`ui`,`field`,`vision`);
CREATE INDEX `module` ON `zt_workflowlayout` (`module`);
CREATE INDEX `action` ON `zt_workflowlayout` (`action`);
CREATE INDEX `order`  ON `zt_workflowlayout` (`order`);

-- DROP TABLE IF EXISTS `zt_workflowlabel`;
CREATE TABLE IF NOT EXISTS `zt_workflowlabel` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `module` varchar(30) NOT NULL DEFAULT '',
  `action` varchar(30) NOT NULL DEFAULT 'browse',
  `code` varchar(30) NOT NULL DEFAULT '',
  `label` varchar(255) NOT NULL DEFAULT '',
  `params` text NULL,
  `orderBy` text NULL,
  `order` tinyint(3) NOT NULL DEFAULT '0',
  `buildin` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `role` varchar(10) NOT NULL DEFAULT 'custom',
  `createdBy` char(30) NOT NULL DEFAULT '',
  `createdDate` datetime NULL,
  `editedBy` char(30) NOT NULL DEFAULT '',
  `editedDate` datetime NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE INDEX `module` ON `zt_workflowlabel` (`module`);

-- DROP TABLE IF EXISTS `zt_workflowlinkdata`;
CREATE TABLE IF NOT EXISTS `zt_workflowlinkdata` (
  `objectType` varchar(30) NOT NULL DEFAULT '',
  `objectID` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `linkedType` varchar(30) NOT NULL DEFAULT '',
  `linkedID` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `createdBy` varchar(30) NOT NULL DEFAULT '',
  `createdDate` datetime NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE UNIQUE INDEX `unique` ON `zt_workflowlinkdata`(`objectType`, `objectID`, `linkedType`, `linkedID`);

-- DROP TABLE IF EXISTS `zt_workflowrelation`;
CREATE TABLE IF NOT EXISTS `zt_workflowrelation` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `prev` varchar(30) NOT NULL DEFAULT '',
  `next` varchar(30) NOT NULL DEFAULT '',
  `field` varchar(50) NOT NULL DEFAULT '',
  `actions` varchar(20) NOT NULL DEFAULT '',
  `actionCodes` text NULL,
  `buildin` enum('0', '1') NOT NULL DEFAULT '0',
  `createdBy` char(30) NOT NULL DEFAULT '',
  `createdDate` datetime NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `zt_workflowrelationlayout`;
CREATE TABLE IF NOT EXISTS `zt_workflowrelationlayout` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `prev` varchar(30) NOT NULL DEFAULT '',
  `next` varchar(30) NOT NULL DEFAULT '',
  `action` varchar(50) NOT NULL DEFAULT '',
  `ui` mediumint(8) NOT NULL DEFAULT 0,
  `field` varchar(50) NOT NULL DEFAULT '',
  `order` smallint(5) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE UNIQUE INDEX `unique` ON `zt_workflowrelationlayout`(`prev`, `next`, `action`,`ui`,`field`);
CREATE INDEX `prev` ON `zt_workflowrelationlayout` (`prev`);
CREATE INDEX `next` ON `zt_workflowrelationlayout` (`next`);
CREATE INDEX `action` ON `zt_workflowrelationlayout` (`action`);
CREATE INDEX `order` ON `zt_workflowrelationlayout` (`order`);

-- DROP TABLE IF EXISTS `zt_workflowrule`;
CREATE TABLE IF NOT EXISTS `zt_workflowrule` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `type` enum('system', 'regex', 'func') NOT NULL DEFAULT 'regex',
  `name` varchar(30) NOT NULL DEFAULT '',
  `rule` text NULL,
  `createdBy` char(30) NOT NULL DEFAULT '',
  `createdDate` datetime NULL,
  `editedBy` char(30) NOT NULL DEFAULT '',
  `editedDate` datetime NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE INDEX `type` ON `zt_workflowrule` (`type`);

-- DROP TABLE IF EXISTS `zt_workflowsql`;
CREATE TABLE IF NOT EXISTS `zt_workflowsql` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `module` varchar(30) NOT NULL DEFAULT '',
  `field` varchar(50) NOT NULL DEFAULT '',
  `action` varchar(50) NOT NULL DEFAULT '',
  `sql` text NULL,
  `vars` text NULL,
  `createdBy` varchar(30) NOT NULL DEFAULT '',
  `createdDate` datetime NULL,
  `editedBy` varchar(30) NOT NULL DEFAULT '',
  `editedDate` datetime NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE INDEX `module` ON `zt_workflowsql` (`module`);
CREATE INDEX `field`  ON `zt_workflowsql` (`field`);
CREATE INDEX `action` ON `zt_workflowsql` (`action`);

-- DROP TABLE IF EXISTS `zt_workflowversion`;
CREATE TABLE IF NOT EXISTS `zt_workflowversion` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `module` varchar(30) NOT NULL DEFAULT '',
  `version` varchar(10) NOT NULL DEFAULT '',
  `fields` text NULL,
  `actions` text NULL,
  `layouts` text NULL,
  `sqls` text NULL,
  `labels` text NULL,
  `table` text NULL,
  `datas` text NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE UNIQUE INDEX `moduleversion` ON `zt_workflowversion`(`module`, `version`);
CREATE INDEX `module`  ON `zt_workflowversion` (`module`);
CREATE INDEX `version` ON `zt_workflowversion` (`version`);

-- DROP TABLE IF EXISTS `zt_workflowui`;
CREATE TABLE IF NOT EXISTS `zt_workflowui` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `module` varchar(30) NOT NULL,
  `action` varchar(50) NOT NULL,
  `name` varchar(30) NOT NULL,
  `conditions` text NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE INDEX `module` ON `zt_workflowui` (`module`);
CREATE INDEX `action` ON `zt_workflowui` (`action`);

-- DROP TABLE IF EXISTS `zt_workflowreport`;
CREATE TABLE IF NOT EXISTS `zt_workflowreport` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `module` varchar(30) NOT NULL,
  `name` varchar(100) NOT NULL,
  `type` enum('pie', 'line', 'bar') NOT NULL DEFAULT 'pie',
  `countType` enum('sum', 'count') NOT NULL DEFAULT 'sum',
  `displayType` enum('value', 'percent') NOT NULL DEFAULT 'value',
  `dimension` varchar(130) NOT NULL,
  `fields` text NOT NULL,
  `order` smallint(5) unsigned NOT NULL DEFAULT '0',
  `createdBy` varchar(30) NOT NULL DEFAULT '',
  `createdDate` datetime NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

REPLACE INTO `zt_workflowrule`(`type`, `name`, `rule`, `createdBy`, `createdDate`) VALUES
('system','必填','notempty','admin','2020-10-14 14:06:14'),
('system','唯一','unique','admin','2020-10-14 14:06:14'),
('system','日期','date','admin','2020-10-14 14:06:14'),
('system','email','email','admin','2020-10-14 14:06:14'),
('system','数字','float','admin','2020-10-14 14:06:14'),
('system','电话','phone','admin','2020-10-14 14:06:14'),
('system','IP','ip','admin','2020-10-14 14:06:14');

INSERT INTO `zt_workflowdatasource` (`type`, `name`, `code`, `buildin`, `vision`, `createdBy`, `createdDate`, `datasource`, `view`, `keyField`, `valueField`) VALUES
('system',      '产品',           'products',                 '1', 'rnd', 'admin', '1970-01-01 00:00:01', '{\"app\":\"system\",\"module\":\"product\",\"method\":\"getPairs\",\"methodDesc\":\"Get product pairs.\",\"params\":[{\"name\":\"mode\",\"type\":\"string\",\"desc\":\"\",\"value\":\"all\"}]}',       '',     '',     ''),
('system',      '项目',           'projects',                 '1', 'rnd', 'admin', '1970-01-01 00:00:01', '{\"app\":\"system\",\"module\":\"project\",\"method\":\"getPairsByModel\",\"methodDesc\":\"Get project pairs by model and project.\",\"params\":[{\"name\":\"model\",\"type\":\"string\",\"desc\":\"all|scrum|waterfall\",\"value\":\"all\"},{\"name\":\"programID\",\"type\":\"int\",\"desc\":\"\",\"value\":\"0\"},{\"name\":\"param\",\"type\":\"\",\"desc\":\"\",\"value\":\"\"}]}',  '',     '',     ''),
('system',      '产品线',         'productLines',             '1', 'rnd', 'admin', '1970-01-01 00:00:01', '{\"app\":\"system\",\"module\":\"product\",\"method\":\"getLinePairs\",\"methodDesc\":\"Get line pairs.\",\"params\":[{\"name\":\"useShort\",\"type\":\"bool\",\"desc\":\"\",\"value\":\"\"}]}',  '',     '',     ''),
('sql',         '软件需求',       'stories',                  '1', 'rnd', 'admin', '1970-01-01 00:00:01', 'select id,title from zt_story where deleted=\"0\" and type=\"story\"',    'view_datasource_4',    'id',   'title'),
('sql',         '任务',           'tasks',                    '1', 'rnd', 'admin', '1970-01-01 00:00:01', 'select id,name from zt_task where deleted=\"0\" and vision=\"rnd\"',      'view_datasource_5',    'id',   'name'),
('sql',         'Bug',            'bugs',                     '1', 'rnd', 'admin', '1970-01-01 00:00:01', 'select id,title from zt_bug where deleted=\"0\"',      'view_datasource_6',    'id',   'title'),
('system',      '权限分组',       'groups',                   '1', 'rnd', 'admin', '1970-01-01 00:00:01', '{\"app\":\"system\",\"module\":\"group\",\"method\":\"getPairs\",\"methodDesc\":\"\",\"params\":[]}',  '',     '',     ''),
('system',      '用户',           'users',                    '1', 'rnd', 'admin', '1970-01-01 00:00:01', '{\"app\":\"system\",\"module\":\"user\",\"method\":\"getPairs\",\"methodDesc\":\"\",\"params\":[{\"name\":\"params\",\"type\":\"\",\"desc\":\"\",\"value\":\"noclosed|noletter\"},{\"name\":\"usersToAppended\",\"type\":\"\",\"desc\":\"\",\"value\":\"\"}]}',        '',     '',     ''),
('system',      '产品分支',       'branches',                 '1', 'rnd', 'admin', '1970-01-01 00:00:01', '{\"app\":\"system\",\"module\":\"branch\",\"method\":\"getAllPairs\",\"methodDesc\":\"Get pairs.\",\"params\":[{\"name\":\"params\",\"type\":\"string\",\"desc\":\"\",\"value\":\"\"}]}',      '',     '',     ''),
('sql',         '版本',           'builds',                   '1', 'rnd', 'admin', '1970-01-01 00:00:01', 'select id,name from zt_build where deleted=\"0\"',     'view_datasource_10',   'id',   'name'),
('sql',         '模块',           'modules',                  '1', 'rnd', 'admin', '1970-01-01 00:00:01', 'select id,name from zt_module where deleted=\"0\"',    'view_datasource_11',   'id',   'name'),
('sql',         '计划',           'plans',                    '1', 'rnd', 'admin', '1970-01-01 00:00:01', 'select id,title from zt_productplan where deleted=\"0\"',      'view_datasource_12',   'id',   'title'),
('lang',        '产品类型',       'productType',              '1', 'rnd', 'admin', '1970-01-01 00:00:01', 'productType',    '',     '',     ''),
('lang',        '产品状态',       'productStatus',            '1', 'rnd', 'admin', '1970-01-01 00:00:01', 'productStatus',  '',     '',     ''),
('lang',        '产品访问控制',   'productAcl',               '1', 'rnd', 'admin', '1970-01-01 00:00:01', 'productAcl',     '',     '',     ''),
('lang',        '项目类型',       'projectType',              '1', 'rnd', 'admin', '1970-01-01 00:00:01', 'projectType',    '',     '',     ''),
('lang',        '项目状态',       'projectStatus',            '1', 'rnd', 'admin', '1970-01-01 00:00:01', 'projectStatus',  '',     '',     ''),
('lang',        '项目访问控制',   'projectAcl',               '1', 'rnd', 'admin', '1970-01-01 00:00:01', 'projectAcl',     '',     '',     ''),
('lang',        '发布状态',       'releaseStatus',            '1', 'rnd', 'admin', '1970-01-01 00:00:01', 'releaseStatus',  '',     '',     ''),
('lang',        '需求来源',       'storySource',              '1', 'rnd', 'admin', '1970-01-01 00:00:01', 'storySource',    '',     '',     ''),
('lang',        '需求优先级',     'storyPri',                 '1', 'rnd', 'admin', '1970-01-01 00:00:01', 'storyPri',       '',     '',     ''),
('lang',        '需求状态',       'storyStatus',              '1', 'rnd', 'admin', '1970-01-01 00:00:01', 'storyStatus',    '',     '',     ''),
('lang',        '需求阶段',       'storyStage',               '1', 'rnd', 'admin', '1970-01-01 00:00:01', 'storyStage',     '',     '',     ''),
('lang',        'Bug严重程度',    'bugSeverity',              '1', 'rnd', 'admin', '1970-01-01 00:00:01', 'bugSeverity',    '',     '',     ''),
('lang',        'Bug优先级',      'bugPri',                   '1', 'rnd', 'admin', '1970-01-01 00:00:01', 'bugPri',         '',     '',     ''),
('lang',        'Bug类型',        'bugType',                  '1', 'rnd', 'admin', '1970-01-01 00:00:01', 'bugType',        '',     '',     ''),
('lang',        'Bug操作系统',    'bugOs',                    '1', 'rnd', 'admin', '1970-01-01 00:00:01', 'bugOs',          '',     '',     ''),
('lang',        'Bug浏览器',      'bugBrowser',               '1', 'rnd', 'admin', '1970-01-01 00:00:01', 'bugBrowser',     '',     '',     ''),
('lang',        'Bug状态',        'bugStatus',                '1', 'rnd', 'admin', '1970-01-01 00:00:01', 'bugStatus',      '',     '',     ''),
('lang',        '任务类型',       'taskType',                 '1', 'rnd', 'admin', '1970-01-01 00:00:01', 'taskType',       '',     '',     ''),
('lang',        '任务优先级',     'taskPri',                  '1', 'rnd', 'admin', '1970-01-01 00:00:01', 'taskPri',        '',     '',     ''),
('lang',        '任务状态',       'taskStatus',               '1', 'rnd', 'admin', '1970-01-01 00:00:01', 'taskStatus',     '',     '',     ''),
('lang',        '测试用例优先级', 'testcasePri',              '1', 'rnd', 'admin', '1970-01-01 00:00:01', 'testcasePri',    '',     '',     ''),
('lang',        '测试用例类型',   'testcaseType',             '1', 'rnd', 'admin', '1970-01-01 00:00:01', 'testcaseType',   '',     '',     ''),
('lang',        '测试用例阶段',   'testcaseStage',            '1', 'rnd', 'admin', '1970-01-01 00:00:01', 'testcaseStage',  '',     '',     ''),
('lang',        '测试用例状态',   'testcaseStatus',           '1', 'rnd', 'admin', '1970-01-01 00:00:01', 'testcaseStatus', '',     '',     ''),
('lang',        '测试单优先级',   'testtaskPri',              '1', 'rnd', 'admin', '1970-01-01 00:00:01', 'testtaskPri',    '',     '',     ''),
('lang',        '测试单状态',     'testtaskStatus',           '1', 'rnd', 'admin', '1970-01-01 00:00:01', 'testtaskStatus', '',     '',     ''),
('lang',        '反馈状态',       'feedbackStatus',           '1', 'rnd', 'admin', '1970-01-01 00:00:01', 'feedbackStatus', '',     '',     ''),
('lang',        'Bug解决方案',    'bugResolution',            '1', 'rnd', 'admin', '1970-01-01 00:00:01', 'bugResolution',  '',     '',     ''),
('sql',         '用例',           'cases',                    '1', 'rnd', 'admin', '1970-01-01 00:00:01', 'select id,title from zt_case where deleted=\"0\"',     'view_datasource_41',   'id',   'title'),
('system',      '反馈分支',       'feedbackModules',          '1', 'rnd', 'admin', '1970-01-01 00:00:01', '{\"app\":\"system\",\"module\":\"tree\",\"method\":\"getOptionMenu\",\"methodDesc\":\"Create an option menu in html.\",\"params\":[{\"name\":\"rootID\",\"type\":\"int\",\"desc\":\"\",\"value\":\"0\"},{\"name\":\"type\",\"type\":\"string\",\"desc\":\"\",\"value\":\"feedback\"},{\"name\":\"startModule\",\"type\":\"int\",\"desc\":\"\",\"value\":\"0\"},{\"name\":\"branch\",\"type\":\"\",\"desc\":\"\",\"value\":\"0\"}]}',   '',     '',     ''),
('lang',        '需求类型',       'storyType',                '1', 'rnd', 'admin', '1970-01-01 00:00:01', 'storyType',    '',     '',     ''),
('system',  	'执行',	          'executions',               '1', 'rnd', 'admin', '1970-01-01 00:00:01', '{\"app\":\"system\",\"module\":\"execution\",\"method\":\"getPairs\",\"methodDesc\":\"Get execution pairs.\",\"params\":[{\"name\":\"projectID\",\"type\":\"int\",\"desc\":\"\",\"value\":\"0\"},{\"name\":\"type\",\"type\":\"string\",\"desc\":\"all|sprint|stage|kanban\",\"value\":\"all\"},{\"name\":\"mode\",\"type\":\"string\",\"desc\":\"all|noclosed|stagefilter or empty\",\"value\":\"\"}]}',  '',     '',     ''),
('lang',        '项目模型',       'projectModel',             '1', 'rnd', 'admin', '1970-01-01 00:00:01', 'projectModel', '', '', ''),
('lang',        '反馈类型',       'feedbackType',             '1', 'rnd', 'admin', '1970-01-01 00:00:01', 'feedbackType', '', '', ''),
('lang',        '反馈处理方案',   'feedbackSolution',         '1', 'rnd', 'admin', '1970-01-01 00:00:01', 'feedbackSolution',     '', '', ''),
('lang',        '反馈关闭原因',   'feedbackclosedReason',     '1', 'rnd', 'admin', '1970-01-01 00:00:01', 'feedbackclosedReason', '', '', ''),
('lang',        '任务关闭原因',   'taskReason',               '1', 'rnd', 'admin', '1970-01-01 00:00:01', 'taskReason', '', '', ''),
('lang',        '套件权限',       'testsuiteAuth',            '1', 'rnd', 'admin', '1970-01-01 00:00:01', 'testsuiteAuth', '', '', ''),
('system',      '项目集',         'programs',                 '1', 'rnd', 'admin', '1970-01-01 00:00:01', '{\"app\":\"system\",\"module\":\"program\",\"method\":\"getPairs\",\"methodDesc\":\"Get program pairs.\",\"params\":[{\"name\":\"isQueryAll\",\"type\":\"bool\",\"desc\":\"\",\"value\":\"\"},{\"name\":\"orderBy\",\"type\":\"string\",\"desc\":\"\",\"value\":\"id_desc\"}]}',  '',     '',     ''),
('lang',        '需求关闭原因',   'storyClosedReason',        '1', 'rnd', 'admin', '1970-01-01 00:00:01', 'storyClosedReason', '', '', ''),
('system',      '项目',           'liteprojects',             '1', 'lite', 'admin', '1970-01-01 00:00:01', '{\"app\":\"system\",\"module\":\"project\",\"method\":\"getPairsByModel\",\"methodDesc\":\"Get project pairs by model and project.\",\"params\":[{\"name\":\"model\",\"type\":\"string\",\"desc\":\"all|scrum|waterfall\",\"value\":\"all\"},{\"name\":\"programID\",\"type\":\"int\",\"desc\":\"\",\"value\":\"0\"},{\"name\":\"param\",\"type\":\"\",\"desc\":\"\",\"value\":\"\"}]}',  '',     '',     ''),
('sql',         '任务',           'litetasks',                '1', 'lite', 'admin', '1970-01-01 00:00:01', 'select id,name from zt_task where deleted=\"0\" and vision=\"lite\"',      'view_datasource_54',    'id',   'name'),
('system',      '权限分组',       'litegroups',               '1', 'lite', 'admin', '1970-01-01 00:00:01', '{\"app\":\"system\",\"module\":\"group\",\"method\":\"getPairs\",\"methodDesc\":\"\",\"params\":[]}',  '',     '',     ''),
('system',      '用户',           'liteusers',                '1', 'lite', 'admin', '1970-01-01 00:00:01', '{\"app\":\"system\",\"module\":\"user\",\"method\":\"getPairs\",\"methodDesc\":\"\",\"params\":[{\"name\":\"params\",\"type\":\"\",\"desc\":\"\",\"value\":\"noclosed|noletter\"},{\"name\":\"usersToAppended\",\"type\":\"\",\"desc\":\"\",\"value\":\"\"}]}',        '',     '',     ''),
('sql',         '模块',           'litemodules',              '1', 'lite', 'admin', '1970-01-01 00:00:01', 'select id,name from zt_module where deleted=\"0\"',    'view_datasource_11',   'id',   'name'),
('lang',        '项目类型',       'liteprojectType',          '1', 'lite', 'admin', '1970-01-01 00:00:01', 'projectType',    '',     '',     ''),
('lang',        '项目状态',       'liteprojectStatus',        '1', 'lite', 'admin', '1970-01-01 00:00:01', 'projectStatus',  '',     '',     ''),
('lang',        '项目访问控制',   'liteprojectAcl',           '1', 'lite', 'admin', '1970-01-01 00:00:01', 'projectAcl',     '',     '',     ''),
('lang',        '任务类型',       'litetaskType',             '1', 'lite', 'admin', '1970-01-01 00:00:01', 'taskType',       '',     '',     ''),
('lang',        '任务优先级',     'litetaskPri',              '1', 'lite', 'admin', '1970-01-01 00:00:01', 'taskPri',        '',     '',     ''),
('lang',        '任务状态',       'litetaskStatus',           '1', 'lite', 'admin', '1970-01-01 00:00:01', 'taskStatus',     '',     '',     ''),
('lang',        '反馈状态',       'litefeedbackStatus',       '1', 'lite', 'admin', '1970-01-01 00:00:01', 'feedbackStatus', '',     '',     ''),
('system',      '反馈分支',       'litefeedbackModules',      '1', 'lite', 'admin', '1970-01-01 00:00:01', '{\"app\":\"system\",\"module\":\"tree\",\"method\":\"getOptionMenu\",\"methodDesc\":\"Create an option menu in html.\",\"params\":[{\"name\":\"rootID\",\"type\":\"int\",\"desc\":\"\",\"value\":\"0\"},{\"name\":\"type\",\"type\":\"string\",\"desc\":\"\",\"value\":\"feedback\"},{\"name\":\"startModule\",\"type\":\"int\",\"desc\":\"\",\"value\":\"0\"},{\"name\":\"branch\",\"type\":\"\",\"desc\":\"\",\"value\":\"0\"}]}',   '',     '',     ''),
('lang',        '反馈类型',       'litefeedbackType',         '1', 'lite', 'admin', '1970-01-01 00:00:01', 'feedbackType',         '', '', ''),
('lang',        '反馈处理方案',   'litefeedbackSolution',     '1', 'lite', 'admin', '1970-01-01 00:00:01', 'feedbackSolution',     '', '', ''),
('lang',        '反馈关闭原因',   'litefeedbackclosedReason', '1', 'lite', 'admin', '1970-01-01 00:00:01', 'feedbackclosedReason', '', '', ''),
('lang',        '任务关闭原因',   'litetaskReason',           '1', 'lite', 'admin', '1970-01-01 00:00:01', 'taskReason',           '', '', ''),
('lang',        '工单类型',       'ticketType',               '1', 'rnd', 'admin',  '1970-01-01 00:00:01', 'ticketType', '', '', ''),
('lang',        '工单优先级',     'ticketPri',                '1', 'rnd', 'admin',  '1970-01-01 00:00:01', 'ticketPri', '', '', ''),
('lang',        '工单状态',       'ticketStatus',             '1', 'rnd', 'admin',  '1970-01-01 00:00:01', 'ticketStatus', '', '', ''),
('sql',         '反馈',           'feedbacks',                '1', 'rnd', 'admin',  '1970-01-01 00:00:01', 'select id,title from zt_feedback where deleted=\"0\"', 'view_datasource_55', 'id', 'title'),
('lang',        '需求优先级',     'demandPri',                '1', 'or',  'admin',  '1970-01-01 00:00:01', 'demandPri', '', '', ''),
('lang',        '需求来源',       'demandSource',             '1', 'or',  'admin',  '1970-01-01 00:00:01', 'demandSource', '', '', ''),
('lang',        '需求类别',       'demandCategory',           '1', 'or',  'admin',  '1970-01-01 00:00:01', 'demandCategory', '', '', ''),
('lang',        '需求状态',       'demandStatus',             '1', 'or',  'admin',  '1970-01-01 00:00:01', 'demandStatus', '', '', ''),
('lang',        '需求管理周期',   'demandDuration',           '1', 'or',  'admin',  '1970-01-01 00:00:01', 'demandDuration', '', '', ''),
('lang',        '需求BSA',        'demandBSA',                '1', 'or',  'admin',  '1970-01-01 00:00:01', 'demandBSA', '', '', ''),
('sql',         '用户需求',       'requirements',             '1', 'rnd', 'admin',  '1970-01-01 00:00:01', 'select id,title from zt_story where deleted=\"0\" and type=\"requirement\"',    'view_datasource_3',    'id',   'title'),
('sql',         '业务需求',       'epics',                    '1', 'rnd', 'admin',  '1970-01-01 00:00:01', 'select id,title from zt_story where deleted=\"0\" type=\"epic\"',    'view_datasource_2',    'id',   'title');

DROP VIEW IF EXISTS `view_datasource_2`;
DROP VIEW IF EXISTS `view_datasource_3`;
DROP VIEW IF EXISTS `view_datasource_4`;
DROP VIEW IF EXISTS `view_datasource_5`;
DROP VIEW IF EXISTS `view_datasource_6`;
DROP VIEW IF EXISTS `view_datasource_10`;
DROP VIEW IF EXISTS `view_datasource_11`;
DROP VIEW IF EXISTS `view_datasource_12`;
DROP VIEW IF EXISTS `view_datasource_41`;
DROP VIEW IF EXISTS `view_datasource_54`;
DROP VIEW IF EXISTS `view_datasource_55`;

CREATE VIEW `view_datasource_2`  AS select `id`,`title` from `zt_story` where `deleted` = '0' and type = 'epic';
CREATE VIEW `view_datasource_3`  AS select `id`,`title` from `zt_story` where `deleted` = '0' and type = 'requirement';
CREATE VIEW `view_datasource_4`  AS select `id`,`title` from `zt_story` where `deleted` = '0' and type = 'story';
CREATE VIEW `view_datasource_5`  AS select `id`,`name` from `zt_task` where `deleted` = '0' and vision = 'rnd';
CREATE VIEW `view_datasource_6`  AS select `id`,`title` from `zt_bug` where `deleted` = '0';
CREATE VIEW `view_datasource_10` AS select `id`,`name` from `zt_build` where `deleted` = '0';
CREATE VIEW `view_datasource_11` AS select `id`,`name` from `zt_module` where `deleted` = '0';
CREATE VIEW `view_datasource_12` AS select `id`,`title` from `zt_productplan` where `deleted` = '0';
CREATE VIEW `view_datasource_41` AS select `id`,`title` from `zt_case` where `deleted` = '0';
CREATE VIEW `view_datasource_54` AS select `id`,`name` from `zt_task` where `deleted` = '0' and vision = 'lite';
CREATE VIEW `view_datasource_55` AS select `id`,`title` from `zt_feedback` where `deleted` = '0';

-- DROP TABLE IF EXISTS `zt_durationestimation`;
CREATE TABLE IF NOT EXISTS `zt_durationestimation` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `project` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `stage` mediumint(9) NOT NULL DEFAULT '0',
  `workload` varchar(255) NOT NULL DEFAULT '',
  `worktimeRate` varchar(255) NOT NULL DEFAULT '',
  `people` varchar(255) NOT NULL DEFAULT '',
  `startDate` date NULL,
  `endDate` date NULL,
  `createdBy` varchar(30) NOT NULL DEFAULT '',
  `createdDate` datetime NULL,
  `editedBy` varchar(30) NOT NULL DEFAULT '',
  `editedDate` datetime NULL,
  `deleted` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `zt_workestimation`;
CREATE TABLE IF NOT EXISTS `zt_workestimation` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `project` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `scale` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `productivity` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `duration` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `unitLaborCost` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `totalLaborCost` decimal(10,2) unsigned NOT NULL DEFAULT '0.00',
  `createdBy` varchar(30) NOT NULL DEFAULT '',
  `createdDate` datetime NULL,
  `editedBy` varchar(30) NOT NULL DEFAULT '',
  `editedDate` datetime NULL,
  `assignedTo` varchar(30) NOT NULL DEFAULT '',
  `assignedDate` datetime NULL,
  `deleted` enum('0','1') NOT NULL DEFAULT '0',
  `dayHour` decimal(10,2) NOT NULL DEFAULT '0.00',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `zt_intervention`;
CREATE TABLE IF NOT EXISTS `zt_intervention` (
  `id` mediumint(8) NOT NULL AUTO_INCREMENT,
  `project` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `activity` mediumint(8) NOT NULL DEFAULT '0',
  `status` char(30) NOT NULL DEFAULT '',
  `partake` text NULL,
  `begin` date NULL,
  `realBegin` date NULL,
  `situation` varchar(255) NOT NULL DEFAULT '',
  `createdBy` char(30) NOT NULL DEFAULT '',
  `createdDate` date NULL,
  `deleted` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE UNIQUE INDEX `project` ON `zt_intervention`(`project`,`activity`);

-- DROP TABLE IF EXISTS `zt_activity`;
CREATE TABLE IF NOT EXISTS `zt_activity` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `process` mediumint(9) NOT NULL DEFAULT '0',
  `name` varchar(255) NOT NULL DEFAULT '',
  `optional` varchar(255) NOT NULL DEFAULT '',
  `tailorNorm` varchar(255) NOT NULL DEFAULT '',
  `content` mediumtext NULL,
  `assignedTo` varchar(30) NOT NULL DEFAULT '',
  `status` varchar(30) NOT NULL DEFAULT '',
  `createdBy` varchar(30) NOT NULL DEFAULT '',
  `createdDate` datetime NULL,
  `editedBy` varchar(30) NOT NULL DEFAULT '',
  `editedDate` datetime NULL,
  `assignedBy` varchar(30) NOT NULL DEFAULT '',
  `assignedDate` datetime NULL,
  `order` mediumint(8) DEFAULT '0',
  `deleted` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `zt_auditcl`;
CREATE TABLE IF NOT EXISTS `zt_auditcl` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `model` char(30) NOT NULL DEFAULT 'waterfall',
  `practiceArea` char(30) NOT NULL DEFAULT '',
  `type` char(30) NOT NULL DEFAULT '',
  `title` varchar(255) NOT NULL DEFAULT '',
  `objectType` char(30) NOT NULL DEFAULT '',
  `objectID` int(11) NOT NULL DEFAULT '0',
  `assignedTo` varchar(30) NOT NULL DEFAULT '',
  `status` varchar(30) NOT NULL DEFAULT '',
  `createdBy` varchar(30) NOT NULL DEFAULT '',
  `createdDate` datetime NULL,
  `editedBy` varchar(30) NOT NULL DEFAULT '',
  `editedDate` datetime NULL,
  `assignedBy` varchar(30) NOT NULL DEFAULT '',
  `assignedDate` datetime NULL,
  `deleted` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `zt_auditplan`;
CREATE TABLE IF NOT EXISTS `zt_auditplan` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `dateType` char(30) NOT NULL DEFAULT '',
  `config` text NULL,
  `objectID` mediumint(9) NOT NULL DEFAULT '0',
  `objectType` char(30) NOT NULL DEFAULT '',
  `process` mediumint(9) NOT NULL DEFAULT '0',
  `processType` char(30) NOT NULL DEFAULT '',
  `checkDate` date NULL,
  `checkedBy` varchar(30) NOT NULL DEFAULT '',
  `realCheckDate` date NULL,
  `result` char(30) NOT NULL DEFAULT '',
  `project` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `execution` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `assignedTo` varchar(30) NOT NULL DEFAULT '',
  `status` varchar(30) NOT NULL DEFAULT '',
  `createdBy` varchar(30) NOT NULL DEFAULT '',
  `createdDate` datetime NULL,
  `editedBy` varchar(30) NOT NULL DEFAULT '',
  `editedDate` datetime NULL,
  `assignedBy` varchar(30) NOT NULL DEFAULT '',
  `assignedDate` datetime NULL,
  `deleted` enum('0','1') NOT NULL DEFAULT '0',
  `checkBy` varchar(30) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `zt_auditresult`;
CREATE TABLE IF NOT EXISTS `zt_auditresult` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `auditplan` mediumint(8) NOT NULL DEFAULT '0',
  `listID` mediumint(8) NOT NULL DEFAULT '0',
  `result` char(30) NOT NULL DEFAULT '',
  `checkedBy` varchar(30) NOT NULL DEFAULT '',
  `checkedDate` date NULL,
  `comment` text NULL,
  `assignedTo` varchar(30) NOT NULL DEFAULT '',
  `status` varchar(30) NOT NULL DEFAULT '',
  `createdBy` varchar(30) NOT NULL DEFAULT '',
  `createdDate` datetime NULL,
  `editedBy` varchar(30) NOT NULL DEFAULT '',
  `editedDate` datetime NULL,
  `assignedBy` varchar(30) NOT NULL DEFAULT '',
  `assignedDate` datetime NULL,
  `deleted` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `zt_nc`;
CREATE TABLE IF NOT EXISTS `zt_nc` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `project` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `auditplan` mediumint(8) NOT NULL DEFAULT '0',
  `listID` mediumint(8) NOT NULL DEFAULT '0',
  `title` varchar(255) NOT NULL DEFAULT '',
  `desc` mediumtext NULL,
  `type` char(30) NOT NULL DEFAULT '',
  `status` varchar(30) NOT NULL DEFAULT 'active',
  `severity` char(30) NOT NULL DEFAULT '',
  `deadline` date NULL,
  `resolvedBy` varchar(30) NOT NULL DEFAULT '',
  `resolution` char(30) NOT NULL DEFAULT '',
  `resolvedDate` date NULL,
  `closedBy` varchar(30) NOT NULL DEFAULT '',
  `closedDate` date NULL,
  `parent` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `assignedTo` varchar(30) NOT NULL DEFAULT '',
  `assignedDate` date NULL,
  `activateDate` date NULL,
  `createdBy` varchar(30) NOT NULL DEFAULT '',
  `createdDate` datetime NULL,
  `editedBy` varchar(30) NOT NULL DEFAULT '',
  `editedDate` datetime NULL,
  `deleted` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `zt_zoutput`;
CREATE TABLE IF NOT EXISTS `zt_zoutput` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `activity` mediumint(8) NOT NULL DEFAULT '0',
  `name` varchar(255) NOT NULL DEFAULT '',
  `content` mediumtext NULL,
  `optional` char(20) NOT NULL DEFAULT '',
  `tailorNorm` varchar(255) NOT NULL DEFAULT '',
  `status` varchar(30) NOT NULL DEFAULT '',
  `createdBy` varchar(30) NOT NULL DEFAULT '',
  `createdDate` datetime NULL,
  `editedBy` varchar(30) NOT NULL DEFAULT '',
  `editedDate` datetime NULL,
  `order` mediumint(8) DEFAULT '0',
  `deleted` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `zt_process`;
CREATE TABLE IF NOT EXISTS `zt_process` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `model` char(30) NOT NULL DEFAULT 'waterfall',
  `name` varchar(255) NOT NULL DEFAULT '',
  `type` char(30) NOT NULL DEFAULT '',
  `abbr` char(30) NOT NULL DEFAULT '',
  `desc` mediumtext NULL,
  `assignedTo` varchar(30) NOT NULL DEFAULT '',
  `status` varchar(30) NOT NULL DEFAULT '',
  `order` mediumint(9) NOT NULL DEFAULT '0',
  `createdBy` varchar(30) NOT NULL DEFAULT '',
  `createdDate` datetime NULL,
  `editedBy` varchar(30) NOT NULL DEFAULT '',
  `editedDate` datetime NULL,
  `assignedBy` varchar(30) NOT NULL DEFAULT '',
  `assignedDate` datetime NULL,
  `deleted` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `zt_programactivity`;
CREATE TABLE IF NOT EXISTS `zt_programactivity` (
  `id` int(8) NOT NULL AUTO_INCREMENT,
  `project` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `execution` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `process` mediumint(8) NOT NULL DEFAULT '0',
  `activity` mediumint(8) NOT NULL DEFAULT '0',
  `name` varchar(255) NOT NULL DEFAULT '',
  `content` text NULL,
  `reason` varchar(255) NOT NULL DEFAULT '',
  `result` char(30) NOT NULL DEFAULT '',
  `linkedBy` char(30) NOT NULL DEFAULT '',
  `createdBy` char(30) NOT NULL DEFAULT '',
  `createdDate` date NULL,
  `deleted` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `zt_programoutput`;
CREATE TABLE IF NOT EXISTS `zt_programoutput` (
  `id` int(8) NOT NULL AUTO_INCREMENT,
  `project` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `execution` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `process` mediumint(8) NOT NULL DEFAULT '0',
  `activity` mediumint(8) NOT NULL DEFAULT '0',
  `output` mediumint(8) NOT NULL DEFAULT '0',
  `content` text NULL,
  `name` varchar(255) NOT NULL DEFAULT '',
  `reason` varchar(255) NOT NULL DEFAULT '',
  `result` char(30) NOT NULL DEFAULT '',
  `linkedBy` char(30) NOT NULL DEFAULT '',
  `createdBy` char(30) NOT NULL DEFAULT '',
  `createdDate` date NULL,
  `deleted` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `zt_programprocess`;
CREATE TABLE IF NOT EXISTS `zt_programprocess` (
  `id` int(8) NOT NULL AUTO_INCREMENT,
  `project` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `process` mediumint(8) NOT NULL DEFAULT '0',
  `name` varchar(255) NOT NULL DEFAULT '',
  `type` char(30) NOT NULL DEFAULT '',
  `abbr` char(30) NOT NULL DEFAULT '',
  `desc` text NULL,
  `reason` varchar(255) NOT NULL DEFAULT '',
  `linkedBy` char(30) NOT NULL DEFAULT '',
  `createdBy` char(30) NOT NULL DEFAULT '',
  `createdDate` date NULL,
  `deleted` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `zt_basicmeas`;
CREATE TABLE IF NOT EXISTS `zt_basicmeas` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `purpose` varchar(50) NOT NULL DEFAULT '',
  `scope` char(30) NOT NULL DEFAULT '',
  `object` char(30) NOT NULL DEFAULT '',
  `name` varchar(90) NOT NULL DEFAULT '',
  `code` char(30) NOT NULL DEFAULT '',
  `unit` varchar(100) NOT NULL DEFAULT '',
  `configure` text NULL,
  `params` text NULL,
  `definition` text NULL,
  `source` varchar(255) NOT NULL DEFAULT '',
  `collectType` varchar(30) NOT NULL DEFAULT '',
  `collectConf` text NULL,
  `execTime` varchar(30) NOT NULL DEFAULT '',
  `collectedBy` varchar(10) NOT NULL DEFAULT '',
  `createdBy` varchar(30) NOT NULL DEFAULT '',
  `createdDate` datetime NULL,
  `editedBy` varchar(30) NOT NULL DEFAULT '',
  `editedDate` datetime NULL,
  `order` mediumint(8) UNSIGNED NOT NULL DEFAULT 0,
  `deleted` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE UNIQUE INDEX `code` ON `zt_basicmeas`(`code`);

-- DROP TABLE IF EXISTS `zt_budget`;
CREATE TABLE IF NOT EXISTS `zt_budget` (
  `id` int(8) NOT NULL AUTO_INCREMENT,
  `project` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `stage` char(30) NOT NULL DEFAULT '',
  `subject` mediumint(8) NOT NULL DEFAULT '0',
  `amount` char(30) NOT NULL DEFAULT '',
  `name` varchar(255) NOT NULL DEFAULT '',
  `desc` mediumtext NULL,
  `createdBy` char(30) NOT NULL DEFAULT '',
  `createdDate` date NULL,
  `lastEditedBy` char(30) NOT NULL DEFAULT '',
  `lastEditedDate` date NULL,
  `deleted` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `zt_researchplan`;
CREATE TABLE IF NOT EXISTS `zt_researchplan` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `project` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `name` varchar(255) NOT NULL DEFAULT '',
  `customer` varchar(255) NOT NULL DEFAULT '',
  `stakeholder` varchar(255) NOT NULL DEFAULT '',
  `objective` varchar(255) NOT NULL DEFAULT '',
  `begin` datetime NULL,
  `end` datetime NULL,
  `location` varchar(255) NOT NULL DEFAULT '',
  `team` varchar(255) NOT NULL DEFAULT '',
  `method` enum('','videoConference','interview','questionnaire','telephoneInterview') NOT NULL DEFAULT '',
  `outline` mediumtext NULL,
  `schedule` mediumtext NULL,
  `createdBy` varchar(30) NOT NULL DEFAULT '',
  `createdDate` datetime NULL,
  `editedBy` varchar(30) NOT NULL DEFAULT '',
  `editedDate` datetime NULL,
  `deleted` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `zt_researchreport`;
CREATE TABLE IF NOT EXISTS `zt_researchreport` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `project` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `relatedPlan` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `title` varchar(255) NOT NULL DEFAULT '',
  `author` varchar(30) NOT NULL DEFAULT '',
  `content` mediumtext NULL,
  `customer` varchar(255) NOT NULL DEFAULT '',
  `researchObjects` varchar(255) NOT NULL DEFAULT '',
  `begin` datetime NULL,
  `end` datetime NULL,
  `location` varchar(255) NOT NULL DEFAULT '',
  `method` enum('','videoConference','interview','questionnaire','telephoneInterview') NOT NULL DEFAULT '',
  `createdBy` varchar(30) NOT NULL DEFAULT '',
  `createdDate` datetime NULL,
  `editedBy` varchar(30) NOT NULL DEFAULT '',
  `editedDate` datetime NULL,
  `deleted` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `zt_meeting`;
CREATE TABLE IF NOT EXISTS `zt_meeting` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `project` mediumint(8) NOT NULL DEFAULT '0',
  `execution` mediumint(8) NOT NULL DEFAULT '0',
  `name` varchar(255) NOT NULL DEFAULT '',
  `type` varchar(255) NOT NULL DEFAULT '',
  `begin` time NULL,
  `end` time NULL,
  `dept` mediumint(8) NOT NULL DEFAULT '0',
  `mode` varchar(255) NOT NULL DEFAULT '',
  `host` varchar(30) NOT NULL DEFAULT '',
  `participant` text NULL,
  `date` date NULL,
  `room` int NOT NULL DEFAULT '0',
  `minutes` text NULL,
  `minutedBy` varchar(30) NOT NULL DEFAULT '',
  `minutedDate` datetime NULL,
  `objectType` varchar(30) NOT NULL DEFAULT '',
  `objectID` mediumint(8) NOT NULL DEFAULT '0',
  `createdBy` varchar(30) NOT NULL DEFAULT '',
  `createdDate` datetime NULL,
  `editedBy` varchar(30) NOT NULL DEFAULT '',
  `editedDate` datetime NULL,
  `deleted` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB CHARSET=utf8;

-- DROP TABLE IF EXISTS `zt_meetingroom`;
CREATE TABLE IF NOT EXISTS `zt_meetingroom` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL DEFAULT '',
  `position` varchar(30) NOT NULL DEFAULT '',
  `seats` int NOT NULL DEFAULT '0',
  `equipment` varchar(255) NOT NULL DEFAULT '',
  `openTime` varchar(255) NOT NULL DEFAULT '',
  `createdBy` varchar(30) NOT NULL DEFAULT '',
  `createdDate` datetime NULL,
  `editedBy` varchar(30) NOT NULL DEFAULT '',
  `editedDate` datetime NULL,
  `deleted` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB CHARSET=utf8;

-- DROP TABLE IF EXISTS `zt_assetlib`;
CREATE TABLE IF NOT EXISTS `zt_assetlib` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL DEFAULT '',
  `type` varchar(255) NOT NULL DEFAULT '',
  `desc` mediumtext NULL,
  `order` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
  `createdBy` varchar(30) NOT NULL DEFAULT '',
  `createdDate` datetime NULL,
  `editedBy` varchar(30) NOT NULL DEFAULT '',
  `editedDate` datetime NULL,
  `deleted` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB CHARSET=utf8;

-- DROP TABLE IF EXISTS `zt_meastemplate`;
CREATE TABLE IF NOT EXISTS `zt_meastemplate` (
  `id` mediumint(8) NOT NULL AUTO_INCREMENT,
  `model` char(30) NOT NULL DEFAULT '',
  `name` varchar(255) NOT NULL DEFAULT '',
  `content` mediumtext NULL,
  `createdBy` char(30) NOT NULL DEFAULT '',
  `createdDate` date NULL,
  `deleted` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `zt_programreport`;
CREATE TABLE IF NOT EXISTS `zt_programreport` (
  `id` mediumint(8) NOT NULL AUTO_INCREMENT,
  `template` mediumint(8) NOT NULL DEFAULT '0',
  `project` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `name` varchar(255) NOT NULL DEFAULT '',
  `params` text NULL,
  `content` text NULL,
  `createdBy` char(30) NOT NULL DEFAULT '',
  `createdDate` date NULL,
  `deleted` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `zt_measrecords`;
CREATE TABLE IF NOT EXISTS `zt_measrecords` (
  `id` mediumint(8) NOT NULL AUTO_INCREMENT,
  `type` varchar(30) NOT NULL DEFAULT '',
  `mid` mediumint(8) NOT NULL DEFAULT '0',
  `measCode` char(50) NOT NULL DEFAULT '',
  `project` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `product` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `execution` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `params` text NULL,
  `year` char(4) NOT NULL DEFAULT '',
  `month` char(6) NOT NULL DEFAULT '',
  `week` char(8) NOT NULL DEFAULT '',
  `day` char(8) NOT NULL DEFAULT '',
  `value` varchar(255) NOT NULL DEFAULT '',
  `date` date NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE INDEX `product` ON `zt_measrecords` (`product`);
CREATE INDEX `project` ON `zt_measrecords` (`project`);
CREATE UNIQUE INDEX `time` ON `zt_measrecords` (`year`, `month`, `day`, `week`);

-- DROP TABLE IF EXISTS `zt_object`;
CREATE TABLE IF NOT EXISTS `zt_object` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `project` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `product` mediumint(8) NOT NULL DEFAULT '0',
  `from` mediumint(8) NOT NULL DEFAULT '0',
  `title` varchar(255) NOT NULL DEFAULT '',
  `category` char(30) NOT NULL DEFAULT '',
  `version` varchar(255) NOT NULL DEFAULT '',
  `type` enum('reviewed','taged') NOT NULL DEFAULT 'reviewed',
  `enabled` enum('0','1') NOT NULL DEFAULT '1',
  `range` text NULL,
  `data` text NULL,
  `storyEst` char(30) NOT NULL DEFAULT '',
  `taskEst` char(30) NOT NULL DEFAULT '',
  `requestEst` char(30) NOT NULL DEFAULT '',
  `testEst` char(30) NOT NULL DEFAULT '',
  `devEst` char(30) NOT NULL DEFAULT '',
  `designEst` char(30) NOT NULL DEFAULT '',
  `end` date NULL,
  `createdBy` char(30) NOT NULL DEFAULT '',
  `createdDate` date NULL,
  `deleted` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `zt_review`;
CREATE TABLE IF NOT EXISTS `zt_review` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `project` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `title` varchar(255) NOT NULL DEFAULT '',
  `object` mediumint(8) NOT NULL DEFAULT '0',
  `template` mediumint(8) NOT NULL DEFAULT '0',
  `doc` varchar(255) NOT NULL DEFAULT '',
  `docVersion` varchar(255) NOT NULL DEFAULT '',
  `status` char(30) NOT NULL DEFAULT '',
  `reviewedBy` varchar(255) NOT NULL DEFAULT '',
  `auditedBy` varchar(255) NOT NULL DEFAULT '',
  `createdBy` char(30) NOT NULL DEFAULT '',
  `createdDate` date NULL,
  `begin` date NULL,
  `deadline` date NULL,
  `lastReviewedBy` varchar(255) NOT NULL DEFAULT '',
  `lastReviewedDate` date NULL,
  `lastAuditedBy` varchar(255) NOT NULL DEFAULT '',
  `lastAuditedDate` date NULL,
  `lastEditedBy` varchar(255) NOT NULL DEFAULT '',
  `lastEditedDate` date NULL,
  `result` char(30) NOT NULL DEFAULT '',
  `auditResult` char(30) NOT NULL DEFAULT '',
  `deleted` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=39 DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `zt_reviewcl`;
CREATE TABLE IF NOT EXISTS `zt_reviewcl` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `title` varchar(255) NOT NULL DEFAULT '',
  `object` char(30) NOT NULL DEFAULT '',
  `category` char(30) NOT NULL DEFAULT '',
  `type` varchar(255) NOT NULL DEFAULT '',
  `assignedTo` varchar(30) NOT NULL DEFAULT '',
  `order` mediumint(8) DEFAULT '0',
  `status` varchar(30) NOT NULL DEFAULT '',
  `createdBy` varchar(30) NOT NULL DEFAULT '',
  `createdDate` datetime NULL,
  `editedBy` varchar(30) NOT NULL DEFAULT '',
  `editedDate` datetime NULL,
  `assignedBy` varchar(30) NOT NULL DEFAULT '',
  `assignedDate` datetime NULL,
  `deleted` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `zt_reviewresult`;
CREATE TABLE IF NOT EXISTS `zt_reviewresult` (
  `id` mediumint(8) NOT NULL AUTO_INCREMENT,
  `review` mediumint(8) NOT NULL DEFAULT '0',
  `type` char(30) NOT NULL DEFAULT 'review',
  `result` char(30) NOT NULL DEFAULT '',
  `opinion` text NULL,
  `reviewer` char(30) NOT NULL DEFAULT '',
  `remainIssue` char(30) NOT NULL DEFAULT '',
  `createdDate` date NULL,
  `consumed` float NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE UNIQUE INDEX `reviewer` ON `zt_reviewresult`(`review`,`reviewer`,`type`);

-- DROP TABLE IF EXISTS `zt_reviewissue`;
CREATE TABLE IF NOT EXISTS `zt_reviewissue` (
  `id` mediumint(8) NOT NULL AUTO_INCREMENT,
  `project` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `review` mediumint(8) NOT NULL DEFAULT '0',
  `approval` mediumint(8) NOT NULL DEFAULT '0',
  `injection` mediumint(8) NOT NULL DEFAULT '0',
  `identify` mediumint(8) NOT NULL DEFAULT '0',
  `type` char(30) NOT NULL DEFAULT 'review',
  `listID` mediumint(8) NOT NULL DEFAULT '0',
  `title` varchar(255) NOT NULL DEFAULT '',
  `opinion` mediumtext NULL,
  `opinionDate` DATE NULL,
  `status` char(30) NOT NULL DEFAULT '',
  `resolution` char(30) NOT NULL DEFAULT '',
  `resolutionBy` CHAR(30) NOT NULL DEFAULT '',
  `resolutionDate` DATE NULL,
  `createdBy` char(30) NOT NULL DEFAULT '',
  `createdDate` date NULL,
  `deleted` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `zt_reviewlist`;
CREATE TABLE IF NOT EXISTS `zt_reviewlist` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `title` varchar(255) NOT NULL DEFAULT '',
  `object` char(30) NOT NULL DEFAULT '',
  `category` char(30) NOT NULL DEFAULT '',
  `assignedTo` varchar(30) NOT NULL DEFAULT '',
  `status` varchar(30) NOT NULL DEFAULT '',
  `createdBy` varchar(30) NOT NULL DEFAULT '',
  `createdDate` datetime NULL,
  `editedBy` varchar(30) NOT NULL DEFAULT '',
  `editedDate` datetime NULL,
  `assignedBy` varchar(30) NOT NULL DEFAULT '',
  `assignedDate` datetime NULL,
  `deleted` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `zt_cmcl`;
CREATE TABLE IF NOT EXISTS `zt_cmcl` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `type` char(30) NOT NULL DEFAULT '',
  `projectType` varchar(255) NOT NULL DEFAULT '',
  `title` int(11) NOT NULL DEFAULT '0',
  `contents` text NULL,
  `assignedTo` varchar(30) NOT NULL DEFAULT '',
  `status` varchar(30) NOT NULL DEFAULT '',
  `order` int(11) NOT NULL DEFAULT '0',
  `createdBy` varchar(30) NOT NULL DEFAULT '',
  `createdDate` datetime NULL,
  `editedBy` varchar(30) NOT NULL DEFAULT '',
  `editedDate` datetime NULL,
  `deleted` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `zt_solutions`;
CREATE TABLE IF NOT EXISTS `zt_solutions` (
 `id` mediumint(8) NOT NULL AUTO_INCREMENT,
 `project` mediumint(8) unsigned NOT NULL DEFAULT '0',
 `execution` mediumint(8) unsigned NOT NULL DEFAULT '0',
 `contents` text NOT NULL,
 `support` text NOT NULL,
 `measures` text NOT NULL,
 `type` char(30) NOT NULL DEFAULT '',
 `addedBy` varchar(30) NOT NULL DEFAULT '',
 `addedDate` date NULL,
 `editedBy` varchar(30) NOT NULL DEFAULT '',
 `editedDate` date NULL,
 `deleted` enum('0','1') NOT NULL DEFAULT '0',
 PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `zt_artifactrepo`;
CREATE TABLE `zt_artifactrepo` (
  `id` smallint(8) UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(45) NOT NULL DEFAULT '',
  `products` varchar(255) NOT NULL DEFAULT '',
  `serverID` smallint(8) NOT NULL DEFAULT 0,
  `repoName` varchar(45) NOT NULL DEFAULT '',
  `format` varchar(10) NOT NULL DEFAULT '',
  `type` char(7) NOT NULL DEFAULT '',
  `status` varchar(10) NOT NULL DEFAULT '',
  `createdBy` varchar(30) NOT NULL DEFAULT '',
  `createdDate` datetime NULL,
  `editedBy` varchar(30) NOT NULL DEFAULT '',
  `editedDate` datetime NULL,
  `deleted` tinyint(4) UNSIGNED NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `zt_measqueue`;
CREATE TABLE IF NOT EXISTS `zt_measqueue` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `type` varchar(30) NOT NULL DEFAULT '',
  `mid` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `status` varchar(255) NOT NULL DEFAULT '',
  `logs` text NULL,
  `execTime` varchar(10) NOT NULL DEFAULT '',
  `params` text NULL,
  `createdBy` varchar(30) NOT NULL DEFAULT '',
  `createdDate` datetime NULL,
  `updateDate` datetime NULL,
  `deleted` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `zt_issue`;
CREATE TABLE IF NOT EXISTS `zt_issue` (
  `id` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT,
  `resolvedBy` varchar(30) NOT NULL DEFAULT '',
  `project` varchar(255) NOT NULL DEFAULT '',
  `execution` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `title` varchar(255) NOT NULL DEFAULT '',
  `desc` mediumtext NULL,
  `pri` char(30) NOT NULL DEFAULT '',
  `severity` char(30) NOT NULL DEFAULT '',
  `type` char(30) NOT NULL DEFAULT '',
  `activity` varchar(255) NOT NULL DEFAULT '',
  `deadline` date NULL,
  `resolution` char(30) NOT NULL DEFAULT '',
  `resolutionComment` text NULL,
  `objectID` varchar(255) NOT NULL DEFAULT '',
  `resolvedDate` date NULL,
  `status` varchar(30) NOT NULL DEFAULT '',
  `owner` varchar(255) NOT NULL DEFAULT '',
  `lib` mediumint(8) unsigned NOT NULL default 0,
  `from` mediumint(8) unsigned NOT NULL default 0,
  `version` smallint(6) NOT NULL default 1,
  `createdBy` varchar(30) NOT NULL DEFAULT '',
  `createdDate` datetime NULL,
  `editedBy` varchar(30) NOT NULL DEFAULT '',
  `editedDate` datetime NULL,
  `activateBy` varchar(30) NOT NULL DEFAULT '',
  `activateDate` date NULL,
  `closedBy` varchar(30) NOT NULL DEFAULT '',
  `closedDate` date NULL,
  `assignedTo` varchar(30) NOT NULL DEFAULT '',
  `assignedBy` varchar(30) NOT NULL DEFAULT '',
  `assignedDate` datetime NULL,
  `approvedDate` date NULL,
  `deleted` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `zt_risk`;
CREATE TABLE IF NOT EXISTS `zt_risk` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `project` varchar(255) NOT NULL DEFAULT '',
  `execution` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `name` varchar(255) NOT NULL DEFAULT '',
  `source` char(30) NOT NULL DEFAULT '',
  `category` char(30) NOT NULL DEFAULT '',
  `strategy` char(30) NOT NULL DEFAULT '',
  `status` varchar(30) NOT NULL DEFAULT 'active',
  `impact` char(30) NOT NULL DEFAULT '',
  `probability` char(30) NOT NULL DEFAULT '',
  `rate` char(30) NOT NULL DEFAULT '',
  `pri` char(30) NOT NULL DEFAULT '',
  `identifiedDate` date NULL,
  `prevention` mediumtext NULL,
  `remedy` mediumtext NULL,
  `plannedClosedDate` date NULL,
  `actualClosedDate` date NULL,
  `lib` mediumint(8) unsigned NOT NULL default 0,
  `from` mediumint(8) unsigned NOT NULL default 0,
  `version` smallint(6) NOT NULL default 1,
  `createdBy` varchar(30) NOT NULL DEFAULT '',
  `createdDate` datetime NULL,
  `editedBy` varchar(30) NOT NULL DEFAULT '',
  `editedDate` datetime NULL,
  `resolution` mediumtext NULL,
  `resolvedBy` varchar(30) NOT NULL DEFAULT '',
  `activateBy` varchar(30) NOT NULL DEFAULT '',
  `activateDate` date NULL,
  `assignedTo` varchar(30) NOT NULL DEFAULT '',
  `closedBy` varchar(30) NOT NULL DEFAULT '',
  `closedDate` date NULL,
  `cancelBy` varchar(30) NOT NULL DEFAULT '',
  `cancelDate` date NULL,
  `cancelReason` char(30) NOT NULL DEFAULT '',
  `hangupBy` varchar(30) NOT NULL DEFAULT '',
  `hangupDate` date NULL,
  `trackedBy` varchar(30) NOT NULL DEFAULT '',
  `trackedDate` date NULL,
  `assignedDate` date NULL,
  `approvedDate` date NULL,
  `deleted` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `zt_riskissue`;
CREATE TABLE IF NOT EXISTS `zt_riskissue` (
  `risk` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `issue` mediumint(8) unsigned NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE UNIQUE INDEX `risk_issue` ON `zt_riskissue`(`risk`,`issue`);

-- DROP TABLE IF EXISTS `zt_opportunity`;
CREATE TABLE IF NOT EXISTS `zt_opportunity` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `project` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `execution` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `name` varchar(255) NOT NULL DEFAULT '',
  `source` char(30) NOT NULL DEFAULT '',
  `type` char(30) NOT NULL DEFAULT '',
  `strategy` char(30) NOT NULL DEFAULT '',
  `status` varchar(30) NOT NULL DEFAULT 'active',
  `impact` mediumint(8) NOT NULL DEFAULT '0',
  `chance` mediumint(8) NOT NULL DEFAULT '0',
  `ratio` mediumint(8) NOT NULL DEFAULT '0',
  `pri` char(30) NOT NULL DEFAULT '',
  `identifiedDate` date NULL,
  `assignedTo` varchar(30) NOT NULL DEFAULT '',
  `assignedDate` date NULL,
  `approvedDate` date NULL,
  `prevention` mediumtext NULL,
  `plannedClosedDate` date NULL,
  `actualClosedDate` date NULL,
  `lib` mediumint(8) unsigned NOT NULL default 0,
  `from` mediumint(8) unsigned NOT NULL default 0,
  `version` smallint(6) NOT NULL default 1,
  `createdBy` varchar(30) NOT NULL DEFAULT '',
  `createdDate` datetime NULL,
  `editedBy` varchar(30) NOT NULL DEFAULT '',
  `editedDate` datetime NULL,
  `activatedBy` varchar(30) NOT NULL DEFAULT '',
  `activatedDate` datetime NULL,
  `closedBy` varchar(30) NOT NULL DEFAULT '',
  `closedDate` datetime NULL,
  `canceledBy` varchar(30) NOT NULL DEFAULT '',
  `canceledDate` datetime NULL,
  `cancelReason` char(30) NOT NULL DEFAULT '',
  `hangupedBy` varchar(30) NOT NULL DEFAULT '',
  `hangupedDate` datetime NULL,
  `resolution` mediumtext NULL,
  `resolvedBy` varchar(30) NOT NULL DEFAULT '',
  `resolvedDate` datetime NULL,
  `lastCheckedBy` varchar(30) NOT NULL DEFAULT '',
  `lastCheckedDate` datetime NULL,
  `deleted` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `zt_trainplan`;
CREATE TABLE IF NOT EXISTS `zt_trainplan` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `project` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `name` varchar(255) NOT NULL DEFAULT '',
  `begin` date NULL,
  `end` date NULL,
  `place` varchar(255) NOT NULL DEFAULT '',
  `trainee` text NULL,
  `lecturer` varchar(20) NOT NULL DEFAULT '',
  `type` enum('inside','outside') NOT NULL DEFAULT 'inside',
  `status` varchar(20) NOT NULL DEFAULT '',
  `summary` mediumtext NULL,
  `createdBy` char(30) NOT NULL default '',
  `createdDate` datetime NULL,
  `editedBy` varchar(30) NOT NULL DEFAULT '',
  `editedDate` datetime NULL,
  `deleted` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `zt_gapanalysis`;
CREATE TABLE IF NOT EXISTS `zt_gapanalysis` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `project` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `account` varchar(30) NOT NULL DEFAULT '',
  `role` varchar(20) NOT NULL DEFAULT '',
  `analysis` mediumtext NULL,
  `needTrain` enum('no','yes') NOT NULL DEFAULT 'no',
  `createdBy` char(30) NOT NULL DEFAULT '',
  `createdDate` datetime NULL,
  `editedBy` varchar(30) NOT NULL DEFAULT '',
  `editedDate` datetime NULL,
  `deleted` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE UNIQUE INDEX `project_account` ON `zt_gapanalysis`(`project`,`account`);

-- DROP TABLE IF EXISTS `zt_scene`;
CREATE TABLE `zt_scene` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `product` mediumint(8) unsigned NOT NULL DEFAULT 0,
  `branch` mediumint(8) unsigned NOT NULL DEFAULT 0,
  `module` mediumint(8) unsigned NOT NULL DEFAULT 0,
  `title` varchar(255) NOT NULL DEFAULT '',
  `sort` int(11) unsigned NOT NULL DEFAULT 0,
  `openedBy` char(30) NOT NULL DEFAULT '',
  `openedDate` datetime NULL,
  `lastEditedBy` char(30) NOT NULL DEFAULT '',
  `lastEditedDate` datetime NULL,
  `deleted` enum('0','1') NOT NULL DEFAULT '0',
  `parent` int(11) NOT NULL DEFAULT '0',
  `grade` tinyint(3) NOT NULL DEFAULT '0',
  `path` varchar(1000) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

REPLACE INTO `zt_approvalflow` (`id`, `name`, `code`, `desc`, `version`, `createdBy`, `createdDate`, `workflow`, `deleted`) VALUES
(1, '最简审批', 'simple', '', 1, 'admin', '2022-04-29 08:46:40', '', 0);

REPLACE INTO `zt_approvalflowspec` (`id`, `flow`, `version`, `nodes`, `createdBy`, `createdDate`) VALUES
(1, 1, 1, '[{\"type\":\"start\",\"ccs\":[]},{\"id\":\"3ewcj92p55e\",\"type\":\"approval\",\"title\":\"审批\",\"reviewType\":\"manual\",\"multiple\":\"and\",\"agentType\":\"pass\",\"reviewers\":[{\"type\":\"select\"}],\"ccs\":[]},{\"type\":\"end\",\"ccs\":[]}]', 'admin', '2022-04-29 08:46:40');

REPLACE INTO `zt_lang` (`lang`, `module`, `section`, `key`, `value`, `system`) VALUES
('all', 'process', 'classify', 'support', '支持过程', '1'),
('all', 'process', 'classify', 'engineering', '工程支持', '1'),
('all', 'process', 'classify', 'project', '项目管理', '1'),
('all', 'process', 'scrumClassify', 'support', '支持过程', '1'),
('all', 'process', 'scrumClassify', 'engineering', '工程支持', '1'),
('all', 'process', 'scrumClassify', 'project', '项目管理', '1'),
('all', 'process', 'agileplusClassify', 'support', '支持过程', '1'),
('all', 'process', 'agileplusClassify', 'engineering', '工程支持', '1'),
('all', 'process', 'agileplusClassify', 'project', '项目管理', '1'),
('all', 'process', 'waterfallplusClassify', 'support', '支持过程', '1'),
('all', 'process', 'waterfallplusClassify', 'engineering', '工程支持', '1'),
('all', 'process', 'waterfallplusClassify', 'project', '项目管理', '1');

REPLACE INTO `zt_process` (`id`, `model`, `name`, `type`, `abbr`, `desc`, `assignedTo`, `status`, `order`, `createdBy`, `createdDate`, `editedBy`, `editedDate`, `assignedBy`, `assignedDate`, `deleted`) VALUES
(11, 'waterfall', '立项管理', 'project', 'PIM', '', '', '', 55, 'admin', '2020-01-09 10:29:55', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(12, 'waterfall', '项目规划', 'project', 'PP', '', '', '', 60, 'admin', '2020-01-09 10:31:16', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(13, 'waterfall', '项目监控', 'project', 'PMC', '', '', '', 65, 'admin', '2020-01-09 10:31:16', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(14, 'waterfall', '风险管理', 'project', 'RSKM', '', '', '', 70, 'admin', '2020-01-09 10:31:16', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(15, 'waterfall', '结项管理', 'project', 'PCM', '', '', '', 75, 'admin', '2020-01-09 10:31:16', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(16, 'waterfall', '量化项目管理', 'project', 'QPM', '', '', '', 80, 'admin', '2020-01-09 10:31:16', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(17, 'waterfall', '需求开发', 'engineering', 'RDM', '', '', '', 85, 'admin', '2020-01-09 13:14:55', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(18, 'waterfall', '设计开发', 'engineering', '', '', '', '', 90, 'admin', '2020-01-09 13:14:55', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(19, 'waterfall', '实现与测试', 'engineering', 'EMBEDDED', '', '', '', 95, 'admin', '2020-01-09 13:14:55', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(20, 'waterfall', '系统测试', 'engineering', 'ST', '', '', '', 100, 'admin', '2020-01-09 13:14:55', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(21, 'waterfall', '客户验收', 'engineering', 'CA', '', '', '', 105, 'admin', '2020-01-09 13:14:55', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(22, 'waterfall', '质量保证', 'support', 'QA', '', '', '', 110, 'admin', '2020-01-09 13:14:55', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(23, 'waterfall', '配置管理', 'support', 'CM', '', '', '', 115, 'admin', '2020-01-09 13:14:55', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(24, 'waterfall', '度量分析', 'support', 'MA', '', '', '', 120, 'admin', '2020-01-09 13:14:55', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(25, 'waterfall', '原因分析与解决', 'support', 'CAR', '', '', '', 125, 'admin', '2020-01-09 13:14:55', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(26, 'waterfall', '决策分析', 'support', 'DAR', '', '', '', 130, 'admin', '2020-01-09 13:14:55', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(27, 'scrum', '立项管理', 'project', 'PIM', '', '', '', 55, 'admin', '2020-01-09 10:29:55', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(28, 'scrum', '项目规划', 'project', 'PP', '', '', '', 60, 'admin', '2020-01-09 10:31:16', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(29, 'scrum', '项目监控', 'project', 'PMC', '', '', '', 65, 'admin', '2020-01-09 10:31:16', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(30, 'scrum', '风险管理', 'project', 'RSKM', '', '', '', 70, 'admin', '2020-01-09 10:31:16', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(31, 'scrum', '结项管理', 'project', 'PCM', '', '', '', 75, 'admin', '2020-01-09 10:31:16', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(32, 'scrum', '量化项目管理', 'project', 'QPM', '', '', '', 80, 'admin', '2020-01-09 10:31:16', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(33, 'scrum', '需求开发', 'engineering', 'RDM', '', '', '', 85, 'admin', '2020-01-09 13:14:55', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(34, 'scrum', '设计开发', 'engineering', '', '', '', '', 90, 'admin', '2020-01-09 13:14:55', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(35, 'scrum', '实现与测试', 'engineering', 'EMBEDDED', '', '', '', 95, 'admin', '2020-01-09 13:14:55', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(36, 'scrum', '系统测试', 'engineering', 'ST', '', '', '', 100, 'admin', '2020-01-09 13:14:55', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(37, 'scrum', '客户验收', 'engineering', 'CA', '', '', '', 105, 'admin', '2020-01-09 13:14:55', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(38, 'scrum', '质量保证', 'support', 'QA', '', '', '', 110, 'admin', '2020-01-09 13:14:55', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(39, 'scrum', '配置管理', 'support', 'CM', '', '', '', 115, 'admin', '2020-01-09 13:14:55', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(40, 'scrum', '度量分析', 'support', 'MA', '', '', '', 120, 'admin', '2020-01-09 13:14:55', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(41, 'scrum', '原因分析与解决', 'support', 'CAR', '', '', '', 125, 'admin', '2020-01-09 13:14:55', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(42, 'scrum', '决策分析', 'support', 'DAR', '', '', '', 130, 'admin', '2020-01-09 13:14:55', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(43, 'waterfallplus', '立项管理', 'project', 'PIM', '', '', '', 55, 'admin', '2020-01-09 10:29:55', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(44, 'waterfallplus', '项目规划', 'project', 'PP', '', '', '', 60, 'admin', '2020-01-09 10:31:16', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(45, 'waterfallplus', '项目监控', 'project', 'PMC', '', '', '', 65, 'admin', '2020-01-09 10:31:16', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(46, 'waterfallplus', '风险管理', 'project', 'RSKM', '', '', '', 70, 'admin', '2020-01-09 10:31:16', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(47, 'waterfallplus', '结项管理', 'project', 'PCM', '', '', '', 75, 'admin', '2020-01-09 10:31:16', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(48, 'waterfallplus', '量化项目管理', 'project', 'QPM', '', '', '', 80, 'admin', '2020-01-09 10:31:16', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(49, 'waterfallplus', '需求开发', 'engineering', 'RDM', '', '', '', 85, 'admin', '2020-01-09 13:14:55', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(50, 'waterfallplus', '设计开发', 'engineering', '', '', '', '', 90, 'admin', '2020-01-09 13:14:55', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(51, 'waterfallplus', '实现与测试', 'engineering', 'EMBEDDED', '', '', '', 95, 'admin', '2020-01-09 13:14:55', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(52, 'waterfallplus', '系统测试', 'engineering', 'ST', '', '', '', 100, 'admin', '2020-01-09 13:14:55', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(53, 'waterfallplus', '客户验收', 'engineering', 'CA', '', '', '', 105, 'admin', '2020-01-09 13:14:55', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(54, 'waterfallplus', '质量保证', 'support', 'QA', '', '', '', 110, 'admin', '2020-01-09 13:14:55', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(55, 'waterfallplus', '配置管理', 'support', 'CM', '', '', '', 115, 'admin', '2020-01-09 13:14:55', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(56, 'waterfallplus', '度量分析', 'support', 'MA', '', '', '', 120, 'admin', '2020-01-09 13:14:55', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(57, 'waterfallplus', '原因分析与解决', 'support', 'CAR', '', '', '', 125, 'admin', '2020-01-09 13:14:55', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(58, 'waterfallplus', '决策分析', 'support', 'DAR', '', '', '', 130, 'admin', '2020-01-09 13:14:55', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(59, 'agileplus', '立项管理', 'project', 'PIM', '', '', '', 55, 'admin', '2020-01-09 10:29:55', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(60, 'agileplus', '项目规划', 'project', 'PP', '', '', '', 60, 'admin', '2020-01-09 10:31:16', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(61, 'agileplus', '项目监控', 'project', 'PMC', '', '', '', 65, 'admin', '2020-01-09 10:31:16', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(62, 'agileplus', '风险管理', 'project', 'RSKM', '', '', '', 70, 'admin', '2020-01-09 10:31:16', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(63, 'agileplus', '结项管理', 'project', 'PCM', '', '', '', 75, 'admin', '2020-01-09 10:31:16', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(64, 'agileplus', '量化项目管理', 'project', 'QPM', '', '', '', 80, 'admin', '2020-01-09 10:31:16', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(65, 'agileplus', '需求开发', 'engineering', 'RDM', '', '', '', 85, 'admin', '2020-01-09 13:14:55', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(66, 'agileplus', '设计开发', 'engineering', '', '', '', '', 90, 'admin', '2020-01-09 13:14:55', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(67, 'agileplus', '实现与测试', 'engineering', 'EMBEDDED', '', '', '', 95, 'admin', '2020-01-09 13:14:55', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(68, 'agileplus', '系统测试', 'engineering', 'ST', '', '', '', 100, 'admin', '2020-01-09 13:14:55', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(69, 'agileplus', '客户验收', 'engineering', 'CA', '', '', '', 105, 'admin', '2020-01-09 13:14:55', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(70, 'agileplus', '质量保证', 'support', 'QA', '', '', '', 110, 'admin', '2020-01-09 13:14:55', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(71, 'agileplus', '配置管理', 'support', 'CM', '', '', '', 115, 'admin', '2020-01-09 13:14:55', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(72, 'agileplus', '度量分析', 'support', 'MA', '', '', '', 120, 'admin', '2020-01-09 13:14:55', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(73, 'agileplus', '原因分析与解决', 'support', 'CAR', '', '', '', 125, 'admin', '2020-01-09 13:14:55', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0'),
(74, 'agileplus', '决策分析', 'support', 'DAR', '', '', '', 130, 'admin', '2020-01-09 13:14:55', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', '0');

REPLACE INTO `zt_activity` (`id`, `process`, `name`, `optional`, `tailorNorm`, `content`, `assignedTo`, `status`, `createdBy`, `createdDate`, `editedBy`, `editedDate`, `assignedBy`, `assignedDate`, `order`, `deleted`) VALUES
(4, 11, '立项调查，可行性分析，技术预研', 'yes', '', '', '', '', 'admin', '2020-01-09 10:49:34', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 20, '0'),
(5, 11, '项目预算', 'yes', '', '', '', '', 'admin', '2020-01-09 10:49:34', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 25, '0'),
(6, 11, '立项决策', 'yes', '', '', '', '', 'admin', '2020-01-09 10:49:34', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 30, '0'),
(7, 11, '投标/商务洽谈', 'no', '', '', '', '', 'admin', '2020-01-09 10:49:34', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 35, '0'),
(8, 12, '估算', 'yes', '', '', '', '', 'admin', '2020-01-09 11:12:17', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 40, '0'),
(9, 12, '裁剪', 'yes', '', '', '', '', 'admin', '2020-01-09 11:12:17', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 45, '0'),
(10, 12, '制定项目计划及下属计划', 'yes', '', '', '', '', 'admin', '2020-01-09 11:12:17', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 50, '0'),
(11, 12, '评审项目计划及下属计划', 'yes', '', '', '', '', 'admin', '2020-01-09 11:12:17', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 55, '0'),
(12, 13, '日常跟踪', 'yes', '', '', '', '', 'admin', '2020-01-09 11:13:37', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 60, '0'),
(13, 13, '举行周例会', 'yes', '', '', '', '', 'admin', '2020-01-09 11:13:37', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 65, '0'),
(14, 13, '里程碑评审', 'yes', '', '', '', '', 'admin', '2020-01-09 11:13:37', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 70, '0'),
(15, 13, '采取纠正措施', 'no', '', '', '', '', 'admin', '2020-01-09 11:13:37', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 75, '0'),
(16, 14, '制定风险管理计划', 'yes', '', '', '', '', 'admin', '2020-01-09 11:15:04', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 80, '0'),
(17, 14, '风险识别', 'yes', '', '', '', '', 'admin', '2020-01-09 11:15:04', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 85, '0'),
(18, 14, '风险分析', 'yes', '', '', '', '', 'admin', '2020-01-09 11:15:04', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 90, '0'),
(19, 14, '风险规避和缓解', 'yes', '', '', '', '', 'admin', '2020-01-09 11:15:04', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 95, '0'),
(20, 14, '风险跟踪', 'yes', '', '', '', '', 'admin', '2020-01-09 11:15:04', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 100, '0'),
(21, 14, '更新组织级“风险列表库”', 'no', '', '', '', '', 'admin', '2020-01-09 11:15:04', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 105, '0'),
(22, 15, '结项准备', 'no', '', '', '', '', 'admin', '2020-01-09 11:16:16', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 110, '0'),
(23, 15, '结项申请', 'yes', '', '', '', '', 'admin', '2020-01-09 11:16:16', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 115, '0'),
(24, 15, '结项评审', 'yes', '', '', '', '', 'admin', '2020-01-09 11:16:16', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 120, '0'),
(25, 15, '资料纳入组织级过程资产库', 'yes', '', '', '', '', 'admin', '2020-01-09 11:16:16', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 125, '0'),
(26, 16, '量化项目管理', 'yes', '', '', '', '', 'admin', '2020-01-09 11:16:34', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 130, '0'),
(27, 17, '用户需求获取', 'yes', '', '', '', '', 'admin', '2020-01-09 13:25:22', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 135, '0'),
(28, 17, '用户需求评审', 'yes', '', '', '', '', 'admin', '2020-01-09 13:25:22', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 140, '0'),
(29, 17, '产品需求定义', 'yes', '', '', '', '', 'admin', '2020-01-09 13:25:22', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 145, '0'),
(30, 17, '产品需求评审', 'yes', '', '', '', '', 'admin', '2020-01-09 13:25:22', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 150, '0'),
(31, 17, '需求变更控制', 'no', '', '未涉及变更时可不进行', '', '', 'admin', '2020-01-09 13:25:22', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 155, '0'),
(32, 18, '概要设计', '', '', '', '', '', 'admin', '2020-01-09 13:26:07', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 160, '0'),
(33, 18, '评审《概要设计说明书》', '', '', '', '', '', 'admin', '2020-01-09 13:26:07', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 165, '0'),
(34, 18, '详细设计', '', '', '', '', '', 'admin', '2020-01-09 13:26:07', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 170, '0'),
(35, 18, '评审详细设计工作产品', '', '', '', '', '', 'admin', '2020-01-09 13:26:07', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 175, '0'),
(42, 19, '制定编码阶段计划', '', '', '', '', '', 'admin', '2020-01-09 13:27:57', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 210, '0'),
(43, 19, '构建数据库', '', '', '', '', '', 'admin', '2020-01-09 13:27:57', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 215, '0'),
(44, 19, '编码实现', '', '', '', '', '', 'admin', '2020-01-09 13:27:57', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 220, '0'),
(45, 19, '代码检查', '', '', '', '', '', 'admin', '2020-01-09 13:27:57', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 225, '0'),
(46, 19, '单元测试', '', '', '', '', '', 'admin', '2020-01-09 13:27:57', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 230, '0'),
(47, 19, '交叉单元测试', '', '', '', '', '', 'admin', '2020-01-09 13:27:57', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 235, '0'),
(48, 19, '系统集成', '', '', '', '', '', 'admin', '2020-01-09 13:27:57', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 240, '0'),
(49, 19, '编写集成测试用例', '', '', '', '', '', 'admin', '2020-01-09 13:27:57', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 245, '0'),
(50, 19, '评审集成测试用例', '', '', '', '', '', 'admin', '2020-01-09 13:27:57', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 250, '0'),
(51, 19, '集成测试', '', '', '', '', '', 'admin', '2020-01-09 13:27:57', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 255, '0'),
(52, 19, '缺陷管理', '', '', '', '', '', 'admin', '2020-01-09 13:27:57', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 260, '0'),
(53, 19, '编写支持文档', '', '', '', '', '', 'admin', '2020-01-09 13:27:57', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 265, '0'),
(54, 20, '制定《系统测试计划》', '', '', '', '', '', 'admin', '2020-01-09 13:28:25', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 270, '0'),
(55, 20, '评审《系统测试计划》', '', '', '', '', '', 'admin', '2020-01-09 13:28:25', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 275, '0'),
(56, 20, '编写《系统测试用例》', '', '', '', '', '', 'admin', '2020-01-09 13:28:25', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 280, '0'),
(57, 20, '评审《系统测试用例》', '', '', '', '', '', 'admin', '2020-01-09 13:28:25', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 285, '0'),
(58, 20, '执行系统测试', '', '', '', '', '', 'admin', '2020-01-09 13:28:25', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 290, '0'),
(59, 21, '验收准备', '', '', '', '', '', 'admin', '2020-01-09 13:29:28', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 295, '0'),
(60, 21, '产品打包', '', '', '', '', '', 'admin', '2020-01-09 13:29:28', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 300, '0'),
(61, 21, '内部培训', '', '', '', '', '', 'admin', '2020-01-09 13:29:28', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 305, '0'),
(62, 21, '现场安装调试', '', '', '', '', '', 'admin', '2020-01-09 13:29:28', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 310, '0'),
(63, 21, '用户使用培训', '', '', '', '', '', 'admin', '2020-01-09 13:29:28', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 315, '0'),
(64, 21, '试运行', '', '', '', '', '', 'admin', '2020-01-09 13:29:28', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 320, '0'),
(65, 21, '客户验收', '', '', '', '', '', 'admin', '2020-01-09 13:29:28', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 325, '0'),
(66, 22, '制定质量保证计划', '', '', '', '', '', 'admin', '2020-01-09 13:38:58', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 330, '0'),
(67, 22, '评审质量保证计划', '', '', '', '', '', 'admin', '2020-01-09 13:38:58', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 335, '0'),
(68, 22, '过程和产品质量检查', '', '', '', '', '', 'admin', '2020-01-09 13:38:58', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 340, '0'),
(69, 22, '问题跟踪处理', '', '', '', '', '', 'admin', '2020-01-09 13:38:58', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 345, '0'),
(70, 22, '质量保证总结报告', '', '', '', '', '', 'admin', '2020-01-09 13:38:58', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 350, '0'),
(71, 23, '组织及配置管理员移交工作', '', '', '', '', '', 'admin', '2020-01-09 13:39:25', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 355, '0'),
(72, 23, '制定《配置管理计划》', '', '', '', '', '', 'admin', '2020-01-09 13:39:25', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 360, '0'),
(73, 23, '建立和维护配置库', '', '', '', '', '', 'admin', '2020-01-09 13:39:25', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 365, '0'),
(74, 23, '配置项管理', '', '', '', '', '', 'admin', '2020-01-09 13:39:25', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 370, '0'),
(75, 23, '基线管理', '', '', '', '', '', 'admin', '2020-01-09 13:39:25', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 375, '0'),
(76, 23, '变更管理', '', '', '', '', '', 'admin', '2020-01-09 13:39:25', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 380, '0'),
(77, 23, '配置审计', '', '', '', '', '', 'admin', '2020-01-09 13:39:25', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 385, '0'),
(78, 24, '建立项目度量目标', '', '', '', '', '', 'admin', '2020-01-09 13:40:05', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 390, '0'),
(79, 24, '确定项目度量点', '', '', '', '', '', 'admin', '2020-01-09 13:40:05', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 395, '0'),
(80, 24, '制定度量分析计划', '', '', '', '', '', 'admin', '2020-01-09 13:40:05', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 400, '0'),
(81, 24, '收集和分析度量数据', '', '', '', '', '', 'admin', '2020-01-09 13:40:05', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 405, '0'),
(82, 24, '存储和通报度量分析结果', '', '', '', '', '', 'admin', '2020-01-09 13:40:05', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 410, '0'),
(83, 25, '原因分析与解决', '', '', '', '', '', 'admin', '2020-01-09 13:40:15', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 415, '0'),
(84, 26, '建立评估标准', '', '', '', '', '', 'admin', '2020-01-09 13:40:35', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 420, '0'),
(85, 26, '确定候选方案', '', '', '', '', '', 'admin', '2020-01-09 13:40:35', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 425, '0'),
(86, 26, '原因分析与解决', '', '', '', '', '', 'admin', '2020-01-09 13:40:35', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 430, '0'),
(87, 26, '确定评估方法', '', '', '', '', '', 'admin', '2020-01-09 13:40:35', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 435, '0'),
(88, 26, '评估候选方案', '', '', '', '', '', 'admin', '2020-01-09 13:40:35', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 440, '0'),
(89, 26, '做出决策', '', '', '', '', '', 'admin', '2020-01-09 13:40:35', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 445, '0'),
(90, 27, '立项调查，可行性分析，技术预研', 'yes', '', '', '', '', 'admin', '2020-01-09 10:49:34', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 20, '0'),
(91, 27, '项目预算', 'yes', '', '', '', '', 'admin', '2020-01-09 10:49:34', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 25, '0'),
(92, 27, '立项决策', 'yes', '', '', '', '', 'admin', '2020-01-09 10:49:34', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 30, '0'),
(93, 27, '投标/商务洽谈', 'no', '', '', '', '', 'admin', '2020-01-09 10:49:34', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 35, '0'),
(94, 28, '估算', 'yes', '', '', '', '', 'admin', '2020-01-09 11:12:17', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 40, '0'),
(95, 28, '裁剪', 'yes', '', '', '', '', 'admin', '2020-01-09 11:12:17', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 45, '0'),
(96, 28, '制定项目计划及下属计划', 'yes', '', '', '', '', 'admin', '2020-01-09 11:12:17', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 50, '0'),
(97, 28, '评审项目计划及下属计划', 'yes', '', '', '', '', 'admin', '2020-01-09 11:12:17', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 55, '0'),
(98, 29, '日常跟踪', 'yes', '', '', '', '', 'admin', '2020-01-09 11:13:37', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 60, '0'),
(99, 29, '举行周例会', 'yes', '', '', '', '', 'admin', '2020-01-09 11:13:37', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 65, '0'),
(100, 29, '里程碑评审', 'yes', '', '', '', '', 'admin', '2020-01-09 11:13:37', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 70, '0'),
(101, 29, '采取纠正措施', 'no', '', '', '', '', 'admin', '2020-01-09 11:13:37', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 75, '0'),
(102, 30, '制定风险管理计划', 'yes', '', '', '', '', 'admin', '2020-01-09 11:15:04', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 80, '0'),
(103, 30, '风险识别', 'yes', '', '', '', '', 'admin', '2020-01-09 11:15:04', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 85, '0'),
(104, 30, '风险分析', 'yes', '', '', '', '', 'admin', '2020-01-09 11:15:04', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 90, '0'),
(105, 30, '风险规避和缓解', 'yes', '', '', '', '', 'admin', '2020-01-09 11:15:04', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 95, '0'),
(106, 30, '风险跟踪', 'yes', '', '', '', '', 'admin', '2020-01-09 11:15:04', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 100, '0'),
(107, 30, '更新组织级“风险列表库”', 'no', '', '', '', '', 'admin', '2020-01-09 11:15:04', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 105, '0'),
(108, 31, '结项准备', 'no', '', '', '', '', 'admin', '2020-01-09 11:16:16', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 110, '0'),
(109, 31, '结项申请', 'yes', '', '', '', '', 'admin', '2020-01-09 11:16:16', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 115, '0'),
(110, 31, '结项评审', 'yes', '', '', '', '', 'admin', '2020-01-09 11:16:16', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 120, '0'),
(111, 31, '资料纳入组织级过程资产库', 'yes', '', '', '', '', 'admin', '2020-01-09 11:16:16', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 125, '0'),
(112, 32, '量化项目管理', 'yes', '', '', '', '', 'admin', '2020-01-09 11:16:34', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 130, '0'),
(113, 33, '用户需求获取', 'yes', '', '', '', '', 'admin', '2020-01-09 13:25:22', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 135, '0'),
(114, 33, '用户需求评审', 'yes', '', '', '', '', 'admin', '2020-01-09 13:25:22', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 140, '0'),
(115, 33, '产品需求定义', 'yes', '', '', '', '', 'admin', '2020-01-09 13:25:22', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 145, '0'),
(116, 33, '产品需求评审', 'yes', '', '', '', '', 'admin', '2020-01-09 13:25:22', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 150, '0'),
(117, 33, '需求变更控制', 'no', '', '未涉及变更时可不进行', '', '', 'admin', '2020-01-09 13:25:22', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 155, '0'),
(118, 34, '概要设计', '', '', '', '', '', 'admin', '2020-01-09 13:26:07', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 160, '0'),
(119, 34, '评审《概要设计说明书》', '', '', '', '', '', 'admin', '2020-01-09 13:26:07', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 165, '0'),
(120, 34, '详细设计', '', '', '', '', '', 'admin', '2020-01-09 13:26:07', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 170, '0'),
(121, 34, '评审详细设计工作产品', '', '', '', '', '', 'admin', '2020-01-09 13:26:07', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 175, '0'),
(122, 35, '制定编码阶段计划', '', '', '', '', '', 'admin', '2020-01-09 13:27:57', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 210, '0'),
(123, 35, '构建数据库', '', '', '', '', '', 'admin', '2020-01-09 13:27:57', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 215, '0'),
(124, 35, '编码实现', '', '', '', '', '', 'admin', '2020-01-09 13:27:57', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 220, '0'),
(125, 35, '代码检查', '', '', '', '', '', 'admin', '2020-01-09 13:27:57', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 225, '0'),
(126, 35, '单元测试', '', '', '', '', '', 'admin', '2020-01-09 13:27:57', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 230, '0'),
(127, 35, '交叉单元测试', '', '', '', '', '', 'admin', '2020-01-09 13:27:57', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 235, '0'),
(128, 35, '系统集成', '', '', '', '', '', 'admin', '2020-01-09 13:27:57', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 240, '0'),
(129, 35, '编写集成测试用例', '', '', '', '', '', 'admin', '2020-01-09 13:27:57', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 245, '0'),
(130, 35, '评审集成测试用例', '', '', '', '', '', 'admin', '2020-01-09 13:27:57', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 250, '0'),
(131, 35, '集成测试', '', '', '', '', '', 'admin', '2020-01-09 13:27:57', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 255, '0'),
(132, 35, '缺陷管理', '', '', '', '', '', 'admin', '2020-01-09 13:27:57', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 260, '0'),
(133, 35, '编写支持文档', '', '', '', '', '', 'admin', '2020-01-09 13:27:57', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 265, '0'),
(134, 36, '制定《系统测试计划》', '', '', '', '', '', 'admin', '2020-01-09 13:28:25', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 270, '0'),
(135, 36, '评审《系统测试计划》', '', '', '', '', '', 'admin', '2020-01-09 13:28:25', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 275, '0'),
(136, 36, '编写《系统测试用例》', '', '', '', '', '', 'admin', '2020-01-09 13:28:25', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 280, '0'),
(137, 36, '评审《系统测试用例》', '', '', '', '', '', 'admin', '2020-01-09 13:28:25', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 285, '0'),
(138, 36, '执行系统测试', '', '', '', '', '', 'admin', '2020-01-09 13:28:25', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 290, '0'),
(139, 37, '验收准备', '', '', '', '', '', 'admin', '2020-01-09 13:29:28', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 295, '0'),
(140, 37, '产品打包', '', '', '', '', '', 'admin', '2020-01-09 13:29:28', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 300, '0'),
(141, 37, '内部培训', '', '', '', '', '', 'admin', '2020-01-09 13:29:28', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 305, '0'),
(142, 37, '现场安装调试', '', '', '', '', '', 'admin', '2020-01-09 13:29:28', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 310, '0'),
(143, 37, '用户使用培训', '', '', '', '', '', 'admin', '2020-01-09 13:29:28', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 315, '0'),
(144, 37, '试运行', '', '', '', '', '', 'admin', '2020-01-09 13:29:28', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 320, '0'),
(145, 37, '客户验收', '', '', '', '', '', 'admin', '2020-01-09 13:29:28', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 325, '0'),
(146, 38, '制定质量保证计划', '', '', '', '', '', 'admin', '2020-01-09 13:38:58', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 330, '0'),
(147, 38, '评审质量保证计划', '', '', '', '', '', 'admin', '2020-01-09 13:38:58', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 335, '0'),
(148, 38, '过程和产品质量检查', '', '', '', '', '', 'admin', '2020-01-09 13:38:58', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 340, '0'),
(149, 38, '问题跟踪处理', '', '', '', '', '', 'admin', '2020-01-09 13:38:58', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 345, '0'),
(150, 38, '质量保证总结报告', '', '', '', '', '', 'admin', '2020-01-09 13:38:58', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 350, '0'),
(151, 39, '组织及配置管理员移交工作', '', '', '', '', '', 'admin', '2020-01-09 13:39:25', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 355, '0'),
(152, 39, '制定《配置管理计划》', '', '', '', '', '', 'admin', '2020-01-09 13:39:25', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 360, '0'),
(153, 39, '建立和维护配置库', '', '', '', '', '', 'admin', '2020-01-09 13:39:25', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 365, '0'),
(154, 39, '配置项管理', '', '', '', '', '', 'admin', '2020-01-09 13:39:25', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 370, '0'),
(155, 39, '基线管理', '', '', '', '', '', 'admin', '2020-01-09 13:39:25', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 375, '0'),
(156, 39, '变更管理', '', '', '', '', '', 'admin', '2020-01-09 13:39:25', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 380, '0'),
(157, 39, '配置审计', '', '', '', '', '', 'admin', '2020-01-09 13:39:25', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 385, '0'),
(158, 40, '建立项目度量目标', '', '', '', '', '', 'admin', '2020-01-09 13:40:05', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 390, '0'),
(159, 40, '确定项目度量点', '', '', '', '', '', 'admin', '2020-01-09 13:40:05', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 395, '0'),
(160, 40, '制定度量分析计划', '', '', '', '', '', 'admin', '2020-01-09 13:40:05', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 400, '0'),
(161, 40, '收集和分析度量数据', '', '', '', '', '', 'admin', '2020-01-09 13:40:05', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 405, '0'),
(162, 40, '存储和通报度量分析结果', '', '', '', '', '', 'admin', '2020-01-09 13:40:05', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 410, '0'),
(163, 41, '原因分析与解决', '', '', '', '', '', 'admin', '2020-01-09 13:40:15', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 415, '0'),
(164, 42, '建立评估标准', '', '', '', '', '', 'admin', '2020-01-09 13:40:35', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 420, '0'),
(165, 42, '确定候选方案', '', '', '', '', '', 'admin', '2020-01-09 13:40:35', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 425, '0'),
(166, 42, '原因分析与解决', '', '', '', '', '', 'admin', '2020-01-09 13:40:35', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 430, '0'),
(167, 42, '确定评估方法', '', '', '', '', '', 'admin', '2020-01-09 13:40:35', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 435, '0'),
(168, 42, '评估候选方案', '', '', '', '', '', 'admin', '2020-01-09 13:40:35', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 440, '0'),
(169, 42, '做出决策', '', '', '', '', '', 'admin', '2020-01-09 13:40:35', '', '1970-01-01 00:00:01', '', '1970-01-01 00:00:01', 445, '0'),
(170, 43, '立项调查，可行性分析，技术预研', 'yes', '', '', '', '', 'admin', '2020-01-09 10:49:34', '', NULL, '', NULL, 20, '0'),
(171, 43, '项目预算', 'yes', '', '', '', '', 'admin', '2020-01-09 10:49:34', '', NULL, '', NULL, 25, '0'),
(172, 43, '立项决策', 'yes', '', '', '', '', 'admin', '2020-01-09 10:49:34', '', NULL, '', NULL, 30, '0'),
(173, 43, '投标/商务洽谈', 'no', '', '', '', '', 'admin', '2020-01-09 10:49:34', '', NULL, '', NULL, 35, '0'),
(174, 44, '估算', 'yes', '', '', '', '', 'admin', '2020-01-09 11:12:17', '', NULL, '', NULL, 40, '0'),
(175, 44, '裁剪', 'yes', '', '', '', '', 'admin', '2020-01-09 11:12:17', '', NULL, '', NULL, 45, '0'),
(176, 44, '制定项目计划及下属计划', 'yes', '', '', '', '', 'admin', '2020-01-09 11:12:17', '', NULL, '', NULL, 50, '0'),
(177, 44, '评审项目计划及下属计划', 'yes', '', '', '', '', 'admin', '2020-01-09 11:12:17', '', NULL, '', NULL, 55, '0'),
(178, 45, '日常跟踪', 'yes', '', '', '', '', 'admin', '2020-01-09 11:13:37', '', NULL, '', NULL, 60, '0'),
(179, 45, '举行周例会', 'yes', '', '', '', '', 'admin', '2020-01-09 11:13:37', '', NULL, '', NULL, 65, '0'),
(180, 45, '里程碑评审', 'yes', '', '', '', '', 'admin', '2020-01-09 11:13:37', '', NULL, '', NULL, 70, '0'),
(181, 45, '采取纠正措施', 'no', '', '', '', '', 'admin', '2020-01-09 11:13:37', '', NULL, '', NULL, 75, '0'),
(182, 46, '制定风险管理计划', 'yes', '', '', '', '', 'admin', '2020-01-09 11:15:04', '', NULL, '', NULL, 80, '0'),
(183, 46, '风险识别', 'yes', '', '', '', '', 'admin', '2020-01-09 11:15:04', '', NULL, '', NULL, 85, '0'),
(184, 46, '风险分析', 'yes', '', '', '', '', 'admin', '2020-01-09 11:15:04', '', NULL, '', NULL, 90, '0'),
(185, 46, '风险规避和缓解', 'yes', '', '', '', '', 'admin', '2020-01-09 11:15:04', '', NULL, '', NULL, 95, '0'),
(186, 46, '风险跟踪', 'yes', '', '', '', '', 'admin', '2020-01-09 11:15:04', '', NULL, '', NULL, 100, '0'),
(187, 46, '更新组织级“风险列表库”', 'no', '', '', '', '', 'admin', '2020-01-09 11:15:04', '', NULL, '', NULL, 105, '0'),
(188, 47, '结项准备', 'no', '', '', '', '', 'admin', '2020-01-09 11:16:16', '', NULL, '', NULL, 110, '0'),
(189, 47, '结项申请', 'yes', '', '', '', '', 'admin', '2020-01-09 11:16:16', '', NULL, '', NULL, 115, '0'),
(190, 47, '结项评审', 'yes', '', '', '', '', 'admin', '2020-01-09 11:16:16', '', NULL, '', NULL, 120, '0'),
(191, 47, '资料纳入组织级过程资产库', 'yes', '', '', '', '', 'admin', '2020-01-09 11:16:16', '', NULL, '', NULL, 125, '0'),
(192, 48, '量化项目管理', 'yes', '', '', '', '', 'admin', '2020-01-09 11:16:34', '', NULL, '', NULL, 130, '0'),
(193, 49, '用户需求获取', 'yes', '', '', '', '', 'admin', '2020-01-09 13:25:22', '', NULL, '', NULL, 135, '0'),
(194, 49, '用户需求评审', 'yes', '', '', '', '', 'admin', '2020-01-09 13:25:22', '', NULL, '', NULL, 140, '0'),
(195, 49, '产品需求定义', 'yes', '', '', '', '', 'admin', '2020-01-09 13:25:22', '', NULL, '', NULL, 145, '0'),
(196, 49, '产品需求评审', 'yes', '', '', '', '', 'admin', '2020-01-09 13:25:22', '', NULL, '', NULL, 150, '0'),
(197, 49, '需求变更控制', 'no', '', '未涉及变更时可不进行', '', '', 'admin', '2020-01-09 13:25:22', '', NULL, '', NULL, 155, '0'),
(198, 50, '概要设计', '', '', '', '', '', 'admin', '2020-01-09 13:26:07', '', NULL, '', NULL, 160, '0'),
(199, 50, '评审《概要设计说明书》', '', '', '', '', '', 'admin', '2020-01-09 13:26:07', '', NULL, '', NULL, 165, '0'),
(200, 50, '详细设计', '', '', '', '', '', 'admin', '2020-01-09 13:26:07', '', NULL, '', NULL, 170, '0'),
(201, 50, '评审详细设计工作产品', '', '', '', '', '', 'admin', '2020-01-09 13:26:07', '', NULL, '', NULL, 175, '0'),
(202, 51, '制定编码阶段计划', '', '', '', '', '', 'admin', '2020-01-09 13:27:57', '', NULL, '', NULL, 210, '0'),
(203, 51, '构建数据库', '', '', '', '', '', 'admin', '2020-01-09 13:27:57', '', NULL, '', NULL, 215, '0'),
(204, 51, '编码实现', '', '', '', '', '', 'admin', '2020-01-09 13:27:57', '', NULL, '', NULL, 220, '0'),
(205, 51, '代码检查', '', '', '', '', '', 'admin', '2020-01-09 13:27:57', '', NULL, '', NULL, 225, '0'),
(206, 51, '单元测试', '', '', '', '', '', 'admin', '2020-01-09 13:27:57', '', NULL, '', NULL, 230, '0'),
(207, 51, '交叉单元测试', '', '', '', '', '', 'admin', '2020-01-09 13:27:57', '', NULL, '', NULL, 235, '0'),
(208, 51, '系统集成', '', '', '', '', '', 'admin', '2020-01-09 13:27:57', '', NULL, '', NULL, 240, '0'),
(209, 51, '编写集成测试用例', '', '', '', '', '', 'admin', '2020-01-09 13:27:57', '', NULL, '', NULL, 245, '0'),
(210, 51, '评审集成测试用例', '', '', '', '', '', 'admin', '2020-01-09 13:27:57', '', NULL, '', NULL, 250, '0'),
(211, 51, '集成测试', '', '', '', '', '', 'admin', '2020-01-09 13:27:57', '', NULL, '', NULL, 255, '0'),
(212, 51, '缺陷管理', '', '', '', '', '', 'admin', '2020-01-09 13:27:57', '', NULL, '', NULL, 260, '0'),
(213, 51, '编写支持文档', '', '', '', '', '', 'admin', '2020-01-09 13:27:57', '', NULL, '', NULL, 265, '0'),
(214, 52, '制定《系统测试计划》', '', '', '', '', '', 'admin', '2020-01-09 13:28:25', '', NULL, '', NULL, 270, '0'),
(215, 52, '评审《系统测试计划》', '', '', '', '', '', 'admin', '2020-01-09 13:28:25', '', NULL, '', NULL, 275, '0'),
(216, 52, '编写《系统测试用例》', '', '', '', '', '', 'admin', '2020-01-09 13:28:25', '', NULL, '', NULL, 280, '0'),
(217, 52, '评审《系统测试用例》', '', '', '', '', '', 'admin', '2020-01-09 13:28:25', '', NULL, '', NULL, 285, '0'),
(218, 52, '执行系统测试', '', '', '', '', '', 'admin', '2020-01-09 13:28:25', '', NULL, '', NULL, 290, '0'),
(219, 53, '验收准备', '', '', '', '', '', 'admin', '2020-01-09 13:29:28', '', NULL, '', NULL, 295, '0'),
(220, 53, '产品打包', '', '', '', '', '', 'admin', '2020-01-09 13:29:28', '', NULL, '', NULL, 300, '0'),
(221, 53, '内部培训', '', '', '', '', '', 'admin', '2020-01-09 13:29:28', '', NULL, '', NULL, 305, '0'),
(222, 53, '现场安装调试', '', '', '', '', '', 'admin', '2020-01-09 13:29:28', '', NULL, '', NULL, 310, '0'),
(223, 53, '用户使用培训', '', '', '', '', '', 'admin', '2020-01-09 13:29:28', '', NULL, '', NULL, 315, '0'),
(224, 53, '试运行', '', '', '', '', '', 'admin', '2020-01-09 13:29:28', '', NULL, '', NULL, 320, '0'),
(225, 53, '客户验收', '', '', '', '', '', 'admin', '2020-01-09 13:29:28', '', NULL, '', NULL, 325, '0'),
(226, 54, '制定质量保证计划', '', '', '', '', '', 'admin', '2020-01-09 13:38:58', '', NULL, '', NULL, 330, '0'),
(227, 54, '评审质量保证计划', '', '', '', '', '', 'admin', '2020-01-09 13:38:58', '', NULL, '', NULL, 335, '0'),
(228, 54, '过程和产品质量检查', '', '', '', '', '', 'admin', '2020-01-09 13:38:58', '', NULL, '', NULL, 340, '0'),
(229, 54, '问题跟踪处理', '', '', '', '', '', 'admin', '2020-01-09 13:38:58', '', NULL, '', NULL, 345, '0'),
(230, 54, '质量保证总结报告', '', '', '', '', '', 'admin', '2020-01-09 13:38:58', '', NULL, '', NULL, 350, '0'),
(231, 55, '组织及配置管理员移交工作', '', '', '', '', '', 'admin', '2020-01-09 13:39:25', '', NULL, '', NULL, 355, '0'),
(232, 55, '制定《配置管理计划》', '', '', '', '', '', 'admin', '2020-01-09 13:39:25', '', NULL, '', NULL, 360, '0'),
(233, 55, '建立和维护配置库', '', '', '', '', '', 'admin', '2020-01-09 13:39:25', '', NULL, '', NULL, 365, '0'),
(234, 55, '配置项管理', '', '', '', '', '', 'admin', '2020-01-09 13:39:25', '', NULL, '', NULL, 370, '0'),
(235, 55, '基线管理', '', '', '', '', '', 'admin', '2020-01-09 13:39:25', '', NULL, '', NULL, 375, '0'),
(236, 55, '变更管理', '', '', '', '', '', 'admin', '2020-01-09 13:39:25', '', NULL, '', NULL, 380, '0'),
(237, 55, '配置审计', '', '', '', '', '', 'admin', '2020-01-09 13:39:25', '', NULL, '', NULL, 385, '0'),
(238, 56, '建立项目度量目标', '', '', '', '', '', 'admin', '2020-01-09 13:40:05', '', NULL, '', NULL, 390, '0'),
(239, 56, '确定项目度量点', '', '', '', '', '', 'admin', '2020-01-09 13:40:05', '', NULL, '', NULL, 395, '0'),
(240, 56, '制定度量分析计划', '', '', '', '', '', 'admin', '2020-01-09 13:40:05', '', NULL, '', NULL, 400, '0'),
(241, 56, '收集和分析度量数据', '', '', '', '', '', 'admin', '2020-01-09 13:40:05', '', NULL, '', NULL, 405, '0'),
(242, 56, '存储和通报度量分析结果', '', '', '', '', '', 'admin', '2020-01-09 13:40:05', '', NULL, '', NULL, 410, '0'),
(243, 57, '原因分析与解决', '', '', '', '', '', 'admin', '2020-01-09 13:40:15', '', NULL, '', NULL, 415, '0'),
(244, 58, '建立评估标准', '', '', '', '', '', 'admin', '2020-01-09 13:40:35', '', NULL, '', NULL, 420, '0'),
(245, 58, '确定候选方案', '', '', '', '', '', 'admin', '2020-01-09 13:40:35', '', NULL, '', NULL, 425, '0'),
(246, 58, '原因分析与解决', '', '', '', '', '', 'admin', '2020-01-09 13:40:35', '', NULL, '', NULL, 430, '0'),
(247, 58, '确定评估方法', '', '', '', '', '', 'admin', '2020-01-09 13:40:35', '', NULL, '', NULL, 435, '0'),
(248, 58, '评估候选方案', '', '', '', '', '', 'admin', '2020-01-09 13:40:35', '', NULL, '', NULL, 440, '0'),
(249, 58, '做出决策', '', '', '', '', '', 'admin', '2020-01-09 13:40:35', '', NULL, '', NULL, 445, '0'),
(250, 59, '立项调查，可行性分析，技术预研', 'yes', '', '', '', '', 'admin', '2020-01-09 10:49:34', '', NULL, '', NULL, 20, '0'),
(251, 59, '项目预算', 'yes', '', '', '', '', 'admin', '2020-01-09 10:49:34', '', NULL, '', NULL, 25, '0'),
(252, 59, '立项决策', 'yes', '', '', '', '', 'admin', '2020-01-09 10:49:34', '', NULL, '', NULL, 30, '0'),
(253, 59, '投标/商务洽谈', 'no', '', '', '', '', 'admin', '2020-01-09 10:49:34', '', NULL, '', NULL, 35, '0'),
(254, 60, '估算', 'yes', '', '', '', '', 'admin', '2020-01-09 11:12:17', '', NULL, '', NULL, 40, '0'),
(255, 60, '裁剪', 'yes', '', '', '', '', 'admin', '2020-01-09 11:12:17', '', NULL, '', NULL, 45, '0'),
(256, 60, '制定项目计划及下属计划', 'yes', '', '', '', '', 'admin', '2020-01-09 11:12:17', '', NULL, '', NULL, 50, '0'),
(257, 60, '评审项目计划及下属计划', 'yes', '', '', '', '', 'admin', '2020-01-09 11:12:17', '', NULL, '', NULL, 55, '0'),
(258, 61, '日常跟踪', 'yes', '', '', '', '', 'admin', '2020-01-09 11:13:37', '', NULL, '', NULL, 60, '0'),
(259, 61, '举行周例会', 'yes', '', '', '', '', 'admin', '2020-01-09 11:13:37', '', NULL, '', NULL, 65, '0'),
(260, 61, '里程碑评审', 'yes', '', '', '', '', 'admin', '2020-01-09 11:13:37', '', NULL, '', NULL, 70, '0'),
(261, 61, '采取纠正措施', 'no', '', '', '', '', 'admin', '2020-01-09 11:13:37', '', NULL, '', NULL, 75, '0'),
(262, 62, '制定风险管理计划', 'yes', '', '', '', '', 'admin', '2020-01-09 11:15:04', '', NULL, '', NULL, 80, '0'),
(263, 62, '风险识别', 'yes', '', '', '', '', 'admin', '2020-01-09 11:15:04', '', NULL, '', NULL, 85, '0'),
(264, 62, '风险分析', 'yes', '', '', '', '', 'admin', '2020-01-09 11:15:04', '', NULL, '', NULL, 90, '0'),
(265, 62, '风险规避和缓解', 'yes', '', '', '', '', 'admin', '2020-01-09 11:15:04', '', NULL, '', NULL, 95, '0'),
(266, 62, '风险跟踪', 'yes', '', '', '', '', 'admin', '2020-01-09 11:15:04', '', NULL, '', NULL, 100, '0'),
(267, 62, '更新组织级“风险列表库”', 'no', '', '', '', '', 'admin', '2020-01-09 11:15:04', '', NULL, '', NULL, 105, '0'),
(268, 63, '结项准备', 'no', '', '', '', '', 'admin', '2020-01-09 11:16:16', '', NULL, '', NULL, 110, '0'),
(269, 63, '结项申请', 'yes', '', '', '', '', 'admin', '2020-01-09 11:16:16', '', NULL, '', NULL, 115, '0'),
(270, 63, '结项评审', 'yes', '', '', '', '', 'admin', '2020-01-09 11:16:16', '', NULL, '', NULL, 120, '0'),
(271, 63, '资料纳入组织级过程资产库', 'yes', '', '', '', '', 'admin', '2020-01-09 11:16:16', '', NULL, '', NULL, 125, '0'),
(272, 64, '量化项目管理', 'yes', '', '', '', '', 'admin', '2020-01-09 11:16:34', '', NULL, '', NULL, 130, '0'),
(273, 65, '用户需求获取', 'yes', '', '', '', '', 'admin', '2020-01-09 13:25:22', '', NULL, '', NULL, 135, '0'),
(274, 65, '用户需求评审', 'yes', '', '', '', '', 'admin', '2020-01-09 13:25:22', '', NULL, '', NULL, 140, '0'),
(275, 65, '产品需求定义', 'yes', '', '', '', '', 'admin', '2020-01-09 13:25:22', '', NULL, '', NULL, 145, '0'),
(276, 65, '产品需求评审', 'yes', '', '', '', '', 'admin', '2020-01-09 13:25:22', '', NULL, '', NULL, 150, '0'),
(277, 65, '需求变更控制', 'no', '', '未涉及变更时可不进行', '', '', 'admin', '2020-01-09 13:25:22', '', NULL, '', NULL, 155, '0'),
(278, 66, '概要设计', '', '', '', '', '', 'admin', '2020-01-09 13:26:07', '', NULL, '', NULL, 160, '0'),
(279, 66, '评审《概要设计说明书》', '', '', '', '', '', 'admin', '2020-01-09 13:26:07', '', NULL, '', NULL, 165, '0'),
(280, 66, '详细设计', '', '', '', '', '', 'admin', '2020-01-09 13:26:07', '', NULL, '', NULL, 170, '0'),
(281, 66, '评审详细设计工作产品', '', '', '', '', '', 'admin', '2020-01-09 13:26:07', '', NULL, '', NULL, 175, '0'),
(282, 67, '制定编码阶段计划', '', '', '', '', '', 'admin', '2020-01-09 13:27:57', '', NULL, '', NULL, 210, '0'),
(283, 67, '构建数据库', '', '', '', '', '', 'admin', '2020-01-09 13:27:57', '', NULL, '', NULL, 215, '0'),
(284, 67, '编码实现', '', '', '', '', '', 'admin', '2020-01-09 13:27:57', '', NULL, '', NULL, 220, '0'),
(285, 67, '代码检查', '', '', '', '', '', 'admin', '2020-01-09 13:27:57', '', NULL, '', NULL, 225, '0'),
(286, 67, '单元测试', '', '', '', '', '', 'admin', '2020-01-09 13:27:57', '', NULL, '', NULL, 230, '0'),
(287, 67, '交叉单元测试', '', '', '', '', '', 'admin', '2020-01-09 13:27:57', '', NULL, '', NULL, 235, '0'),
(288, 67, '系统集成', '', '', '', '', '', 'admin', '2020-01-09 13:27:57', '', NULL, '', NULL, 240, '0'),
(289, 67, '编写集成测试用例', '', '', '', '', '', 'admin', '2020-01-09 13:27:57', '', NULL, '', NULL, 245, '0'),
(290, 67, '评审集成测试用例', '', '', '', '', '', 'admin', '2020-01-09 13:27:57', '', NULL, '', NULL, 250, '0'),
(291, 67, '集成测试', '', '', '', '', '', 'admin', '2020-01-09 13:27:57', '', NULL, '', NULL, 255, '0'),
(292, 67, '缺陷管理', '', '', '', '', '', 'admin', '2020-01-09 13:27:57', '', NULL, '', NULL, 260, '0'),
(293, 67, '编写支持文档', '', '', '', '', '', 'admin', '2020-01-09 13:27:57', '', NULL, '', NULL, 265, '0'),
(294, 68, '制定《系统测试计划》', '', '', '', '', '', 'admin', '2020-01-09 13:28:25', '', NULL, '', NULL, 270, '0'),
(295, 68, '评审《系统测试计划》', '', '', '', '', '', 'admin', '2020-01-09 13:28:25', '', NULL, '', NULL, 275, '0'),
(296, 68, '编写《系统测试用例》', '', '', '', '', '', 'admin', '2020-01-09 13:28:25', '', NULL, '', NULL, 280, '0'),
(297, 68, '评审《系统测试用例》', '', '', '', '', '', 'admin', '2020-01-09 13:28:25', '', NULL, '', NULL, 285, '0'),
(298, 68, '执行系统测试', '', '', '', '', '', 'admin', '2020-01-09 13:28:25', '', NULL, '', NULL, 290, '0'),
(299, 69, '验收准备', '', '', '', '', '', 'admin', '2020-01-09 13:29:28', '', NULL, '', NULL, 295, '0'),
(300, 69, '产品打包', '', '', '', '', '', 'admin', '2020-01-09 13:29:28', '', NULL, '', NULL, 300, '0'),
(301, 69, '内部培训', '', '', '', '', '', 'admin', '2020-01-09 13:29:28', '', NULL, '', NULL, 305, '0'),
(302, 69, '现场安装调试', '', '', '', '', '', 'admin', '2020-01-09 13:29:28', '', NULL, '', NULL, 310, '0'),
(303, 69, '用户使用培训', '', '', '', '', '', 'admin', '2020-01-09 13:29:28', '', NULL, '', NULL, 315, '0'),
(304, 69, '试运行', '', '', '', '', '', 'admin', '2020-01-09 13:29:28', '', NULL, '', NULL, 320, '0'),
(305, 69, '客户验收', '', '', '', '', '', 'admin', '2020-01-09 13:29:28', '', NULL, '', NULL, 325, '0'),
(306, 70, '制定质量保证计划', '', '', '', '', '', 'admin', '2020-01-09 13:38:58', '', NULL, '', NULL, 330, '0'),
(307, 70, '评审质量保证计划', '', '', '', '', '', 'admin', '2020-01-09 13:38:58', '', NULL, '', NULL, 335, '0'),
(308, 70, '过程和产品质量检查', '', '', '', '', '', 'admin', '2020-01-09 13:38:58', '', NULL, '', NULL, 340, '0'),
(309, 70, '问题跟踪处理', '', '', '', '', '', 'admin', '2020-01-09 13:38:58', '', NULL, '', NULL, 345, '0'),
(310, 70, '质量保证总结报告', '', '', '', '', '', 'admin', '2020-01-09 13:38:58', '', NULL, '', NULL, 350, '0'),
(311, 71, '组织及配置管理员移交工作', '', '', '', '', '', 'admin', '2020-01-09 13:39:25', '', NULL, '', NULL, 355, '0'),
(312, 71, '制定《配置管理计划》', '', '', '', '', '', 'admin', '2020-01-09 13:39:25', '', NULL, '', NULL, 360, '0'),
(313, 71, '建立和维护配置库', '', '', '', '', '', 'admin', '2020-01-09 13:39:25', '', NULL, '', NULL, 365, '0'),
(314, 71, '配置项管理', '', '', '', '', '', 'admin', '2020-01-09 13:39:25', '', NULL, '', NULL, 370, '0'),
(315, 71, '基线管理', '', '', '', '', '', 'admin', '2020-01-09 13:39:25', '', NULL, '', NULL, 375, '0'),
(316, 71, '变更管理', '', '', '', '', '', 'admin', '2020-01-09 13:39:25', '', NULL, '', NULL, 380, '0'),
(317, 71, '配置审计', '', '', '', '', '', 'admin', '2020-01-09 13:39:25', '', NULL, '', NULL, 385, '0'),
(318, 72, '建立项目度量目标', '', '', '', '', '', 'admin', '2020-01-09 13:40:05', '', NULL, '', NULL, 390, '0'),
(319, 72, '确定项目度量点', '', '', '', '', '', 'admin', '2020-01-09 13:40:05', '', NULL, '', NULL, 395, '0'),
(320, 72, '制定度量分析计划', '', '', '', '', '', 'admin', '2020-01-09 13:40:05', '', NULL, '', NULL, 400, '0'),
(321, 72, '收集和分析度量数据', '', '', '', '', '', 'admin', '2020-01-09 13:40:05', '', NULL, '', NULL, 405, '0'),
(322, 72, '存储和通报度量分析结果', '', '', '', '', '', 'admin', '2020-01-09 13:40:05', '', NULL, '', NULL, 410, '0'),
(323, 73, '原因分析与解决', '', '', '', '', '', 'admin', '2020-01-09 13:40:15', '', NULL, '', NULL, 415, '0'),
(324, 74, '建立评估标准', '', '', '', '', '', 'admin', '2020-01-09 13:40:35', '', NULL, '', NULL, 420, '0'),
(325, 74, '确定候选方案', '', '', '', '', '', 'admin', '2020-01-09 13:40:35', '', NULL, '', NULL, 425, '0'),
(326, 74, '原因分析与解决', '', '', '', '', '', 'admin', '2020-01-09 13:40:35', '', NULL, '', NULL, 430, '0'),
(327, 74, '确定评估方法', '', '', '', '', '', 'admin', '2020-01-09 13:40:35', '', NULL, '', NULL, 435, '0'),
(328, 74, '评估候选方案', '', '', '', '', '', 'admin', '2020-01-09 13:40:35', '', NULL, '', NULL, 440, '0'),
(329, 74, '做出决策', '', '', '', '', '', 'admin', '2020-01-09 13:40:35', '', NULL, '', NULL, 445, '0');

REPLACE INTO `zt_zoutput` (`id`, `activity`, `name`, `content`, `optional`, `tailorNorm`, `status`, `createdBy`, `createdDate`, `editedBy`, `editedDate`, `order`, `deleted`) VALUES
(5, 4, '《技术可行性分析报告》', '', '', '', '', 'admin', '2020-01-09 11:01:52', '', '1970-01-01 00:00:01', 25, '0'),
(6, 5, '《项目预算表》', '', '', '', '', 'admin', '2020-01-09 11:17:27', '', '1970-01-01 00:00:01', 30, '0'),
(7, 6, '《立项申请报告》', '', '', '', '', 'admin', '2020-01-09 11:17:50', '', '1970-01-01 00:00:01', 35, '0'),
(8, 7, '《项目投标书》', '不涉及投标', '', '', '', 'admin', '2020-01-09 11:18:12', '', '1970-01-01 00:00:01', 40, '0'),
(9, 8, '《项目估算报告》', '', '', '', '', 'admin', '2020-01-09 11:18:41', '', '1970-01-01 00:00:01', 45, '0'),
(10, 8, '《功能点估算》', '', '', '', '', 'admin', '2020-01-09 11:18:41', '', '1970-01-01 00:00:01', 50, '0'),
(11, 9, '《PDP说明》', '', '', '', '', 'admin', '2020-01-09 11:18:54', '', '1970-01-01 00:00:01', 55, '0'),
(12, 10, '《项目进度表》', '', '', '', '', 'admin', '2020-01-09 11:19:46', '', '1970-01-01 00:00:01', 60, '0'),
(13, 10, '《项目计划》及其下属计划', '', '', '', '', 'admin', '2020-01-09 11:19:46', '', '1970-01-01 00:00:01', 65, '0'),
(14, 10, '《风险管理计划及跟踪表》', '', '', '', '', 'admin', '2020-01-09 11:19:46', '', '1970-01-01 00:00:01', 70, '0'),
(15, 10, '《项目资源计划》', '', '', '', '', 'admin', '2020-01-09 11:19:46', '', '1970-01-01 00:00:01', 75, '0'),
(16, 10, '《干系人计划》', '', '', '', '', 'admin', '2020-01-09 11:19:46', '', '1970-01-01 00:00:01', 80, '0'),
(17, 10, '《同行评审计划》', '', '', '', '', 'admin', '2020-01-09 11:19:46', '', '1970-01-01 00:00:01', 85, '0'),
(18, 10, '《质量保证计划》', '', '', '', '', 'admin', '2020-01-09 11:19:46', '', '1970-01-01 00:00:01', 90, '0'),
(19, 10, '《配置管理计划》', '', '', '', '', 'admin', '2020-01-09 11:19:46', '', '1970-01-01 00:00:01', 95, '0'),
(20, 11, '《同行评审通知》', '', '', '', '', 'admin', '2020-01-09 11:20:16', '', '1970-01-01 00:00:01', 100, '0'),
(21, 11, '《评审准备表》', '', '', '', '', 'admin', '2020-01-09 11:20:16', '', '1970-01-01 00:00:01', 105, '0'),
(22, 11, '《同行评审报告》', '', '', '', '', 'admin', '2020-01-09 11:20:17', '', '1970-01-01 00:00:01', 110, '0'),
(23, 12, '《里程碑报告》', '', 'yes', '', '', 'admin', '2020-01-09 13:44:11', '', '1970-01-01 00:00:01', 115, '0'),
(24, 12, '《项目周报》', '', 'yes', '', '', 'admin', '2020-01-09 13:44:11', '', '1970-01-01 00:00:01', 120, '0'),
(25, 13, '《项目周报》', '', 'yes', '', '', 'admin', '2020-01-09 13:44:11', '', '1970-01-01 00:00:01', 125, '0'),
(26, 13, '《会议纪要》', '', 'yes', '', '', 'admin', '2020-01-09 13:44:11', '', '1970-01-01 00:00:01', 130, '0'),
(27, 14, '《里程碑报告》', '', 'yes', '', '', 'admin', '2020-01-09 13:44:11', '', '1970-01-01 00:00:01', 135, '0'),
(28, 14, '《里程碑会议纪要》', '', 'yes', '', '', 'admin', '2020-01-09 13:44:11', '', '1970-01-01 00:00:01', 140, '0'),
(29, 15, '《计划变更申请》', '', 'no', '', '', 'admin', '2020-01-09 13:44:11', '', '1970-01-01 00:00:01', 145, '0'),
(30, 16, '《风险管理计划及跟踪表》', '', '', '', '', 'admin', '2020-01-09 13:45:53', '', '1970-01-01 00:00:01', 150, '0'),
(31, 17, '《风险管理计划及跟踪表》', '', '', '', '', 'admin', '2020-01-09 13:45:53', '', '1970-01-01 00:00:01', 155, '0'),
(32, 17, '《风险管理报告》', '', '', '', '', 'admin', '2020-01-09 13:45:53', '', '1970-01-01 00:00:01', 160, '0'),
(33, 18, '《风险管理计划及跟踪表》', '', '', '', '', 'admin', '2020-01-09 13:45:53', '', '1970-01-01 00:00:01', 165, '0'),
(34, 19, '《异常处理申请表》', '', '', '', '', 'admin', '2020-01-09 13:45:53', '', '1970-01-01 00:00:01', 170, '0'),
(35, 19, '《风险管理计划及跟踪表》', '', '', '', '', 'admin', '2020-01-09 13:45:53', '', '1970-01-01 00:00:01', 175, '0'),
(36, 20, '《风险管理报告》', '', '', '', '', 'admin', '2020-01-09 13:45:53', '', '1970-01-01 00:00:01', 180, '0'),
(37, 20, '《风险管理计划及跟踪表》', '', '', '', '', 'admin', '2020-01-09 13:45:53', '', '1970-01-01 00:00:01', 185, '0'),
(38, 21, '《风险列表库》', '', '', '', '', 'admin', '2020-01-09 13:45:53', '', '1970-01-01 00:00:01', 190, '0'),
(39, 22, '《代码复用总结》', '', '', '', '', 'admin', '2020-01-09 13:46:26', '', '1970-01-01 00:00:01', 195, '0'),
(40, 24, '《结项报告》', '', '', '', '', 'admin', '2020-01-09 13:46:26', '', '1970-01-01 00:00:01', 200, '0'),
(41, 26, '《量化项目管理及跟踪计划》', '', 'yes', '', '', 'admin', '2020-01-09 13:46:46', '', '1970-01-01 00:00:01', 205, '0'),
(42, 27, '《用户需求调查单》', '', 'yes', '', '', 'admin', '2020-01-09 14:08:58', '', '1970-01-01 00:00:01', 210, '0'),
(43, 27, '《用户需求说明书》', '', 'yes', '', '', 'admin', '2020-01-09 14:08:58', '', '1970-01-01 00:00:01', 215, '0'),
(44, 28, '《评审通知》', '', 'yes', '', '', 'admin', '2020-01-09 14:08:58', '', '1970-01-01 00:00:01', 220, '0'),
(45, 28, '《同行评审准备表》', '', 'yes', '', '', 'admin', '2020-01-09 14:08:58', '', '1970-01-01 00:00:01', 225, '0'),
(46, 28, '《同行评审报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:08:58', '', '1970-01-01 00:00:01', 230, '0'),
(47, 29, '《产品需求规格说明书》', '', 'yes', '', '', 'admin', '2020-01-09 14:08:58', '', '1970-01-01 00:00:01', 235, '0'),
(48, 30, '《评审通知》', '', 'yes', '', '', 'admin', '2020-01-09 14:08:58', '', '1970-01-01 00:00:01', 240, '0'),
(49, 30, ' 《同行评审准备表》', '', 'yes', '', '', 'admin', '2020-01-09 14:08:58', '', '1970-01-01 00:00:01', 245, '0'),
(50, 30, ' 《同行评审报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:08:58', '', '1970-01-01 00:00:01', 250, '0'),
(51, 31, '《需求变更记录》', '', '', '', '', 'admin', '2020-01-09 14:08:58', '', '1970-01-01 00:00:01', 255, '0'),
(52, 31, '《用户需求说明书》', '', '', '', '', 'admin', '2020-01-09 14:08:58', '', '1970-01-01 00:00:01', 260, '0'),
(53, 31, '《软件需求规格说明书》', '', '', '', '', 'admin', '2020-01-09 14:08:58', '', '1970-01-01 00:00:01', 265, '0'),
(54, 32, '《概要设计说明书》', '', 'yes', '', '', 'admin', '2020-01-09 14:20:09', '', '1970-01-01 00:00:01', 270, '0'),
(55, 33, '《评审通知》', '', 'yes', '', '', 'admin', '2020-01-09 14:20:09', '', '1970-01-01 00:00:01', 275, '0'),
(56, 33, '《同行评审准备表》', '', 'yes', '', '', 'admin', '2020-01-09 14:20:09', '', '1970-01-01 00:00:01', 280, '0'),
(57, 33, '《同行评审报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:20:09', '', '1970-01-01 00:00:01', 285, '0'),
(58, 34, '《模块设计说明书》', '', 'no', '', '', 'admin', '2020-01-09 14:20:09', '', '1970-01-01 00:00:01', 290, '0'),
(59, 34, '《数据库设计说明书》', '', 'yes', '', '', 'admin', '2020-01-09 14:20:09', '', '1970-01-01 00:00:01', 295, '0'),
(60, 34, '《用户界面设计说明书》', '', 'no', '', '', 'admin', '2020-01-09 14:20:09', '', '1970-01-01 00:00:01', 300, '0'),
(61, 35, '《评审通知》', '', 'no', '', '', 'admin', '2020-01-09 14:20:09', '', '1970-01-01 00:00:01', 305, '0'),
(62, 35, '《同行评审准备表》', '', 'no', '', '', 'admin', '2020-01-09 14:20:09', '', '1970-01-01 00:00:01', 310, '0'),
(63, 35, '《同行评审报告》', '', 'no', '', '', 'admin', '2020-01-09 14:20:09', '', '1970-01-01 00:00:01', 315, '0'),
(64, 42, '《实现与测试计划》', '', 'yes', '', '', 'admin', '2020-01-09 14:22:52', '', '1970-01-01 00:00:01', 320, '0'),
(65, 42, '《单板硬件调试和单元测试计划》', '', 'yes', '', '', 'admin', '2020-01-09 14:22:52', '', '1970-01-01 00:00:01', 325, '0'),
(66, 42, '《项目进度表》中“实现与测试”部分', '', 'yes', '', '', 'admin', '2020-01-09 14:22:52', '', '1970-01-01 00:00:01', 330, '0'),
(67, 43, '产品数据库', '', '', '', '', 'admin', '2020-01-09 14:22:52', '', '1970-01-01 00:00:01', 335, '0'),
(68, 44, '模块代码', '', '', '', '', 'admin', '2020-01-09 14:22:52', '', '1970-01-01 00:00:01', 340, '0'),
(69, 45, '《代码质量检查记录单》', '', '', '', '', 'admin', '2020-01-09 14:22:52', '', '1970-01-01 00:00:01', 345, '0'),
(70, 46, '《单元测试缺陷统计分析报告》', '', '', '', '', 'admin', '2020-01-09 14:22:52', '', '1970-01-01 00:00:01', 350, '0'),
(71, 47, '禅道缺陷记录', '', '', '', '', 'admin', '2020-01-09 14:22:52', '', '1970-01-01 00:00:01', 355, '0'),
(72, 48, '《系统集成说明书》', '', '', '', '', 'admin', '2020-01-09 14:22:52', '', '1970-01-01 00:00:01', 360, '0'),
(73, 49, '《集成测试用例》', '', '', '', '', 'admin', '2020-01-09 14:22:52', '', '1970-01-01 00:00:01', 365, '0'),
(74, 50, '《评审通知》 ', '', '', '', '', 'admin', '2020-01-09 14:22:52', '', '1970-01-01 00:00:01', 370, '0'),
(75, 50, '《同行评审准备表》 ', '', '', '', '', 'admin', '2020-01-09 14:22:52', '', '1970-01-01 00:00:01', 375, '0'),
(76, 50, '《同行评审报告》', '', '', '', '', 'admin', '2020-01-09 14:22:52', '', '1970-01-01 00:00:01', 380, '0'),
(77, 51, '《集成测试报告》', '', '', '', '', 'admin', '2020-01-09 14:22:52', '', '1970-01-01 00:00:01', 385, '0'),
(78, 52, '禅道缺陷记录', '', '', '', '', 'admin', '2020-01-09 14:22:52', '', '1970-01-01 00:00:01', 390, '0'),
(79, 52, '《用户操作手册》 ', '', '', '', '', 'admin', '2020-01-09 14:22:52', '', '1970-01-01 00:00:01', 395, '0'),
(80, 52, '《安装手册》', '', '', '', '', 'admin', '2020-01-09 14:22:52', '', '1970-01-01 00:00:01', 400, '0'),
(81, 54, '《系统测试计划》', '', 'yes', '', '', 'admin', '2020-01-09 14:25:16', '', '1970-01-01 00:00:01', 405, '0'),
(82, 55, '《评审通知》', '', 'yes', '', '', 'admin', '2020-01-09 14:25:16', '', '1970-01-01 00:00:01', 410, '0'),
(83, 55, '《同行评审准备表》', '', 'yes', '', '', 'admin', '2020-01-09 14:25:16', '', '1970-01-01 00:00:01', 415, '0'),
(84, 55, '《同行评审报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:25:16', '', '1970-01-01 00:00:01', 420, '0'),
(85, 56, '《系统测试用例》', '', 'yes', '', '', 'admin', '2020-01-09 14:25:16', '', '1970-01-01 00:00:01', 425, '0'),
(86, 57, '《评审通知》', '', 'yes', '', '', 'admin', '2020-01-09 14:25:16', '', '1970-01-01 00:00:01', 430, '0'),
(87, 57, '《同行评审准备表》', '', 'yes', '', '', 'admin', '2020-01-09 14:25:16', '', '1970-01-01 00:00:01', 435, '0'),
(88, 57, '《同行评审报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:25:16', '', '1970-01-01 00:00:01', 440, '0'),
(89, 58, '禅道缺陷跟踪系统记录项', '', 'yes', '', '', 'admin', '2020-01-09 14:25:16', '', '1970-01-01 00:00:01', 445, '0'),
(90, 58, '《系统测试分析报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:25:16', '', '1970-01-01 00:00:01', 450, '0'),
(91, 58, '《缺陷统计分析报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:25:16', '', '1970-01-01 00:00:01', 455, '0'),
(92, 59, '《产品打包清单》', '', 'yes', '', '', 'admin', '2020-01-09 14:25:16', '', '1970-01-01 00:00:01', 460, '0'),
(93, 60, '发布光盘、纸质支持文档', '', 'yes', '', '', 'admin', '2020-01-09 14:26:52', '', '1970-01-01 00:00:01', 465, '0'),
(94, 61, '《交接签收单》', '', 'yes', '', '', 'admin', '2020-01-09 14:26:52', '', '1970-01-01 00:00:01', 470, '0'),
(95, 62, '《工作联系单》', '', 'yes', '', '', 'admin', '2020-01-09 14:26:52', '', '1970-01-01 00:00:01', 475, '0'),
(96, 62, '《工作记录单》', '', 'yes', '', '', 'admin', '2020-01-09 14:26:52', '', '1970-01-01 00:00:01', 480, '0'),
(97, 62, '《交接签收单》', '', 'yes', '', '', 'admin', '2020-01-09 14:26:52', '', '1970-01-01 00:00:01', 485, '0'),
(98, 62, '《安装调试信息》', '', 'yes', '', '', 'admin', '2020-01-09 14:26:52', '', '1970-01-01 00:00:01', 490, '0'),
(99, 64, '禅道缺陷记录项', '', 'yes', '', '', 'admin', '2020-01-09 14:26:52', '', '1970-01-01 00:00:01', 495, '0'),
(100, 64, '会议纪要等文档', '', 'yes', '', '', 'admin', '2020-01-09 14:26:52', '', '1970-01-01 00:00:01', 500, '0'),
(101, 65, '《交接验收单》', '', 'yes', '', '', 'admin', '2020-01-09 14:26:52', '', '1970-01-01 00:00:01', 505, '0'),
(102, 65, '《客户验收报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:26:52', '', '1970-01-01 00:00:01', 510, '0'),
(103, 66, '初步《质量保证计划及跟踪表》', '', 'yes', '', '', 'admin', '2020-01-09 14:28:18', '', '1970-01-01 00:00:01', 515, '0'),
(104, 67, '详细《质量保证计划及跟踪表》', '', 'yes', '', '', 'admin', '2020-01-09 14:28:18', '', '1970-01-01 00:00:01', 520, '0'),
(105, 68, '《过程审计检查表》', '', 'yes', '', '', 'admin', '2020-01-09 14:28:18', '', '1970-01-01 00:00:01', 525, '0'),
(106, 68, '《产品审计检查表》', '', 'yes', '', '', 'admin', '2020-01-09 14:28:18', '', '1970-01-01 00:00:01', 530, '0'),
(107, 68, '《QA审计报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:28:18', '', '1970-01-01 00:00:01', 535, '0'),
(108, 68, '《QA问题报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:28:18', '', '1970-01-01 00:00:01', 540, '0'),
(109, 68, '《QA里程碑报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:28:18', '', '1970-01-01 00:00:01', 545, '0'),
(110, 68, '《QA周报》', '', 'yes', '', '', 'admin', '2020-01-09 14:28:18', '', '1970-01-01 00:00:01', 550, '0'),
(111, 69, '《QA审计报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:28:18', '', '1970-01-01 00:00:01', 555, '0'),
(112, 69, '《QA问题报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:28:18', '', '1970-01-01 00:00:01', 560, '0'),
(113, 70, '《QA总结报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:28:18', '', '1970-01-01 00:00:01', 565, '0'),
(114, 72, '《配置管理计划》', '', 'yes', '', '', 'admin', '2020-01-09 14:55:08', '', '1970-01-01 00:00:01', 570, '0'),
(115, 72, '《配置项计划及跟踪表》', '', 'yes', '', '', 'admin', '2020-01-09 14:55:08', '', '1970-01-01 00:00:01', 575, '0'),
(116, 72, '《基线计划及跟踪表》', '', 'yes', '', '', 'admin', '2020-01-09 14:55:08', '', '1970-01-01 00:00:01', 580, '0'),
(117, 73, '《配置库管理报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:55:08', '', '1970-01-01 00:00:01', 585, '0'),
(118, 74, '《配置项计划及跟踪表》', '', 'yes', '', '', 'admin', '2020-01-09 14:55:08', '', '1970-01-01 00:00:01', 590, '0'),
(119, 75, '《基线计划及跟踪表》', '', 'yes', '', '', 'admin', '2020-01-09 14:55:08', '', '1970-01-01 00:00:01', 595, '0'),
(120, 76, '《变更申请书》', '', 'yes', '', '', 'admin', '2020-01-09 14:55:08', '', '1970-01-01 00:00:01', 600, '0'),
(121, 77, '《配置审计报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:55:08', '', '1970-01-01 00:00:01', 605, '0'),
(122, 80, '《度量分析计划》', '', 'yes', '', '', 'admin', '2020-01-09 14:55:08', '', '1970-01-01 00:00:01', 610, '0'),
(123, 82, '项目度量数据库', '', 'yes', '', '', 'admin', '2020-01-09 14:55:08', '', '1970-01-01 00:00:01', 615, '0'),
(124, 86, '《量化项目管理及跟踪计划》', '', 'no', '', '', 'admin', '2020-01-09 14:59:04', '', '1970-01-01 00:00:01', 620, '0'),
(125, 84, '《决策分析报告》的决策分析评估表', '', 'no', '', '', 'admin', '2020-01-09 14:59:04', '', '1970-01-01 00:00:01', 625, '0'),
(126, 83, '《量化项目计划及跟踪表》', '', 'no', '', '', 'admin', '2020-01-09 14:59:04', '', '1970-01-01 00:00:01', 630, '0'),
(127, 87, '《决策分析报告》的评分表', '', 'no', '', '', 'admin', '2020-01-09 14:59:04', '', '1970-01-01 00:00:01', 635, '0'),
(128, 88, '《决策分析报告》的评分表', '', 'no', '', '', 'admin', '2020-01-09 14:59:04', '', '1970-01-01 00:00:01', 640, '0'),
(129, 89, '《决策分析报告》', '', 'no', '', '', 'admin', '2020-01-09 14:59:04', '', '1970-01-01 00:00:01', 645, '0'),
(130, 90, '《技术可行性分析报告》', '', '', '', '', 'admin', '2020-01-09 11:01:52', '', '1970-01-01 00:00:01', 25, '0'),
(131, 91, '《项目预算表》', '', '', '', '', 'admin', '2020-01-09 11:17:27', '', '1970-01-01 00:00:01', 30, '0'),
(132, 92, '《立项申请报告》', '', '', '', '', 'admin', '2020-01-09 11:17:50', '', '1970-01-01 00:00:01', 35, '0'),
(133, 93, '《项目投标书》', '不涉及投标', '', '', '', 'admin', '2020-01-09 11:18:12', '', '1970-01-01 00:00:01', 40, '0'),
(134, 94, '《项目估算报告》', '', '', '', '', 'admin', '2020-01-09 11:18:41', '', '1970-01-01 00:00:01', 45, '0'),
(135, 94, '《功能点估算》', '', '', '', '', 'admin', '2020-01-09 11:18:41', '', '1970-01-01 00:00:01', 50, '0'),
(136, 95, '《PDP说明》', '', '', '', '', 'admin', '2020-01-09 11:18:54', '', '1970-01-01 00:00:01', 55, '0'),
(137, 96, '《项目进度表》', '', '', '', '', 'admin', '2020-01-09 11:19:46', '', '1970-01-01 00:00:01', 60, '0'),
(138, 96, '《项目计划》及其下属计划', '', '', '', '', 'admin', '2020-01-09 11:19:46', '', '1970-01-01 00:00:01', 65, '0'),
(139, 96, '《风险管理计划及跟踪表》', '', '', '', '', 'admin', '2020-01-09 11:19:46', '', '1970-01-01 00:00:01', 70, '0'),
(140, 96, '《项目资源计划》', '', '', '', '', 'admin', '2020-01-09 11:19:46', '', '1970-01-01 00:00:01', 75, '0'),
(141, 96, '《干系人计划》', '', '', '', '', 'admin', '2020-01-09 11:19:46', '', '1970-01-01 00:00:01', 80, '0'),
(142, 96, '《同行评审计划》', '', '', '', '', 'admin', '2020-01-09 11:19:46', '', '1970-01-01 00:00:01', 85, '0'),
(143, 96, '《质量保证计划》', '', '', '', '', 'admin', '2020-01-09 11:19:46', '', '1970-01-01 00:00:01', 90, '0'),
(144, 96, '《配置管理计划》', '', '', '', '', 'admin', '2020-01-09 11:19:46', '', '1970-01-01 00:00:01', 95, '0'),
(145, 97, '《同行评审通知》', '', '', '', '', 'admin', '2020-01-09 11:20:16', '', '1970-01-01 00:00:01', 100, '0'),
(146, 97, '《评审准备表》', '', '', '', '', 'admin', '2020-01-09 11:20:16', '', '1970-01-01 00:00:01', 105, '0'),
(147, 97, '《同行评审报告》', '', '', '', '', 'admin', '2020-01-09 11:20:17', '', '1970-01-01 00:00:01', 110, '0'),
(148, 98, '《里程碑报告》', '', 'yes', '', '', 'admin', '2020-01-09 13:44:11', '', '1970-01-01 00:00:01', 115, '0'),
(149, 98, '《项目周报》', '', 'yes', '', '', 'admin', '2020-01-09 13:44:11', '', '1970-01-01 00:00:01', 120, '0'),
(150, 99, '《项目周报》', '', 'yes', '', '', 'admin', '2020-01-09 13:44:11', '', '1970-01-01 00:00:01', 125, '0'),
(151, 99, '《会议纪要》', '', 'yes', '', '', 'admin', '2020-01-09 13:44:11', '', '1970-01-01 00:00:01', 130, '0'),
(152, 100, '《里程碑报告》', '', 'yes', '', '', 'admin', '2020-01-09 13:44:11', '', '1970-01-01 00:00:01', 135, '0'),
(153, 100, '《里程碑会议纪要》', '', 'yes', '', '', 'admin', '2020-01-09 13:44:11', '', '1970-01-01 00:00:01', 140, '0'),
(154, 101, '《计划变更申请》', '', 'no', '', '', 'admin', '2020-01-09 13:44:11', '', '1970-01-01 00:00:01', 145, '0'),
(155, 102, '《风险管理计划及跟踪表》', '', '', '', '', 'admin', '2020-01-09 13:45:53', '', '1970-01-01 00:00:01', 150, '0'),
(156, 103, '《风险管理计划及跟踪表》', '', '', '', '', 'admin', '2020-01-09 13:45:53', '', '1970-01-01 00:00:01', 155, '0'),
(157, 103, '《风险管理报告》', '', '', '', '', 'admin', '2020-01-09 13:45:53', '', '1970-01-01 00:00:01', 160, '0'),
(158, 104, '《风险管理计划及跟踪表》', '', '', '', '', 'admin', '2020-01-09 13:45:53', '', '1970-01-01 00:00:01', 165, '0'),
(159, 105, '《异常处理申请表》', '', '', '', '', 'admin', '2020-01-09 13:45:53', '', '1970-01-01 00:00:01', 170, '0'),
(160, 105, '《风险管理计划及跟踪表》', '', '', '', '', 'admin', '2020-01-09 13:45:53', '', '1970-01-01 00:00:01', 175, '0'),
(161, 106, '《风险管理报告》', '', '', '', '', 'admin', '2020-01-09 13:45:53', '', '1970-01-01 00:00:01', 180, '0'),
(162, 106, '《风险管理计划及跟踪表》', '', '', '', '', 'admin', '2020-01-09 13:45:53', '', '1970-01-01 00:00:01', 185, '0'),
(163, 107, '《风险列表库》', '', '', '', '', 'admin', '2020-01-09 13:45:53', '', '1970-01-01 00:00:01', 190, '0'),
(164, 108, '《代码复用总结》', '', '', '', '', 'admin', '2020-01-09 13:46:26', '', '1970-01-01 00:00:01', 195, '0'),
(165, 110, '《结项报告》', '', '', '', '', 'admin', '2020-01-09 13:46:26', '', '1970-01-01 00:00:01', 200, '0'),
(166, 112, '《量化项目管理及跟踪计划》', '', 'yes', '', '', 'admin', '2020-01-09 13:46:46', '', '1970-01-01 00:00:01', 205, '0'),
(167, 113, '《用户需求调查单》', '', 'yes', '', '', 'admin', '2020-01-09 14:08:58', '', '1970-01-01 00:00:01', 210, '0'),
(168, 113, '《用户需求说明书》', '', 'yes', '', '', 'admin', '2020-01-09 14:08:58', '', '1970-01-01 00:00:01', 215, '0'),
(169, 114, '《评审通知》', '', 'yes', '', '', 'admin', '2020-01-09 14:08:58', '', '1970-01-01 00:00:01', 220, '0'),
(170, 114, '《同行评审准备表》', '', 'yes', '', '', 'admin', '2020-01-09 14:08:58', '', '1970-01-01 00:00:01', 225, '0'),
(171, 114, '《同行评审报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:08:58', '', '1970-01-01 00:00:01', 230, '0'),
(172, 115, '《产品需求规格说明书》', '', 'yes', '', '', 'admin', '2020-01-09 14:08:58', '', '1970-01-01 00:00:01', 235, '0'),
(173, 116, '《评审通知》', '', 'yes', '', '', 'admin', '2020-01-09 14:08:58', '', '1970-01-01 00:00:01', 240, '0'),
(174, 116, ' 《同行评审准备表》', '', 'yes', '', '', 'admin', '2020-01-09 14:08:58', '', '1970-01-01 00:00:01', 245, '0'),
(175, 116, ' 《同行评审报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:08:58', '', '1970-01-01 00:00:01', 250, '0'),
(176, 117, '《需求变更记录》', '', '', '', '', 'admin', '2020-01-09 14:08:58', '', '1970-01-01 00:00:01', 255, '0'),
(177, 117, '《用户需求说明书》', '', '', '', '', 'admin', '2020-01-09 14:08:58', '', '1970-01-01 00:00:01', 260, '0'),
(178, 117, '《软件需求规格说明书》', '', '', '', '', 'admin', '2020-01-09 14:08:58', '', '1970-01-01 00:00:01', 265, '0'),
(179, 118, '《概要设计说明书》', '', 'yes', '', '', 'admin', '2020-01-09 14:20:09', '', '1970-01-01 00:00:01', 270, '0'),
(180, 119, '《评审通知》', '', 'yes', '', '', 'admin', '2020-01-09 14:20:09', '', '1970-01-01 00:00:01', 275, '0'),
(181, 119, '《同行评审准备表》', '', 'yes', '', '', 'admin', '2020-01-09 14:20:09', '', '1970-01-01 00:00:01', 280, '0'),
(182, 119, '《同行评审报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:20:09', '', '1970-01-01 00:00:01', 285, '0'),
(183, 120, '《模块设计说明书》', '', 'no', '', '', 'admin', '2020-01-09 14:20:09', '', '1970-01-01 00:00:01', 290, '0'),
(184, 120, '《数据库设计说明书》', '', 'yes', '', '', 'admin', '2020-01-09 14:20:09', '', '1970-01-01 00:00:01', 295, '0'),
(185, 120, '《用户界面设计说明书》', '', 'no', '', '', 'admin', '2020-01-09 14:20:09', '', '1970-01-01 00:00:01', 300, '0'),
(186, 121, '《评审通知》', '', 'no', '', '', 'admin', '2020-01-09 14:20:09', '', '1970-01-01 00:00:01', 305, '0'),
(187, 121, '《同行评审准备表》', '', 'no', '', '', 'admin', '2020-01-09 14:20:09', '', '1970-01-01 00:00:01', 310, '0'),
(188, 121, '《同行评审报告》', '', 'no', '', '', 'admin', '2020-01-09 14:20:09', '', '1970-01-01 00:00:01', 315, '0'),
(189, 128, '《实现与测试计划》', '', 'yes', '', '', 'admin', '2020-01-09 14:22:52', '', '1970-01-01 00:00:01', 320, '0'),
(190, 128, '《单板硬件调试和单元测试计划》', '', 'yes', '', '', 'admin', '2020-01-09 14:22:52', '', '1970-01-01 00:00:01', 325, '0'),
(191, 128, '《项目进度表》中“实现与测试”部分', '', 'yes', '', '', 'admin', '2020-01-09 14:22:52', '', '1970-01-01 00:00:01', 330, '0'),
(192, 129, '产品数据库', '', '', '', '', 'admin', '2020-01-09 14:22:52', '', '1970-01-01 00:00:01', 335, '0'),
(193, 130, '模块代码', '', '', '', '', 'admin', '2020-01-09 14:22:52', '', '1970-01-01 00:00:01', 340, '0'),
(194, 131, '《代码质量检查记录单》', '', '', '', '', 'admin', '2020-01-09 14:22:52', '', '1970-01-01 00:00:01', 345, '0'),
(195, 132, '《单元测试缺陷统计分析报告》', '', '', '', '', 'admin', '2020-01-09 14:22:52', '', '1970-01-01 00:00:01', 350, '0'),
(196, 133, 'bugzilla缺陷记录', '', '', '', '', 'admin', '2020-01-09 14:22:52', '', '1970-01-01 00:00:01', 355, '0'),
(197, 134, '《系统集成说明书》', '', '', '', '', 'admin', '2020-01-09 14:22:52', '', '1970-01-01 00:00:01', 360, '0'),
(198, 135, '《集成测试用例》', '', '', '', '', 'admin', '2020-01-09 14:22:52', '', '1970-01-01 00:00:01', 365, '0'),
(199, 136, '《评审通知》 ', '', '', '', '', 'admin', '2020-01-09 14:22:52', '', '1970-01-01 00:00:01', 370, '0'),
(200, 136, '《同行评审准备表》 ', '', '', '', '', 'admin', '2020-01-09 14:22:52', '', '1970-01-01 00:00:01', 375, '0'),
(201, 136, '《同行评审报告》', '', '', '', '', 'admin', '2020-01-09 14:22:52', '', '1970-01-01 00:00:01', 380, '0'),
(202, 137, '《集成测试报告》', '', '', '', '', 'admin', '2020-01-09 14:22:52', '', '1970-01-01 00:00:01', 385, '0'),
(203, 138, 'bugzilla缺陷记录', '', '', '', '', 'admin', '2020-01-09 14:22:52', '', '1970-01-01 00:00:01', 390, '0'),
(204, 138, '《用户操作手册》 ', '', '', '', '', 'admin', '2020-01-09 14:22:52', '', '1970-01-01 00:00:01', 395, '0'),
(205, 138, '《安装手册》', '', '', '', '', 'admin', '2020-01-09 14:22:52', '', '1970-01-01 00:00:01', 400, '0'),
(206, 140, '《系统测试计划》', '', 'yes', '', '', 'admin', '2020-01-09 14:25:16', '', '1970-01-01 00:00:01', 405, '0'),
(207, 141, '《评审通知》', '', 'yes', '', '', 'admin', '2020-01-09 14:25:16', '', '1970-01-01 00:00:01', 410, '0'),
(208, 141, '《同行评审准备表》', '', 'yes', '', '', 'admin', '2020-01-09 14:25:16', '', '1970-01-01 00:00:01', 415, '0'),
(209, 141, '《同行评审报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:25:16', '', '1970-01-01 00:00:01', 420, '0'),
(210, 142, '《系统测试用例》', '', 'yes', '', '', 'admin', '2020-01-09 14:25:16', '', '1970-01-01 00:00:01', 425, '0'),
(211, 143, '《评审通知》', '', 'yes', '', '', 'admin', '2020-01-09 14:25:16', '', '1970-01-01 00:00:01', 430, '0'),
(212, 143, '《同行评审准备表》', '', 'yes', '', '', 'admin', '2020-01-09 14:25:16', '', '1970-01-01 00:00:01', 435, '0'),
(213, 143, '《同行评审报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:25:16', '', '1970-01-01 00:00:01', 440, '0'),
(214, 144, 'bugzilla缺陷跟踪系统记录项', '', 'yes', '', '', 'admin', '2020-01-09 14:25:16', '', '1970-01-01 00:00:01', 445, '0'),
(215, 144, '《系统测试分析报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:25:16', '', '1970-01-01 00:00:01', 450, '0'),
(216, 144, '《缺陷统计分析报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:25:16', '', '1970-01-01 00:00:01', 455, '0'),
(217, 145, '《产品打包清单》', '', 'yes', '', '', 'admin', '2020-01-09 14:25:16', '', '1970-01-01 00:00:01', 460, '0'),
(218, 146, '发布光盘、纸质支持文档', '', 'yes', '', '', 'admin', '2020-01-09 14:26:52', '', '1970-01-01 00:00:01', 465, '0'),
(219, 147, '《交接签收单》', '', 'yes', '', '', 'admin', '2020-01-09 14:26:52', '', '1970-01-01 00:00:01', 470, '0'),
(220, 148, '《工作联系单》', '', 'yes', '', '', 'admin', '2020-01-09 14:26:52', '', '1970-01-01 00:00:01', 475, '0'),
(221, 148, '《工作记录单》', '', 'yes', '', '', 'admin', '2020-01-09 14:26:52', '', '1970-01-01 00:00:01', 480, '0'),
(222, 148, '《交接签收单》', '', 'yes', '', '', 'admin', '2020-01-09 14:26:52', '', '1970-01-01 00:00:01', 485, '0'),
(223, 148, '《安装调试信息》', '', 'yes', '', '', 'admin', '2020-01-09 14:26:52', '', '1970-01-01 00:00:01', 490, '0'),
(224, 150, 'bugzilla缺陷记录项', '', 'yes', '', '', 'admin', '2020-01-09 14:26:52', '', '1970-01-01 00:00:01', 495, '0'),
(225, 150, '会议纪要等文档', '', 'yes', '', '', 'admin', '2020-01-09 14:26:52', '', '1970-01-01 00:00:01', 500, '0'),
(226, 151, '《交接验收单》', '', 'yes', '', '', 'admin', '2020-01-09 14:26:52', '', '1970-01-01 00:00:01', 505, '0'),
(227, 151, '《客户验收报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:26:52', '', '1970-01-01 00:00:01', 510, '0'),
(228, 152, '初步《质量保证计划及跟踪表》', '', 'yes', '', '', 'admin', '2020-01-09 14:28:18', '', '1970-01-01 00:00:01', 515, '0'),
(229, 153, '详细《质量保证计划及跟踪表》', '', 'yes', '', '', 'admin', '2020-01-09 14:28:18', '', '1970-01-01 00:00:01', 520, '0'),
(230, 154, '《过程审计检查表》', '', 'yes', '', '', 'admin', '2020-01-09 14:28:18', '', '1970-01-01 00:00:01', 525, '0'),
(231, 154, '《产品审计检查表》', '', 'yes', '', '', 'admin', '2020-01-09 14:28:18', '', '1970-01-01 00:00:01', 530, '0'),
(232, 154, '《QA审计报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:28:18', '', '1970-01-01 00:00:01', 535, '0'),
(233, 154, '《QA问题报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:28:18', '', '1970-01-01 00:00:01', 540, '0'),
(234, 154, '《QA里程碑报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:28:18', '', '1970-01-01 00:00:01', 545, '0'),
(235, 154, '《QA周报》', '', 'yes', '', '', 'admin', '2020-01-09 14:28:18', '', '1970-01-01 00:00:01', 550, '0'),
(236, 155, '《QA审计报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:28:18', '', '1970-01-01 00:00:01', 555, '0'),
(237, 155, '《QA问题报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:28:18', '', '1970-01-01 00:00:01', 560, '0'),
(238, 156, '《QA总结报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:28:18', '', '1970-01-01 00:00:01', 565, '0'),
(239, 158, '《配置管理计划》', '', 'yes', '', '', 'admin', '2020-01-09 14:55:08', '', '1970-01-01 00:00:01', 570, '0'),
(240, 158, '《配置项计划及跟踪表》', '', 'yes', '', '', 'admin', '2020-01-09 14:55:08', '', '1970-01-01 00:00:01', 575, '0'),
(241, 158, '《基线计划及跟踪表》', '', 'yes', '', '', 'admin', '2020-01-09 14:55:08', '', '1970-01-01 00:00:01', 580, '0'),
(242, 159, '《配置库管理报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:55:08', '', '1970-01-01 00:00:01', 585, '0'),
(243, 160, '《配置项计划及跟踪表》', '', 'yes', '', '', 'admin', '2020-01-09 14:55:08', '', '1970-01-01 00:00:01', 590, '0'),
(244, 161, '《基线计划及跟踪表》', '', 'yes', '', '', 'admin', '2020-01-09 14:55:08', '', '1970-01-01 00:00:01', 595, '0'),
(245, 162, '《变更申请书》', '', 'yes', '', '', 'admin', '2020-01-09 14:55:08', '', '1970-01-01 00:00:01', 600, '0'),
(246, 163, '《配置审计报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:55:08', '', '1970-01-01 00:00:01', 605, '0'),
(247, 166, '《度量分析计划》', '', 'yes', '', '', 'admin', '2020-01-09 14:55:08', '', '1970-01-01 00:00:01', 610, '0'),
(248, 168, '项目度量数据库', '', 'yes', '', '', 'admin', '2020-01-09 14:55:08', '', '1970-01-01 00:00:01', 615, '0'),
(249, 169, '《量化项目计划及跟踪表》', '', 'no', '', '', 'admin', '2020-01-09 14:59:04', '', '1970-01-01 00:00:01', 630, '0'),
(250, 170, '《技术可行性分析报告》', '', '', '', '', 'admin', '2020-01-09 11:01:52', '', NULL, 25, '0'),
(251, 171, '《项目预算表》', '', '', '', '', 'admin', '2020-01-09 11:17:27', '', NULL, 30, '0'),
(252, 172, '《立项申请报告》', '', '', '', '', 'admin', '2020-01-09 11:17:50', '', NULL, 35, '0'),
(253, 173, '《项目投标书》', '不涉及投标', '', '', '', 'admin', '2020-01-09 11:18:12', '', NULL, 40, '0'),
(254, 174, '《项目估算报告》', '', '', '', '', 'admin', '2020-01-09 11:18:41', '', NULL, 45, '0'),
(255, 174, '《功能点估算》', '', '', '', '', 'admin', '2020-01-09 11:18:41', '', NULL, 50, '0'),
(256, 175, '《PDP说明》', '', '', '', '', 'admin', '2020-01-09 11:18:54', '', NULL, 55, '0'),
(257, 176, '《项目进度表》', '', '', '', '', 'admin', '2020-01-09 11:19:46', '', NULL, 60, '0'),
(258, 176, '《项目计划》及其下属计划', '', '', '', '', 'admin', '2020-01-09 11:19:46', '', NULL, 65, '0'),
(259, 176, '《风险管理计划及跟踪表》', '', '', '', '', 'admin', '2020-01-09 11:19:46', '', NULL, 70, '0'),
(260, 176, '《项目资源计划》', '', '', '', '', 'admin', '2020-01-09 11:19:46', '', NULL, 75, '0'),
(261, 176, '《干系人计划》', '', '', '', '', 'admin', '2020-01-09 11:19:46', '', NULL, 80, '0'),
(262, 176, '《同行评审计划》', '', '', '', '', 'admin', '2020-01-09 11:19:46', '', NULL, 85, '0'),
(263, 176, '《质量保证计划》', '', '', '', '', 'admin', '2020-01-09 11:19:46', '', NULL, 90, '0'),
(264, 176, '《配置管理计划》', '', '', '', '', 'admin', '2020-01-09 11:19:46', '', NULL, 95, '0'),
(265, 177, '《同行评审通知》', '', '', '', '', 'admin', '2020-01-09 11:20:16', '', NULL, 100, '0'),
(266, 177, '《评审准备表》', '', '', '', '', 'admin', '2020-01-09 11:20:16', '', NULL, 105, '0'),
(267, 177, '《同行评审报告》', '', '', '', '', 'admin', '2020-01-09 11:20:17', '', NULL, 110, '0'),
(268, 178, '《里程碑报告》', '', 'yes', '', '', 'admin', '2020-01-09 13:44:11', '', NULL, 115, '0'),
(269, 178, '《项目周报》', '', 'yes', '', '', 'admin', '2020-01-09 13:44:11', '', NULL, 120, '0'),
(270, 179, '《项目周报》', '', 'yes', '', '', 'admin', '2020-01-09 13:44:11', '', NULL, 125, '0'),
(271, 179, '《会议纪要》', '', 'yes', '', '', 'admin', '2020-01-09 13:44:11', '', NULL, 130, '0'),
(272, 180, '《里程碑报告》', '', 'yes', '', '', 'admin', '2020-01-09 13:44:11', '', NULL, 135, '0'),
(273, 180, '《里程碑会议纪要》', '', 'yes', '', '', 'admin', '2020-01-09 13:44:11', '', NULL, 140, '0'),
(274, 181, '《计划变更申请》', '', 'no', '', '', 'admin', '2020-01-09 13:44:11', '', NULL, 145, '0'),
(275, 182, '《风险管理计划及跟踪表》', '', '', '', '', 'admin', '2020-01-09 13:45:53', '', NULL, 150, '0'),
(276, 183, '《风险管理计划及跟踪表》', '', '', '', '', 'admin', '2020-01-09 13:45:53', '', NULL, 155, '0'),
(277, 183, '《风险管理报告》', '', '', '', '', 'admin', '2020-01-09 13:45:53', '', NULL, 160, '0'),
(278, 184, '《风险管理计划及跟踪表》', '', '', '', '', 'admin', '2020-01-09 13:45:53', '', NULL, 165, '0'),
(279, 185, '《异常处理申请表》', '', '', '', '', 'admin', '2020-01-09 13:45:53', '', NULL, 170, '0'),
(280, 185, '《风险管理计划及跟踪表》', '', '', '', '', 'admin', '2020-01-09 13:45:53', '', NULL, 175, '0'),
(281, 186, '《风险管理报告》', '', '', '', '', 'admin', '2020-01-09 13:45:53', '', NULL, 180, '0'),
(282, 186, '《风险管理计划及跟踪表》', '', '', '', '', 'admin', '2020-01-09 13:45:53', '', NULL, 185, '0'),
(283, 187, '《风险列表库》', '', '', '', '', 'admin', '2020-01-09 13:45:53', '', NULL, 190, '0'),
(284, 188, '《代码复用总结》', '', '', '', '', 'admin', '2020-01-09 13:46:26', '', NULL, 195, '0'),
(285, 190, '《结项报告》', '', '', '', '', 'admin', '2020-01-09 13:46:26', '', NULL, 200, '0'),
(286, 192, '《量化项目管理及跟踪计划》', '', 'yes', '', '', 'admin', '2020-01-09 13:46:46', '', NULL, 205, '0'),
(287, 193, '《用户需求调查单》', '', 'yes', '', '', 'admin', '2020-01-09 14:08:58', '', NULL, 210, '0'),
(288, 193, '《用户需求说明书》', '', 'yes', '', '', 'admin', '2020-01-09 14:08:58', '', NULL, 215, '0'),
(289, 194, '《评审通知》', '', 'yes', '', '', 'admin', '2020-01-09 14:08:58', '', NULL, 220, '0'),
(290, 194, '《同行评审准备表》', '', 'yes', '', '', 'admin', '2020-01-09 14:08:58', '', NULL, 225, '0'),
(291, 194, '《同行评审报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:08:58', '', NULL, 230, '0'),
(292, 195, '《产品需求规格说明书》', '', 'yes', '', '', 'admin', '2020-01-09 14:08:58', '', NULL, 235, '0'),
(293, 196, '《评审通知》', '', 'yes', '', '', 'admin', '2020-01-09 14:08:58', '', NULL, 240, '0'),
(294, 196, ' 《同行评审准备表》', '', 'yes', '', '', 'admin', '2020-01-09 14:08:58', '', NULL, 245, '0'),
(295, 196, ' 《同行评审报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:08:58', '', NULL, 250, '0'),
(296, 197, '《需求变更记录》', '', '', '', '', 'admin', '2020-01-09 14:08:58', '', NULL, 255, '0'),
(297, 197, '《用户需求说明书》', '', '', '', '', 'admin', '2020-01-09 14:08:58', '', NULL, 260, '0'),
(298, 197, '《软件需求规格说明书》', '', '', '', '', 'admin', '2020-01-09 14:08:58', '', NULL, 265, '0'),
(299, 198, '《概要设计说明书》', '', 'yes', '', '', 'admin', '2020-01-09 14:20:09', '', NULL, 270, '0'),
(300, 199, '《评审通知》', '', 'yes', '', '', 'admin', '2020-01-09 14:20:09', '', NULL, 275, '0'),
(301, 199, '《同行评审准备表》', '', 'yes', '', '', 'admin', '2020-01-09 14:20:09', '', NULL, 280, '0'),
(302, 199, '《同行评审报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:20:09', '', NULL, 285, '0'),
(303, 200, '《模块设计说明书》', '', 'no', '', '', 'admin', '2020-01-09 14:20:09', '', NULL, 290, '0'),
(304, 200, '《数据库设计说明书》', '', 'yes', '', '', 'admin', '2020-01-09 14:20:09', '', NULL, 295, '0'),
(305, 200, '《用户界面设计说明书》', '', 'no', '', '', 'admin', '2020-01-09 14:20:09', '', NULL, 300, '0'),
(306, 201, '《评审通知》', '', 'no', '', '', 'admin', '2020-01-09 14:20:09', '', NULL, 305, '0'),
(307, 201, '《同行评审准备表》', '', 'no', '', '', 'admin', '2020-01-09 14:20:09', '', NULL, 310, '0'),
(308, 201, '《同行评审报告》', '', 'no', '', '', 'admin', '2020-01-09 14:20:09', '', NULL, 315, '0'),
(309, 202, '《实现与测试计划》', '', 'yes', '', '', 'admin', '2020-01-09 14:22:52', '', NULL, 320, '0'),
(310, 202, '《单板硬件调试和单元测试计划》', '', 'yes', '', '', 'admin', '2020-01-09 14:22:52', '', NULL, 325, '0'),
(311, 202, '《项目进度表》中“实现与测试”部分', '', 'yes', '', '', 'admin', '2020-01-09 14:22:52', '', NULL, 330, '0'),
(312, 203, '产品数据库', '', '', '', '', 'admin', '2020-01-09 14:22:52', '', NULL, 335, '0'),
(313, 204, '模块代码', '', '', '', '', 'admin', '2020-01-09 14:22:52', '', NULL, 340, '0'),
(314, 205, '《代码质量检查记录单》', '', '', '', '', 'admin', '2020-01-09 14:22:52', '', NULL, 345, '0'),
(315, 206, '《单元测试缺陷统计分析报告》', '', '', '', '', 'admin', '2020-01-09 14:22:52', '', NULL, 350, '0'),
(316, 207, '禅道缺陷记录', '', '', '', '', 'admin', '2020-01-09 14:22:52', '', NULL, 355, '0'),
(317, 208, '《系统集成说明书》', '', '', '', '', 'admin', '2020-01-09 14:22:52', '', NULL, 360, '0'),
(318, 209, '《集成测试用例》', '', '', '', '', 'admin', '2020-01-09 14:22:52', '', NULL, 365, '0'),
(319, 210, '《评审通知》 ', '', '', '', '', 'admin', '2020-01-09 14:22:52', '', NULL, 370, '0'),
(320, 210, '《同行评审准备表》 ', '', '', '', '', 'admin', '2020-01-09 14:22:52', '', NULL, 375, '0'),
(321, 210, '《同行评审报告》', '', '', '', '', 'admin', '2020-01-09 14:22:52', '', NULL, 380, '0'),
(322, 211, '《集成测试报告》', '', '', '', '', 'admin', '2020-01-09 14:22:52', '', NULL, 385, '0'),
(323, 212, '禅道缺陷记录', '', '', '', '', 'admin', '2020-01-09 14:22:52', '', NULL, 390, '0'),
(324, 212, '《用户操作手册》 ', '', '', '', '', 'admin', '2020-01-09 14:22:52', '', NULL, 395, '0'),
(325, 212, '《安装手册》', '', '', '', '', 'admin', '2020-01-09 14:22:52', '', NULL, 400, '0'),
(326, 214, '《系统测试计划》', '', 'yes', '', '', 'admin', '2020-01-09 14:25:16', '', NULL, 405, '0'),
(327, 215, '《评审通知》', '', 'yes', '', '', 'admin', '2020-01-09 14:25:16', '', NULL, 410, '0'),
(328, 215, '《同行评审准备表》', '', 'yes', '', '', 'admin', '2020-01-09 14:25:16', '', NULL, 415, '0'),
(329, 215, '《同行评审报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:25:16', '', NULL, 420, '0'),
(330, 216, '《系统测试用例》', '', 'yes', '', '', 'admin', '2020-01-09 14:25:16', '', NULL, 425, '0'),
(331, 217, '《评审通知》', '', 'yes', '', '', 'admin', '2020-01-09 14:25:16', '', NULL, 430, '0'),
(332, 217, '《同行评审准备表》', '', 'yes', '', '', 'admin', '2020-01-09 14:25:16', '', NULL, 435, '0'),
(333, 217, '《同行评审报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:25:16', '', NULL, 440, '0'),
(334, 218, '禅道缺陷跟踪系统记录项', '', 'yes', '', '', 'admin', '2020-01-09 14:25:16', '', NULL, 445, '0'),
(335, 218, '《系统测试分析报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:25:16', '', NULL, 450, '0'),
(336, 218, '《缺陷统计分析报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:25:16', '', NULL, 455, '0'),
(337, 219, '《产品打包清单》', '', 'yes', '', '', 'admin', '2020-01-09 14:25:16', '', NULL, 460, '0'),
(338, 220, '发布光盘、纸质支持文档', '', 'yes', '', '', 'admin', '2020-01-09 14:26:52', '', NULL, 465, '0'),
(339, 221, '《交接签收单》', '', 'yes', '', '', 'admin', '2020-01-09 14:26:52', '', NULL, 470, '0'),
(340, 222, '《工作联系单》', '', 'yes', '', '', 'admin', '2020-01-09 14:26:52', '', NULL, 475, '0'),
(341, 222, '《工作记录单》', '', 'yes', '', '', 'admin', '2020-01-09 14:26:52', '', NULL, 480, '0'),
(342, 222, '《交接签收单》', '', 'yes', '', '', 'admin', '2020-01-09 14:26:52', '', NULL, 485, '0'),
(343, 222, '《安装调试信息》', '', 'yes', '', '', 'admin', '2020-01-09 14:26:52', '', NULL, 490, '0'),
(344, 224, '禅道缺陷记录项', '', 'yes', '', '', 'admin', '2020-01-09 14:26:52', '', NULL, 495, '0'),
(345, 224, '会议纪要等文档', '', 'yes', '', '', 'admin', '2020-01-09 14:26:52', '', NULL, 500, '0'),
(346, 225, '《交接验收单》', '', 'yes', '', '', 'admin', '2020-01-09 14:26:52', '', NULL, 505, '0'),
(347, 225, '《客户验收报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:26:52', '', NULL, 510, '0'),
(348, 226, '初步《质量保证计划及跟踪表》', '', 'yes', '', '', 'admin', '2020-01-09 14:28:18', '', NULL, 515, '0'),
(349, 227, '详细《质量保证计划及跟踪表》', '', 'yes', '', '', 'admin', '2020-01-09 14:28:18', '', NULL, 520, '0'),
(350, 228, '《过程审计检查表》', '', 'yes', '', '', 'admin', '2020-01-09 14:28:18', '', NULL, 525, '0'),
(351, 228, '《产品审计检查表》', '', 'yes', '', '', 'admin', '2020-01-09 14:28:18', '', NULL, 530, '0'),
(352, 228, '《QA审计报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:28:18', '', NULL, 535, '0'),
(353, 228, '《QA问题报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:28:18', '', NULL, 540, '0'),
(354, 228, '《QA里程碑报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:28:18', '', NULL, 545, '0'),
(355, 228, '《QA周报》', '', 'yes', '', '', 'admin', '2020-01-09 14:28:18', '', NULL, 550, '0'),
(356, 229, '《QA审计报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:28:18', '', NULL, 555, '0'),
(357, 229, '《QA问题报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:28:18', '', NULL, 560, '0'),
(358, 230, '《QA总结报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:28:18', '', NULL, 565, '0'),
(359, 232, '《配置管理计划》', '', 'yes', '', '', 'admin', '2020-01-09 14:55:08', '', NULL, 570, '0'),
(360, 232, '《配置项计划及跟踪表》', '', 'yes', '', '', 'admin', '2020-01-09 14:55:08', '', NULL, 575, '0'),
(361, 232, '《基线计划及跟踪表》', '', 'yes', '', '', 'admin', '2020-01-09 14:55:08', '', NULL, 580, '0'),
(362, 233, '《配置库管理报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:55:08', '', NULL, 585, '0'),
(363, 234, '《配置项计划及跟踪表》', '', 'yes', '', '', 'admin', '2020-01-09 14:55:08', '', NULL, 590, '0'),
(364, 235, '《基线计划及跟踪表》', '', 'yes', '', '', 'admin', '2020-01-09 14:55:08', '', NULL, 595, '0'),
(365, 236, '《变更申请书》', '', 'yes', '', '', 'admin', '2020-01-09 14:55:08', '', NULL, 600, '0'),
(366, 237, '《配置审计报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:55:08', '', NULL, 605, '0'),
(367, 230, '《度量分析计划》', '', 'yes', '', '', 'admin', '2020-01-09 14:55:08', '', NULL, 610, '0'),
(368, 232, '项目度量数据库', '', 'yes', '', '', 'admin', '2020-01-09 14:55:08', '', NULL, 615, '0'),
(369, 236, '《量化项目管理及跟踪计划》', '', 'no', '', '', 'admin', '2020-01-09 14:59:04', '', NULL, 620, '0'),
(370, 234, '《决策分析报告》的决策分析评估表', '', 'no', '', '', 'admin', '2020-01-09 14:59:04', '', NULL, 625, '0'),
(371, 233, '《量化项目计划及跟踪表》', '', 'no', '', '', 'admin', '2020-01-09 14:59:04', '', NULL, 630, '0'),
(372, 237, '《决策分析报告》的评分表', '', 'no', '', '', 'admin', '2020-01-09 14:59:04', '', NULL, 635, '0'),
(373, 238, '《决策分析报告》的评分表', '', 'no', '', '', 'admin', '2020-01-09 14:59:04', '', NULL, 640, '0'),
(374, 239, '《决策分析报告》', '', 'no', '', '', 'admin', '2020-01-09 14:59:04', '', NULL, 645, '0'),
(375, 250, '《技术可行性分析报告》', '', '', '', '', 'admin', '2020-01-09 11:01:52', '', NULL, 25, '0'),
(376, 251, '《项目预算表》', '', '', '', '', 'admin', '2020-01-09 11:17:27', '', NULL, 30, '0'),
(377, 252, '《立项申请报告》', '', '', '', '', 'admin', '2020-01-09 11:17:50', '', NULL, 35, '0'),
(378, 253, '《项目投标书》', '不涉及投标', '', '', '', 'admin', '2020-01-09 11:18:12', '', NULL, 40, '0'),
(379, 254, '《项目估算报告》', '', '', '', '', 'admin', '2020-01-09 11:18:41', '', NULL, 45, '0'),
(380, 254, '《功能点估算》', '', '', '', '', 'admin', '2020-01-09 11:18:41', '', NULL, 50, '0'),
(381, 255, '《PDP说明》', '', '', '', '', 'admin', '2020-01-09 11:18:54', '', NULL, 55, '0'),
(382, 256, '《项目进度表》', '', '', '', '', 'admin', '2020-01-09 11:19:46', '', NULL, 60, '0'),
(383, 256, '《项目计划》及其下属计划', '', '', '', '', 'admin', '2020-01-09 11:19:46', '', NULL, 65, '0'),
(384, 256, '《风险管理计划及跟踪表》', '', '', '', '', 'admin', '2020-01-09 11:19:46', '', NULL, 70, '0'),
(385, 256, '《项目资源计划》', '', '', '', '', 'admin', '2020-01-09 11:19:46', '', NULL, 75, '0'),
(386, 256, '《干系人计划》', '', '', '', '', 'admin', '2020-01-09 11:19:46', '', NULL, 80, '0'),
(387, 256, '《同行评审计划》', '', '', '', '', 'admin', '2020-01-09 11:19:46', '', NULL, 85, '0'),
(388, 256, '《质量保证计划》', '', '', '', '', 'admin', '2020-01-09 11:19:46', '', NULL, 90, '0'),
(389, 256, '《配置管理计划》', '', '', '', '', 'admin', '2020-01-09 11:19:46', '', NULL, 95, '0'),
(390, 257, '《同行评审通知》', '', '', '', '', 'admin', '2020-01-09 11:20:16', '', NULL, 100, '0'),
(391, 257, '《评审准备表》', '', '', '', '', 'admin', '2020-01-09 11:20:16', '', NULL, 105, '0'),
(392, 257, '《同行评审报告》', '', '', '', '', 'admin', '2020-01-09 11:20:17', '', NULL, 110, '0'),
(393, 258, '《里程碑报告》', '', 'yes', '', '', 'admin', '2020-01-09 13:44:11', '', NULL, 115, '0'),
(394, 258, '《项目周报》', '', 'yes', '', '', 'admin', '2020-01-09 13:44:11', '', NULL, 120, '0'),
(395, 259, '《项目周报》', '', 'yes', '', '', 'admin', '2020-01-09 13:44:11', '', NULL, 125, '0'),
(396, 259, '《会议纪要》', '', 'yes', '', '', 'admin', '2020-01-09 13:44:11', '', NULL, 130, '0'),
(397, 260, '《里程碑报告》', '', 'yes', '', '', 'admin', '2020-01-09 13:44:11', '', NULL, 135, '0'),
(398, 260, '《里程碑会议纪要》', '', 'yes', '', '', 'admin', '2020-01-09 13:44:11', '', NULL, 140, '0'),
(399, 261, '《计划变更申请》', '', 'no', '', '', 'admin', '2020-01-09 13:44:11', '', NULL, 145, '0'),
(400, 262, '《风险管理计划及跟踪表》', '', '', '', '', 'admin', '2020-01-09 13:45:53', '', NULL, 150, '0'),
(401, 263, '《风险管理计划及跟踪表》', '', '', '', '', 'admin', '2020-01-09 13:45:53', '', NULL, 155, '0'),
(402, 263, '《风险管理报告》', '', '', '', '', 'admin', '2020-01-09 13:45:53', '', NULL, 160, '0'),
(403, 264, '《风险管理计划及跟踪表》', '', '', '', '', 'admin', '2020-01-09 13:45:53', '', NULL, 165, '0'),
(404, 265, '《异常处理申请表》', '', '', '', '', 'admin', '2020-01-09 13:45:53', '', NULL, 170, '0'),
(405, 265, '《风险管理计划及跟踪表》', '', '', '', '', 'admin', '2020-01-09 13:45:53', '', NULL, 175, '0'),
(406, 266, '《风险管理报告》', '', '', '', '', 'admin', '2020-01-09 13:45:53', '', NULL, 180, '0'),
(407, 266, '《风险管理计划及跟踪表》', '', '', '', '', 'admin', '2020-01-09 13:45:53', '', NULL, 185, '0'),
(408, 267, '《风险列表库》', '', '', '', '', 'admin', '2020-01-09 13:45:53', '', NULL, 190, '0'),
(409, 268, '《代码复用总结》', '', '', '', '', 'admin', '2020-01-09 13:46:26', '', NULL, 195, '0'),
(410, 270, '《结项报告》', '', '', '', '', 'admin', '2020-01-09 13:46:26', '', NULL, 200, '0'),
(411, 272, '《量化项目管理及跟踪计划》', '', 'yes', '', '', 'admin', '2020-01-09 13:46:46', '', NULL, 205, '0'),
(412, 273, '《用户需求调查单》', '', 'yes', '', '', 'admin', '2020-01-09 14:08:58', '', NULL, 210, '0'),
(413, 273, '《用户需求说明书》', '', 'yes', '', '', 'admin', '2020-01-09 14:08:58', '', NULL, 215, '0'),
(414, 274, '《评审通知》', '', 'yes', '', '', 'admin', '2020-01-09 14:08:58', '', NULL, 220, '0'),
(415, 274, '《同行评审准备表》', '', 'yes', '', '', 'admin', '2020-01-09 14:08:58', '', NULL, 225, '0'),
(416, 274, '《同行评审报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:08:58', '', NULL, 230, '0'),
(417, 275, '《产品需求规格说明书》', '', 'yes', '', '', 'admin', '2020-01-09 14:08:58', '', NULL, 235, '0'),
(418, 276, '《评审通知》', '', 'yes', '', '', 'admin', '2020-01-09 14:08:58', '', NULL, 240, '0'),
(419, 276, ' 《同行评审准备表》', '', 'yes', '', '', 'admin', '2020-01-09 14:08:58', '', NULL, 245, '0'),
(420, 276, ' 《同行评审报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:08:58', '', NULL, 250, '0'),
(421, 277, '《需求变更记录》', '', '', '', '', 'admin', '2020-01-09 14:08:58', '', NULL, 255, '0'),
(422, 277, '《用户需求说明书》', '', '', '', '', 'admin', '2020-01-09 14:08:58', '', NULL, 260, '0'),
(423, 277, '《软件需求规格说明书》', '', '', '', '', 'admin', '2020-01-09 14:08:58', '', NULL, 265, '0'),
(424, 278, '《概要设计说明书》', '', 'yes', '', '', 'admin', '2020-01-09 14:20:09', '', NULL, 270, '0'),
(425, 279, '《评审通知》', '', 'yes', '', '', 'admin', '2020-01-09 14:20:09', '', NULL, 275, '0'),
(426, 279, '《同行评审准备表》', '', 'yes', '', '', 'admin', '2020-01-09 14:20:09', '', NULL, 280, '0'),
(427, 279, '《同行评审报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:20:09', '', NULL, 285, '0'),
(428, 280, '《模块设计说明书》', '', 'no', '', '', 'admin', '2020-01-09 14:20:09', '', NULL, 290, '0'),
(429, 280, '《数据库设计说明书》', '', 'yes', '', '', 'admin', '2020-01-09 14:20:09', '', NULL, 295, '0'),
(430, 280, '《用户界面设计说明书》', '', 'no', '', '', 'admin', '2020-01-09 14:20:09', '', NULL, 300, '0'),
(431, 281, '《评审通知》', '', 'no', '', '', 'admin', '2020-01-09 14:20:09', '', NULL, 305, '0'),
(432, 281, '《同行评审准备表》', '', 'no', '', '', 'admin', '2020-01-09 14:20:09', '', NULL, 310, '0'),
(433, 281, '《同行评审报告》', '', 'no', '', '', 'admin', '2020-01-09 14:20:09', '', NULL, 315, '0'),
(434, 288, '《实现与测试计划》', '', 'yes', '', '', 'admin', '2020-01-09 14:22:52', '', NULL, 320, '0'),
(435, 288, '《单板硬件调试和单元测试计划》', '', 'yes', '', '', 'admin', '2020-01-09 14:22:52', '', NULL, 325, '0'),
(436, 288, '《项目进度表》中“实现与测试”部分', '', 'yes', '', '', 'admin', '2020-01-09 14:22:52', '', NULL, 330, '0'),
(437, 289, '产品数据库', '', '', '', '', 'admin', '2020-01-09 14:22:52', '', NULL, 335, '0'),
(438, 290, '模块代码', '', '', '', '', 'admin', '2020-01-09 14:22:52', '', NULL, 340, '0'),
(439, 291, '《代码质量检查记录单》', '', '', '', '', 'admin', '2020-01-09 14:22:52', '', NULL, 345, '0'),
(440, 292, '《单元测试缺陷统计分析报告》', '', '', '', '', 'admin', '2020-01-09 14:22:52', '', NULL, 350, '0'),
(441, 293, 'bugzilla缺陷记录', '', '', '', '', 'admin', '2020-01-09 14:22:52', '', NULL, 355, '0'),
(442, 294, '《系统集成说明书》', '', '', '', '', 'admin', '2020-01-09 14:22:52', '', NULL, 360, '0'),
(443, 295, '《集成测试用例》', '', '', '', '', 'admin', '2020-01-09 14:22:52', '', NULL, 365, '0'),
(444, 296, '《评审通知》 ', '', '', '', '', 'admin', '2020-01-09 14:22:52', '', NULL, 370, '0'),
(445, 296, '《同行评审准备表》 ', '', '', '', '', 'admin', '2020-01-09 14:22:52', '', NULL, 375, '0'),
(446, 296, '《同行评审报告》', '', '', '', '', 'admin', '2020-01-09 14:22:52', '', NULL, 380, '0'),
(447, 297, '《集成测试报告》', '', '', '', '', 'admin', '2020-01-09 14:22:52', '', NULL, 385, '0'),
(448, 298, 'bugzilla缺陷记录', '', '', '', '', 'admin', '2020-01-09 14:22:52', '', NULL, 390, '0'),
(449, 298, '《用户操作手册》 ', '', '', '', '', 'admin', '2020-01-09 14:22:52', '', NULL, 395, '0'),
(450, 298, '《安装手册》', '', '', '', '', 'admin', '2020-01-09 14:22:52', '', NULL, 400, '0'),
(451, 300, '《系统测试计划》', '', 'yes', '', '', 'admin', '2020-01-09 14:25:16', '', NULL, 405, '0'),
(452, 301, '《评审通知》', '', 'yes', '', '', 'admin', '2020-01-09 14:25:16', '', NULL, 410, '0'),
(453, 301, '《同行评审准备表》', '', 'yes', '', '', 'admin', '2020-01-09 14:25:16', '', NULL, 415, '0'),
(454, 301, '《同行评审报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:25:16', '', NULL, 420, '0'),
(455, 302, '《系统测试用例》', '', 'yes', '', '', 'admin', '2020-01-09 14:25:16', '', NULL, 425, '0'),
(456, 303, '《评审通知》', '', 'yes', '', '', 'admin', '2020-01-09 14:25:16', '', NULL, 430, '0'),
(457, 303, '《同行评审准备表》', '', 'yes', '', '', 'admin', '2020-01-09 14:25:16', '', NULL, 435, '0'),
(458, 303, '《同行评审报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:25:16', '', NULL, 440, '0'),
(459, 304, 'bugzilla缺陷跟踪系统记录项', '', 'yes', '', '', 'admin', '2020-01-09 14:25:16', '', NULL, 445, '0'),
(460, 304, '《系统测试分析报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:25:16', '', NULL, 450, '0'),
(461, 304, '《缺陷统计分析报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:25:16', '', NULL, 455, '0'),
(462, 305, '《产品打包清单》', '', 'yes', '', '', 'admin', '2020-01-09 14:25:16', '', NULL, 460, '0'),
(463, 306, '发布光盘、纸质支持文档', '', 'yes', '', '', 'admin', '2020-01-09 14:26:52', '', NULL, 465, '0'),
(464, 307, '《交接签收单》', '', 'yes', '', '', 'admin', '2020-01-09 14:26:52', '', NULL, 470, '0'),
(465, 308, '《工作联系单》', '', 'yes', '', '', 'admin', '2020-01-09 14:26:52', '', NULL, 475, '0'),
(466, 308, '《工作记录单》', '', 'yes', '', '', 'admin', '2020-01-09 14:26:52', '', NULL, 480, '0'),
(467, 308, '《交接签收单》', '', 'yes', '', '', 'admin', '2020-01-09 14:26:52', '', NULL, 485, '0'),
(468, 308, '《安装调试信息》', '', 'yes', '', '', 'admin', '2020-01-09 14:26:52', '', NULL, 490, '0'),
(469, 310, 'bugzilla缺陷记录项', '', 'yes', '', '', 'admin', '2020-01-09 14:26:52', '', NULL, 495, '0'),
(470, 310, '会议纪要等文档', '', 'yes', '', '', 'admin', '2020-01-09 14:26:52', '', NULL, 500, '0'),
(471, 311, '《交接验收单》', '', 'yes', '', '', 'admin', '2020-01-09 14:26:52', '', NULL, 505, '0'),
(472, 311, '《客户验收报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:26:52', '', NULL, 510, '0'),
(473, 312, '初步《质量保证计划及跟踪表》', '', 'yes', '', '', 'admin', '2020-01-09 14:28:18', '', NULL, 515, '0'),
(474, 313, '详细《质量保证计划及跟踪表》', '', 'yes', '', '', 'admin', '2020-01-09 14:28:18', '', NULL, 520, '0'),
(475, 314, '《过程审计检查表》', '', 'yes', '', '', 'admin', '2020-01-09 14:28:18', '', NULL, 525, '0'),
(476, 314, '《产品审计检查表》', '', 'yes', '', '', 'admin', '2020-01-09 14:28:18', '', NULL, 530, '0'),
(477, 314, '《QA审计报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:28:18', '', NULL, 535, '0'),
(478, 314, '《QA问题报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:28:18', '', NULL, 540, '0'),
(479, 314, '《QA里程碑报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:28:18', '', NULL, 545, '0'),
(480, 314, '《QA周报》', '', 'yes', '', '', 'admin', '2020-01-09 14:28:18', '', NULL, 550, '0'),
(481, 315, '《QA审计报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:28:18', '', NULL, 555, '0'),
(482, 315, '《QA问题报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:28:18', '', NULL, 560, '0'),
(483, 316, '《QA总结报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:28:18', '', NULL, 565, '0'),
(484, 318, '《配置管理计划》', '', 'yes', '', '', 'admin', '2020-01-09 14:55:08', '', NULL, 570, '0'),
(485, 318, '《配置项计划及跟踪表》', '', 'yes', '', '', 'admin', '2020-01-09 14:55:08', '', NULL, 575, '0'),
(486, 318, '《基线计划及跟踪表》', '', 'yes', '', '', 'admin', '2020-01-09 14:55:08', '', NULL, 580, '0'),
(487, 319, '《配置库管理报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:55:08', '', NULL, 585, '0'),
(488, 320, '《配置项计划及跟踪表》', '', 'yes', '', '', 'admin', '2020-01-09 14:55:08', '', NULL, 590, '0'),
(489, 321, '《基线计划及跟踪表》', '', 'yes', '', '', 'admin', '2020-01-09 14:55:08', '', NULL, 595, '0'),
(490, 322, '《变更申请书》', '', 'yes', '', '', 'admin', '2020-01-09 14:55:08', '', NULL, 600, '0'),
(491, 323, '《配置审计报告》', '', 'yes', '', '', 'admin', '2020-01-09 14:55:08', '', NULL, 605, '0'),
(492, 326, '《度量分析计划》', '', 'yes', '', '', 'admin', '2020-01-09 14:55:08', '', NULL, 610, '0'),
(493, 328, '项目度量数据库', '', 'yes', '', '', 'admin', '2020-01-09 14:55:08', '', NULL, 615, '0'),
(494, 329, '《量化项目计划及跟踪表》', '', 'no', '', '', 'admin', '2020-01-09 14:59:04', '', NULL, 630, '0');

REPLACE INTO `zt_basicmeas` (`id`, `purpose`, `scope`, `object`, `name`, `code`, `unit`, `configure`, `params`, `definition`, `source`, `collectType`, `collectConf`, `execTime`, `collectedBy`, `createdBy`, `createdDate`, `editedBy`, `editedDate`, `order`, `deleted`) VALUES
(2,'scale','project','userRequest','项目用户需求初始规模','pgmURInitScale','故事点或功能点','CREATE FUNCTION qc_pgmurinitscale($project int) returns float (10,2)\r\nbegin\r\n    declare scale float(10,2) default 0__DELIMITER__\r\n    declare inited int default 0__DELIMITER__\r\n    select qc_cminited($project, \'URS\') into inited__DELIMITER__\r\n    IF inited = 1 THEN\r\n    select qc_initscale($project, \'URS\',\'requestEst\') into scale__DELIMITER__\r\n    return scale__DELIMITER__\r\n    ELSE \r\n    return 0__DELIMITER__\r\n    END IF__DELIMITER__\r\nend','{\"$project\":{\"showName\":\"\\u6240\\u5c5e\\u9879\\u76ee\",\"varName\":\"$project\",\"varType\":\"select\",\"options\":\"project\",\"defaultValue\":\"\"}}','项目每个产品的第一个用户需求规格说明书基线版本的规模之和','从基线表中查询该项目下面每个产品的第一个用户需求规模说明书版本，然后查询对应的需求，求和。','crontab','{\"week\":\"1,2,3,4,5,6,0\",\"type\":\"week\"}','00:00','','system','1970-01-01 00:00:01','admin','2020-07-07 14:19:41',10,'0'),
(3,'scale','project','softRequest','项目软件需求初始规模','pgmSRInitScale','故事点或功能点','CREATE FUNCTION qc_pgmsrinitscale($project int) returns float (10,2)\r\nbegin\r\n    declare scale float (10,2) default 0__DELIMITER__\r\n    declare inited int default 0__DELIMITER__\r\n    select qc_cminited($project, \'SRS\') into inited__DELIMITER__\r\n    IF inited = 1 THEN\r\n    select qc_initscale($project, \'SRS\',\'storyEst\') into scale __DELIMITER__\r\n    return scale __DELIMITER__\r\n    ELSE \r\n    return 0__DELIMITER__\r\n    END IF__DELIMITER__\r\nend','{\"$project\":{\"showName\":\"\\u6240\\u9700\\u9879\\u76ee\",\"varName\":\"$project\",\"varType\":\"select\",\"options\":\"project\",\"defaultValue\":\"\"}}','项目每个产品的第一个软件需求规格说明书基线版本的规模之和','从基线表中查询该项目下面每个产品的第一个软件需求规模说明书版本，然后查询对应的需求，求和。','crontab','{\"week\":\"1,2,3,4,5,6,0\",\"type\":\"week\"}','00:00','','system','1970-01-01 00:00:01','admin','2020-07-07 14:21:53',15,'0'),
(4,'scale','project','userRequest','项目用户需求实时规模','pgmURRealScale','故事点或功能点','CREATE FUNCTION `qc_pgmurrealscale`($project int) RETURNS float (10,2)\r\nBEGIN\r\n  declare totalEstimate float(10,2) default 0__DELIMITER__\r\n  select CAST(sum(estimate) as DECIMAL(10,2)) as estimate from zt_story where project=$project and type=\'requirement\' and deleted=\'0\' and closedReason not in (\'subdivided\', \'duplicate\', \'willnotdo\', \'cancel\', \'bydesign\') into totalEstimate__DELIMITER__\r\n  return totalEstimate__DELIMITER__\r\nEND','{\"$project\":{\"showName\":\"\\u6240\\u5c5e\\u9879\\u76ee\",\"varName\":\"$project\",\"varType\":\"select\",\"options\":\"project\",\"defaultValue\":\"\"}}','项目用户需求实际的规模','从需求表中查询该项目下的所有用户需求，对规模进行求和。','crontab','{\"week\":\"1,2,3,4,5,6,0\",\"type\":\"week\"}','00:00','','system','1970-01-01 00:00:01','admin','2020-07-07 14:22:17',20,'0'),
(5,'scale','project','softRequest','项目软件需求实时规模','pgmSRRealScale','故事点或功能点','CREATE FUNCTION `qc_pgmsrrealscale`($project int) RETURNS float (10,2)\r\nBEGIN\r\n  declare totalEstimate float (10,2) default 0__DELIMITER__\r\n  select CAST(sum(estimate) as DECIMAL(10,2)) as estimate from zt_story where id in (select story from zt_projectstory where project=$project) and type=\'story\' and deleted=\'0\' and closedReason not in (\'subdivided\', \'duplicate\', \'willnotdo\', \'cancel\', \'bydesign\') into totalEstimate__DELIMITER__\r\n  return totalEstimate__DELIMITER__\r\nEND','{\"$project\":{\"showName\":\"\\u6240\\u5c5e\\u9879\\u76ee\",\"varName\":\"$project\",\"varType\":false,\"options\":\"project\",\"defaultValue\":\"702\"}}','项目软件需求实际的规模','从需求表中查询该项目下的所有软件需求，对规模进行求和。','crontab','{\"week\":\"1,2,3,4,5,6,0\",\"type\":\"week\"}','00:00','','system','1970-01-01 00:00:01','admin','2020-07-07 14:28:01',25,'0'),
(6,'scale','project','program','项目估算规模','pgmPlanScale','故事点或功能点','CREATE FUNCTION `qc_pgmplanscale`($project int) RETURNS float (10,2)\r\nBEGIN\r\n   declare programScale float (10,2) default 0__DELIMITER__\r\n   select `scale` from zt_workestimation where project = $project into programScale__DELIMITER__\r\n   return programScale__DELIMITER__\r\nEND','{\"$project\":{\"showName\":\"\\u6240\\u5c5e\\u9879\\u76ee\",\"varName\":\"$project\",\"varType\":\"select\",\"options\":\"project\",\"defaultValue\":\"\"}}','项目最初估算时估计的规模','从项目估算表里面查询项目的估算规模。','crontab','{\"week\":\"1,2,3,4,5,6,0\",\"type\":\"week\"}','00:00','','system','1970-01-01 00:00:01','admin','2020-07-07 14:26:01',30,'0'),
(8,'duration','project','stage','项目需求阶段计划天数','pgmRequestPlanDays','天','CREATE FUNCTION `qc_pgmrequestplandays`($project int) RETURNS int(11)\r\nBEGIN\r\n    select qc_pgmspecifiedtypeplanneddays($project,\'request\') as days into @days__DELIMITER__\r\n    return @days__DELIMITER__\r\nEND','{\"$project\":{\"showName\":\"\\u6240\\u5c5e\\u9879\\u76ee\",\"varName\":\"$project\",\"varType\":\"select\",\"options\":\"project\",\"defaultValue\":\"\"}}','项目下面所有需求阶段计划天数的和','从阶段表里面统计该项目下面所有类型为需求的阶段的计划天数，求和。','crontab','{\"week\":\"1,2,3,4,5,6,0\",\"type\":\"week\"}','00:00','','system','1970-01-01 00:00:01','','1970-01-01 00:00:01',40,'0'),
(9,'duration','project','stage','项目设计阶段计划天数','pgmDesigntPlanDays','天','CREATE FUNCTION `qc_pgmdesigntplandays`($project int) RETURNS int(11)\r\nBEGIN\r\n    select qc_pgmspecifiedtypeplanneddays($project,\'design\') as days into @days__DELIMITER__\r\n    return @days__DELIMITER__\r\nEND','{\"$project\":{\"showName\":\"\\u6240\\u5c5e\\u9879\\u76ee\",\"varName\":\"$project\",\"varType\":\"select\",\"options\":\"project\",\"defaultValue\":\"\"}}','项目下面所有设计阶段计划天数的和','从阶段表里面统计该项目下面所有类型为设计的阶段的计划天数，求和。','crontab','{\"week\":\"1,2,3,4,5,6,0\",\"type\":\"week\"}','00:00','','system','1970-01-01 00:00:01','','1970-01-01 00:00:01',45,'0'),
(10,'duration','project','stage','项目开发阶段计划天数','pgmDevelPlanDays','天','CREATE FUNCTION `qc_pgmdevelplandays`($project int) RETURNS int(11)\r\nBEGIN\r\n    select qc_pgmspecifiedtypeplanneddays($project,\'dev\') as days into @days__DELIMITER__\r\n    return @days__DELIMITER__\r\nEND','{\"$project\":{\"showName\":\"\\u6240\\u5c5e\\u9879\\u76ee\",\"varName\":\"$project\",\"varType\":\"select\",\"options\":\"project\",\"defaultValue\":\"\"}}','项目下面所有研发阶段计划天数的和','从阶段表里面统计该项目下面所有类型为开发的阶段的计划天数，求和。','crontab','{\"week\":\"1,2,3,4,5,6,0\",\"type\":\"week\"}','00:00','','system','1970-01-01 00:00:01','','1970-01-01 00:00:01',50,'0'),
(11,'duration','project','stage','项目测试阶段计划天数','pgmTestPlanDays','天','CREATE FUNCTION `qc_pgmtestplandays`($project int) RETURNS int(11)\r\nBEGIN\r\n    select qc_pgmspecifiedtypeplanneddays($project,\'qa\') as days into @days__DELIMITER__\r\n    return @days__DELIMITER__\r\nEND','{\"$project\":{\"showName\":\"\\u6240\\u5c5e\\u9879\\u76ee\",\"varName\":\"$project\",\"varType\":\"select\",\"options\":\"project\",\"defaultValue\":\"\"}}','项目下面所有测试阶段计划天数的和','从阶段表里面统计该项目下面所有类型为测试的阶段的计划天数，求和。','crontab','{\"week\":\"1,2,3,4,5,6,0\",\"type\":\"week\"}','00:00','','system','1970-01-01 00:00:01','','1970-01-01 00:00:01',55,'0'),
(12,'duration','project','stage','项目需求阶段实际天数','pgmRequestRealDays','天','CREATE FUNCTION `qc_pgmrequestrealdays`($project int) RETURNS int(11)\r\nBEGIN\r\n    select qc_pgmspecifiedtypeactualdays($project,\'request\') as days into @days__DELIMITER__\r\n    return @days__DELIMITER__\r\nEND','{\"$project\":{\"showName\":\"\\u6240\\u5c5e\\u9879\\u76ee\",\"varName\":\"$project\",\"varType\":\"select\",\"options\":\"project\",\"defaultValue\":\"\"}}','项目下面所有需求阶段实际天数的和','从阶段表里面统计该项目下面所有类型为需求的阶段的实际天数，求和。','crontab','{\"week\":\"1,2,3,4,5,6,0\",\"type\":\"week\"}','00:00','','system','1970-01-01 00:00:01','','1970-01-01 00:00:01',60,'0'),
(13,'duration','project','stage','项目设计阶段实际天数','pgmDesigntRealDays','天','CREATE FUNCTION `qc_pgmdesigntrealdays`($project int) RETURNS int(11)\r\nBEGIN\r\n    select qc_pgmspecifiedtypeactualdays($project,\'design\') as days into @days__DELIMITER__\r\n    return @days__DELIMITER__\r\nEND','{\"$project\":{\"showName\":\"\\u6240\\u5c5e\\u9879\\u76ee\",\"varName\":\"$project\",\"varType\":\"select\",\"options\":\"project\",\"defaultValue\":\"\"}}','项目下面所有设计阶段实际天数的和','从阶段表里面统计该项目下面所有类型为设计的阶段的实际天数，求和。','crontab','{\"week\":\"1,2,3,4,5,6,0\",\"type\":\"week\"}','00:00','','system','1970-01-01 00:00:01','','1970-01-01 00:00:01',65,'0'),
(14,'duration','project','stage','项目开发阶段实际天数','pgmDevelRealDays','天','CREATE FUNCTION `qc_pgmdevelrealdays`($project int) RETURNS int(11)\r\nBEGIN\r\n    select qc_pgmspecifiedtypeactualdays($project,\'dev\') as days into @days__DELIMITER__\r\n    return @days__DELIMITER__\r\nEND','{\"$project\":{\"showName\":\"\\u6240\\u5c5e\\u9879\\u76ee\",\"varName\":\"$project\",\"varType\":\"select\",\"options\":\"project\",\"defaultValue\":\"\"}}','项目下面所有研发阶段实际天数的和','从阶段表里面统计该项目下面所有类型为开发的阶段的实际天数，求和。','crontab','{\"week\":\"1,2,3,4,5,6,0\",\"type\":\"week\"}','00:00','','system','1970-01-01 00:00:01','','1970-01-01 00:00:01',70,'0'),
(15,'duration','project','stage','项目测试阶段实际天数','pgmTestRealDays','天','CREATE FUNCTION `qc_pgmtestrealdays`($project int) RETURNS int(11)\r\nBEGIN\r\n    select qc_pgmspecifiedtypeactualdays($project,\'qa\') as days into @days__DELIMITER__\r\n    return @days__DELIMITER__\r\nEND','{\"$project\":{\"showName\":\"\\u6240\\u5c5e\\u9879\\u76ee\",\"varName\":\"$project\",\"varType\":\"select\",\"options\":\"project\",\"defaultValue\":\"3\"}}','项目下面所有测试阶段实际天数的和','从阶段表里面统计该项目下面所有类型为测试的阶段的实际天数，求和。','crontab','{\"week\":\"1,2,3,4,5,6,0\",\"type\":\"week\"}','00:00','','system','1970-01-01 00:00:01','','1970-01-01 00:00:01',75,'0'),
(26,'duration','product','stage','分产品需求阶段计划天数','prdRequestPlanDays','天','CREATE FUNCTION `qc_prdrequestplandays`($product int) RETURNS int(11)\r\nBEGIN\r\n    select qc_pgmstageplannedduration($product, \'request\') as days into @days__DELIMITER__\r\n    return @days__DELIMITER__\r\nEND','{\"$product\":{\"showName\":\"\\u6240\\u5c5e\\u4ea7\\u54c1\",\"varName\":\"$product\",\"varType\":\"select\",\"options\":\"product\",\"defaultValue\":\"\"}}','产品下面所有需求阶段计划天数的和','从阶段表里面统计该产品在该项目下所有类型为需求的阶段的计划天数，求和。','crontab','{\"week\":\"1,2,3,4,5,6,0\",\"type\":\"week\"}','00:00','','system','1970-01-01 00:00:01','','1970-01-01 00:00:01',130,'0'),
(27,'duration','product','stage','分产品设计阶段计划天数','prdDesigntPlanDays','天','CREATE FUNCTION `qc_prddesigntplandays`($product int) RETURNS int(11)\r\nBEGIN\r\n    select qc_pgmstageplannedduration($product, \'design\') as days into @days__DELIMITER__\r\n    return @days__DELIMITER__\r\nEND','{\"$product\":{\"showName\":\"\\u6240\\u5c5e\\u4ea7\\u54c1\",\"varName\":\"$product\",\"varType\":\"select\",\"options\":\"product\",\"defaultValue\":\"\"}}','产品下面所有设计阶段计划天数的和','从阶段表里面统计该产品在该项目下所有类型为设计的阶段的计划天数，求和。','crontab','{\"week\":\"1,2,3,4,5,6,0\",\"type\":\"week\"}','00:00','','system','1970-01-01 00:00:01','','1970-01-01 00:00:01',135,'0'),
(28,'duration','product','stage','分产品开发阶段计划天数','prdDevelPlanDays','天','CREATE FUNCTION `qc_prddevelplandays`($product int) RETURNS int(11)\r\nBEGIN\r\n    select qc_pgmstageplannedduration($product, \'dev\') as days into @days__DELIMITER__\r\n    return @days__DELIMITER__\r\nEND','{\"$product\":{\"showName\":\"\\u6240\\u5c5e\\u4ea7\\u54c1\",\"varName\":\"$product\",\"varType\":\"select\",\"options\":\"product\",\"defaultValue\":\"1\"}}','产品下面所有研发阶段计划天数的和','从阶段表里面统计该产品在该项目下所有类型为开发的阶段的计划天数，求和。','crontab','{\"week\":\"1,2,3,4,5,6,0\",\"type\":\"week\"}','00:00','','system','1970-01-01 00:00:01','','1970-01-01 00:00:01',140,'0'),
(29,'duration','product','stage','分产品测试阶段计划天数','prdTestPlanDays','天','CREATE FUNCTION `qc_prdtestplandays`($product int) RETURNS int(11)\r\nBEGIN\r\n    select qc_pgmstageplannedduration($product, \'qa\') as days into @days__DELIMITER__\r\n    return @days__DELIMITER__\r\nEND','{\"$product\":{\"showName\":\"\\u6240\\u5c5e\\u4ea7\\u54c1\",\"varName\":\"$product\",\"varType\":\"select\",\"options\":\"product\",\"defaultValue\":\"\"}}','产品下面所有测试阶段计划天数的和','从阶段表里面统计该产品在该项目下所有类型为测试的阶段的计划天数，求和。','crontab','{\"week\":\"1,2,3,4,5,6,0\",\"type\":\"week\"}','00:00','','system','1970-01-01 00:00:01','','1970-01-01 00:00:01',145,'0'),
(30,'duration','product','stage','分产品需求阶段实际天数','prdRequestRealDays','天','CREATE FUNCTION `qc_prdrequestrealdays`($product int) RETURNS int(11)\r\nBEGIN\r\n    select qc_pgmstageactualduration($product,\'request\') as days into @days__DELIMITER__\r\n    return @days__DELIMITER__\r\nEND','{\"$product\":{\"showName\":\"\\u6240\\u5c5e\\u4ea7\\u54c1\",\"varName\":\"$product\",\"varType\":\"select\",\"options\":\"product\",\"defaultValue\":\"\"}}','产品下面所有需求阶段实际天数的和','从阶段表里面统计该产品在该项目下所有类型为需求的阶段的实际天数，求和。','crontab','{\"week\":\"1,2,3,4,5,6,0\",\"type\":\"week\"}','00:00','','system','1970-01-01 00:00:01','','1970-01-01 00:00:01',150,'0'),
(31,'duration','product','stage','分产品设计阶段实际天数','prdDesigntRealDays','天','CREATE FUNCTION `qc_prddesigntrealdays`($product int) RETURNS int(11)\r\nBEGIN\r\n    select qc_pgmstageactualduration($product, \'design\') as days into @days__DELIMITER__\r\n    return @days__DELIMITER__\r\nEND','{\"$product\":{\"showName\":\"\\u6240\\u5c5e\\u4ea7\\u54c1\",\"varName\":\"$product\",\"varType\":\"select\",\"options\":\"product\",\"defaultValue\":\"\"}}','产品下面所有设计阶段实际天数的和','从阶段表里面统计该产品在该项目下所有类型为设计的阶段的实际天数，求和。','crontab','{\"week\":\"1,2,3,4,5,6,0\",\"type\":\"week\"}','00:00','','system','1970-01-01 00:00:01','','1970-01-01 00:00:01',155,'0'),
(32,'duration','product','stage','分产品开发阶段实际天数','prdDevelRealDays','天','CREATE FUNCTION `qc_prddevelrealdays`($product int) RETURNS int(11)\r\nBEGIN\r\n    select qc_pgmstageactualduration($product, \'dev\') as days into @days__DELIMITER__\r\n    return @days__DELIMITER__\r\nEND','{\"$product\":{\"showName\":\"\\u6240\\u5c5e\\u4ea7\\u54c1\",\"varName\":\"$product\",\"varType\":\"select\",\"options\":\"product\",\"defaultValue\":\"\"}}','产品下面所有研发阶段实际天数的和','从阶段表里面统计该产品在该项目下所有类型为开发的阶段的实际天数，求和。','crontab','{\"week\":\"1,2,3,4,5,6,0\",\"type\":\"week\"}','00:00','','system','1970-01-01 00:00:01','','1970-01-01 00:00:01',160,'0'),
(33,'duration','product','stage','分产品测试阶段实际天数','prdTestRealDays','天','CREATE FUNCTION `qc_prdtestrealdays`($product int) RETURNS int(11)\r\nBEGIN\r\n    select qc_pgmstageactualduration($product, \'qa\') as days into @days__DELIMITER__\r\n    return @days__DELIMITER__\r\nEND','{\"$product\":{\"showName\":\"\\u6240\\u5c5e\\u4ea7\\u54c1\",\"varName\":\"$product\",\"varType\":\"select\",\"options\":\"product\",\"defaultValue\":\"1\"}}','产品下面所有测试阶段实际天数的和','从阶段表里面统计该产品在该项目下所有类型为测试的阶段的实际天数，求和。','crontab','{\"week\":\"1,2,3,4,5,6,0\",\"type\":\"week\"}','00:00','','system','1970-01-01 00:00:01','','1970-01-01 00:00:01',165,'0'),
(34,'workload','project','finance','项目任务实时预计工时数','pgmRealEstHours','小时','CREATE FUNCTION `qc_pgmrealesthours`($project int) RETURNS float(10,2)\r\nBEGIN\r\n    select sum(estimate) from zt_task where project=$project and parent >= 0 and status != \'cancel\' and deleted = \'0\' into @estimate__DELIMITER__\r\nreturn @estimate__DELIMITER__\r\nEND','{\"$project\":{\"showName\":\"\\u6240\\u5c5e\\u9879\\u76ee\",\"varName\":\"$project\",\"varType\":\"select\",\"options\":\"project\",\"defaultValue\":\"\"}}','项目下面所有任务的最初预计工时和','从任务表中查询该项目的所有任务，统计最初预计工>时，求和。','crontab','{\"week\":\"1,2,3,4,5,6,0\",\"type\":\"week\"}','00:00','','system','1970-01-01 00:00:01','admin','2020-07-07 19:51:39',170,'0'),
(35,'workload','project','finance','项目需求工作实时总预计工时数','pgmRequestRealEstHours','小时','CREATE FUNCTION `qc_pgmrequestrealesthours`($project int) RETURNS float (10,2)\r\nBEGIN\r\nreturn qc_pgmesthoursbytype($project, \'request\')__DELIMITER__\r\nEND','{\"$project\":{\"showName\":\"\\u6240\\u5c5e\\u9879\\u76ee\",\"varName\":\"$project\",\"varType\":\"select\",\"options\":\"project\",\"defaultValue\":\"\"}}','项目所有需求相关任务的最初预计工时和','从任务表中查询该项目所有任务类型为需求的任务，统计最初预计工时，求和。','crontab','{\"week\":\"1,2,3,4,5,6,0\",\"type\":\"week\"}','00:00','','system','1970-01-01 00:00:01','admin','2020-07-23 13:49:17',175,'0'),
(36,'workload','project','finance','项目设计工作实时总预计工时数','pgmDesgignRealEstHours','小时','CREATE FUNCTION `qc_pgmdesgignrealesthours`($project int) RETURNS float (10,2)\r\nBEGIN\r\nreturn qc_pgmesthoursbytype($project, \'design\')__DELIMITER__\r\nEND','{\"$project\":{\"showName\":\"\\u6240\\u5c5e\\u9879\\u76ee\",\"varName\":\"$project\",\"varType\":\"select\",\"options\":\"project\",\"defaultValue\":\"\"}}','项目所有设计相关任务的最初预计工时和','从任务表中查询该项目所有任务类型为设计的任务，统计最初预计工时，求和。','crontab','{\"week\":\"1,2,3,4,5,6,0\",\"type\":\"week\"}','00:00','','system','1970-01-01 00:00:01','admin','2020-07-23 13:45:32',180,'0'),
(37,'workload','project','finance','项目开发工作实时总预计工时数','pgmDevelRealEstHours','小时','CREATE FUNCTION `qc_pgmdevelrealesthours`($project int) RETURNS float (10,2)\r\nBEGIN\r\nreturn qc_pgmesthoursbytype($project, \'devel\')__DELIMITER__\r\nEND','{\"$project\":{\"showName\":\"\\u6240\\u5c5e\\u9879\\u76ee\",\"varName\":\"$project\",\"varType\":\"select\",\"options\":\"project\",\"defaultValue\":\"\"}}','项目所有开发相关任务的最初预计工时和','从任务表中查询该项目所有任务类型为开发的任务，统计最初预计工时，求和。','crontab','{\"week\":\"1,2,3,4,5,6,0\",\"type\":\"week\"}','00:00','','system','1970-01-01 00:00:01','admin','2020-07-23 13:46:53',185,'0'),
(38,'workload','project','finance','项目测试工作实时总预计工时数','pgmTestRealEstHours','小时','CREATE FUNCTION `qc_pgmtestrealesthours`($project int) RETURNS float(10,2)\r\nBEGIN\r\nreturn qc_pgmesthoursbytype($project, \'test\')__DELIMITER__\r\nEND','{\"$project\":{\"showName\":\"\\u6240\\u5c5e\\u9879\\u76ee\",\"varName\":\"$project\",\"varType\":\"select\",\"options\":\"project\",\"defaultValue\":\"\"}}','项目所有测试相关任务的最初预计工时和','从任务表中查询该项目所有任务类型为测试的任务，统计最初预计工时，求和。','crontab','{\"week\":\"1,2,3,4,5,6,0\",\"type\":\"week\"}','00:00','','system','1970-01-01 00:00:01','admin','2020-07-23 13:44:13',190,'0'),
(39,'workload','project','finance','项目任务实际消耗工时数','pgmRealHours','小时','CREATE FUNCTION `qc_pgmrealhours`($project int) RETURNS float(10,2)\r\nBEGIN\r\n  select CAST(sum(consumed) as DECIMAL(10,2)) as consumed from zt_task where project=$project and parent >= 0 and status != \'cancel\' and deleted = \'0\'  into @consumed__DELIMITER__\r\n  return @consumed__DELIMITER__\r\nEND','{\"$project\":{\"showName\":\"\\u6240\\u5c5e\\u9879\\u76ee\",\"varName\":\"$project\",\"varType\":\"select\",\"options\":\"project\",\"defaultValue\":\"\"}}','项目下面所有任务的实际消耗工时和','从任务表中查询该项目的所有任务，统计实际消耗工时，求和。','crontab','{\"week\":\"1,2,3,4,5,6,0\",\"type\":\"week\"}','00:00','','system','1970-01-01 00:00:01','admin','2020-07-07 19:49:32',195,'0'),
(40,'workload','project','finance','项目需求工作实际消耗工时数','pgmRequestRealHours','小时','CREATE FUNCTION `qc_pgmrequestrealhours`($project int) RETURNS float(10,2)\r\nBEGIN\r\nreturn qc_pgmrealhoursbytype($project, \'request\')__DELIMITER__\r\nEND','{\"$project\":{\"showName\":\"\\u6240\\u5c5e\\u9879\\u76ee\",\"varName\":\"$project\",\"varType\":\"select\",\"options\":\"project\",\"defaultValue\":\"\"}}','项目所有需求相关任务的实际消耗工时和','从任务表中查询该项目所有任务类型为需求的任务，统计实际消耗工时，求和。','crontab','{\"week\":\"1,2,3,4,5,6,0\",\"type\":\"week\"}','00:00','','system','1970-01-01 00:00:01','admin','2020-07-07 19:49:03',200,'0'),
(41,'workload','project','finance','项目设计工作实际消耗工时数','pgmDesignRealHours','小时','CREATE FUNCTION `qc_pgmdesignrealhours`($project int) RETURNS float(10,2)\r\nBEGIN\r\nreturn qc_pgmrealhoursbytype($project, \'design\')__DELIMITER__\r\nEND','{\"$project\":{\"showName\":\"\\u6240\\u5c5e\\u9879\\u76ee\",\"varName\":\"$project\",\"varType\":\"select\",\"options\":\"project\",\"defaultValue\":\"\"}}','项目所有设计相关任务的实际消耗工时和','从任务表中查询该项目所有任务类型为设计的任务，统计实际消耗工时，求和。','crontab','{\"week\":\"1,2,3,4,5,6,0\",\"type\":\"week\"}','00:00','','system','1970-01-01 00:00:01','admin','2020-07-07 19:48:35',205,'0'),
(42,'workload','project','finance','项目开发工作实际消耗工时数','pgmDevelRealHours','小时','CREATE FUNCTION `qc_pgmdevelrealhours`($project int) RETURNS float(10,2)\r\nBEGIN\r\nreturn qc_pgmrealhoursbytype($project, \'devel\')__DELIMITER__\r\nEND','{\"$project\":{\"showName\":\"\\u6240\\u5c5e\\u9879\\u76ee\",\"varName\":\"$project\",\"varType\":\"select\",\"options\":\"project\",\"defaultValue\":\"\"}}','项目所有开发相关任务的实际消耗工时和','从任务表中查询该项目所有任务类型为开发的任务，统计实际消耗工时，求和。','crontab','{\"week\":\"1,2,3,4,5,6,0\",\"type\":\"week\"}','00:00','','system','1970-01-01 00:00:01','admin','2020-07-07 18:34:51',210,'0'),
(43,'workload','project','finance','项目测试工作实际消耗工时数','pgmTestRealHours','小时','CREATE FUNCTION `qc_pgmtestrealhours`($project int) RETURNS float(10, 2)\r\nBEGIN\r\nreturn qc_pgmrealhoursbytype($project, \'test\')__DELIMITER__\r\nEND','{\"$project\":{\"showName\":\"\\u6240\\u5c5e\\u9879\\u76ee\",\"varName\":\"$project\",\"varType\":\"select\",\"options\":\"project\",\"defaultValue\":\"\"}}','项目所有测试相关任务的实际消耗工时和','从任务表中查询该项目所有任务类型为测试的任务，统计实际消耗工时，求和。','crontab','{\"week\":\"1,2,3,4,5,6,0\",\"type\":\"week\"}','00:00','','system','1970-01-01 00:00:01','admin','2020-07-07 18:09:01',215,'0'),
(44,'workload','project','finance','项目开发工作最初总预计工时数','pgmDevelFirstEstHours','小时','CREATE FUNCTION `qc_pgmdevelfirstesthours`($project int) RETURNS float(10,2)\r\nBEGIN\r\n    declare estimate float(10,2) default 0__DELIMITER__\r\n    declare inited int default 0__DELIMITER__\r\n    select qc_cminited($project, \'PP\') into inited__DELIMITER__\r\n    IF inited = 1 THEN\r\n    select qc_getdevelfirstesthours($project) into estimate__DELIMITER__\r\n    return estimate__DELIMITER__\r\n    ELSE \r\n    return 0__DELIMITER__\r\n    END IF__DELIMITER__\r\nEND','{\"$project\":{\"showName\":\"\\u6240\\u5c5e\\u9879\\u76ee\",\"varName\":\"$project\",\"varType\":\"select\",\"options\":\"project\",\"defaultValue\":\"\"}}','项目计划第一个基线版本中所有开发相关工作最初预计工时和','','crontab','{\"week\":\"1,2,3,4,5,6,0\",\"type\":\"week\"}','00:00','','admin','2020-07-22 13:13:51','','1970-01-01 00:00:01',220,'0'),
(45,'workload','project','finance','项目设计工作最初总预计工时数','pgmDesignFirstEstHours','小时','CREATE FUNCTION `qc_pgmdesignfirstesthours`($project int) RETURNS float(10,2)\r\nBEGIN\r\n    declare estimate float(10,2) default 0__DELIMITER__\r\n    declare inited int default 0__DELIMITER__\r\n    select qc_cminited($project, \'PP\') into inited__DELIMITER__\r\n    IF inited = 1 THEN\r\n    select qc_getdesignfirstesthours($project) into estimate__DELIMITER__\r\n    return estimate__DELIMITER__\r\n    ELSE \r\n    return 0__DELIMITER__\r\n    END IF__DELIMITER__\r\nEND','{\"$project\":{\"showName\":\"\\u6240\\u5c5e\\u9879\\u76ee\",\"varName\":\"$project\",\"varType\":\"select\",\"options\":\"project\",\"defaultValue\":\"\"}}','项目计划第一个基线版本中所有设计相关工作最初预计工时和','','crontab','{\"week\":\"1,2,3,4,5,6,0\",\"type\":\"week\"}','00:00','','admin','2020-07-22 16:33:20','admin','2020-07-23 10:31:23',225,'0'),
(46,'workload','project','finance','项目测试工作最初总预计工时数','pgmTestFirstEstHours','小时','CREATE FUNCTION `qc_pgmtestfirstesthours`($project int) RETURNS float(10,2)\r\nBEGIN\r\n    declare estimate float(10,2) default 0__DELIMITER__\r\n    declare inited int default 0__DELIMITER__\r\n    select qc_cminited($project, \'PP\') into inited__DELIMITER__\r\n    IF inited = 1 THEN\r\n    select qc_gettestfirstesthours($project) into estimate__DELIMITER__\r\n    return estimate__DELIMITER__\r\n    ELSE \r\n    return 0__DELIMITER__\r\n    END IF__DELIMITER__\r\nEND','{\"$project\":{\"showName\":\"\\u6240\\u5c5e\\u9879\\u76ee\",\"varName\":\"$project\",\"varType\":\"select\",\"options\":\"project\",\"defaultValue\":\"\"}}','项目计划第一个基线版本中所有测试相关工作最初预计工时和','','crontab','{\"week\":\"1,2,3,4,5,6,0\",\"type\":\"week\"}','00:00','','admin','2020-07-23 10:31:17','','1970-01-01 00:00:01',230,'0'),
(47,'workload','project','finance','项目需求工作最初总预计工时数','pgmRequestFirstEstHours','小时','CREATE FUNCTION `qc_pgmrequestfirstesthours`($project int) RETURNS float(10,2)\r\nBEGIN\r\n    declare estimate float(10,2) default 0__DELIMITER__\r\n    declare inited int default 0__DELIMITER__\r\n    select qc_cminited($project, \'PP\') into inited__DELIMITER__\r\n    IF inited = 1 THEN\r\n    select qc_getstoryfirstesthours($project) into estimate__DELIMITER__\r\n    return estimate__DELIMITER__\r\n    ELSE \r\n    return 0__DELIMITER__\r\n    END IF__DELIMITER__\r\nEND','{\"$project\":{\"showName\":\"\\u6240\\u5c5e\\u9879\\u76ee\",\"varName\":\"$project\",\"varType\":\"select\",\"options\":\"project\",\"defaultValue\":\"\"}}','项目计划第一个基线版本中所有需求相关工作最初预计工时和','','crontab','{\"week\":\"1,2,3,4,5,6,0\",\"type\":\"week\"}','00:00','','admin','2020-07-23 10:53:09','','1970-01-01 00:00:01',235,'0'),
(48,'workload','project','finance','项目任务最初总预计工时数','pgmFirstEstHours','小时','CREATE FUNCTION `qc_pgmfirstesthours`($project int) RETURNS float(10,2)\r\nBEGIN\r\n    declare estimate float(10,2) default 0__DELIMITER__\r\n    declare inited int default 0__DELIMITER__\r\n    select qc_cminited($project, \'PP\') into inited__DELIMITER__\r\n    IF inited = 1 THEN\r\n    select qc_getfirstesthours($project) into estimate__DELIMITER__\r\n    return estimate__DELIMITER__\r\n    ELSE \r\n    return 0__DELIMITER__\r\n    END IF__DELIMITER__\r\nEND','{\"$project\":{\"showName\":\"\\u6240\\u5c5e\\u9879\\u76ee\",\"varName\":\"$project\",\"varType\":\"select\",\"options\":\"project\",\"defaultValue\":\"\"}}','项目计划第一个基线版本中所有任务最初预计工时和','','crontab','{\"week\":\"1,2,3,4,5,6,0\",\"type\":\"week\"}','00:00','','admin','2020-07-23 13:06:59','','1970-01-01 00:00:01',240,'0'),
(49,'workload','project','finance','项目开发工作最终总预计工时数','pgmDevelLastEstHours','小时','CREATE FUNCTION `qc_pgmdevellastesthours`($project int) RETURNS float(10,2)\r\nBEGIN\r\n    declare estimate float(10,2) default 0__DELIMITER__\r\n    declare inited int default 0__DELIMITER__\r\n    select qc_cminited($project, \'PP\') into inited__DELIMITER__\r\n    IF inited = 1 THEN\r\n    select qc_getdevlastesthours($project) into estimate__DELIMITER__\r\n    return estimate__DELIMITER__\r\n    ELSE \r\n    return 0__DELIMITER__\r\n    END IF__DELIMITER__\r\nEND','{\"$project\":{\"showName\":\"\\u6240\\u5c5e\\u9879\\u76ee\",\"varName\":\"$project\",\"varType\":\"select\",\"options\":\"project\",\"defaultValue\":\"\"}}','项目计划最后一个基线版本中所有开发相关任务最初预计工时和','','crontab','{\"week\":\"1,2,3,4,5,6,0\",\"type\":\"week\"}','00:00','','admin','2020-07-23 13:41:38','','1970-01-01 00:00:01',245,'0'),
(50,'workload','project','finance','项目需求工作最终总预计工时数','pgmRequestLastEstHours','小时','CREATE FUNCTION `qc_pgmrequestlastesthours`($project int) RETURNS float(10,2)\r\nBEGIN\r\n    declare estimate float(10,2) default 0__DELIMITER__\r\n    declare inited int default 0__DELIMITER__\r\n    select qc_cminited($project,\'PP\') into inited__DELIMITER__\r\n    IF inited = 1 THEN\r\n    select qc_getrequestlastesthours($project) into estimate__DELIMITER__\r\n    return estimate__DELIMITER__\r\n    ELSE \r\n    return 0__DELIMITER__\r\n    END IF__DELIMITER__\r\nEND','{\"$project\":{\"showName\":\"\\u6240\\u5c5e\\u9879\\u76ee\",\"varName\":\"$project\",\"varType\":\"select\",\"options\":\"project\",\"defaultValue\":\"\"}}','项目计划最后一个基线版本中所有需求相关任务最初预计工时和','','crontab','{\"week\":\"1,2,3,4,5,6,0\",\"type\":\"week\"}','00:00','','admin','2020-07-23 14:00:58','','1970-01-01 00:00:01',250,'0'),
(51,'workload','project','finance','项目测试工作最终总预计工时数','pgmTestLastEstHours','小时','CREATE FUNCTION `qc_pgmtestlastesthours`($project int) RETURNS float(10,2)\r\nBEGIN\r\n    declare estimate float(10,2) default 0__DELIMITER__\r\n    declare inited int default 0__DELIMITER__\r\n    select qc_cminited($project,\'PP\') into inited__DELIMITER__\r\n    IF inited = 1 THEN\r\n    select qc_gettestlastesthours($project) into estimate__DELIMITER__\r\n    return estimate__DELIMITER__\r\n    ELSE \r\n    return 0__DELIMITER__\r\n    END IF__DELIMITER__\r\nEND','{\"$project\":{\"showName\":\"\\u6240\\u5c5e\\u9879\\u76ee\",\"varName\":\"$project\",\"varType\":\"select\",\"options\":\"project\",\"defaultValue\":\"\"}}','项目计划最后一个基线版本中所有测试相关任务最初预计工时和','','crontab','{\"week\":\"1,2,3,4,5,6,0\",\"type\":\"week\"}','00:00','','admin','2020-07-23 14:10:12','','1970-01-01 00:00:01',255,'0'),
(52,'workload','project','finance','项目设计工作最终总预计工时数','pgmDesignLastEstHours','小时','CREATE FUNCTION `qc_pgmdesignlastesthours`($project int) RETURNS float(10,2)\r\nBEGIN\r\n    declare estimate float(10,2) default 0__DELIMITER__\r\n    declare inited int default 0__DELIMITER__\r\n    select qc_cminited($project,\'PP\') into inited__DELIMITER__\r\n    IF inited = 1 THEN\r\n    select qc_getdesignlastesthours($project) into estimate__DELIMITER__\r\n    return estimate__DELIMITER__\r\n    ELSE \r\n    return 0__DELIMITER__\r\n    END IF__DELIMITER__\r\nEND','{\"$project\":{\"showName\":\"\\u6240\\u5c5e\\u9879\\u76ee\",\"varName\":\"$project\",\"varType\":\"select\",\"options\":\"project\",\"defaultValue\":\"\"}}','项目计划最后一个基线版本中所有设计相关任务最初预计工时和','','crontab','{\"week\":\"1,2,3,4,5,6,0\",\"type\":\"week\"}','00:00','','admin','2020-07-23 14:33:00','','1970-01-01 00:00:01',260,'0'),
(53,'workload','project','finance','项目任务最终总预计工时数','pgmLastEstHours','小时','CREATE FUNCTION `qc_pgmlastesthours`($project int) RETURNS float(10,2)\r\nBEGIN\r\n    declare estimate float(10,2) default 0__DELIMITER__\r\n    declare inited int default 0__DELIMITER__\r\n    select qc_cminited($project,\'PP\') into inited__DELIMITER__\r\n    IF inited = 1 THEN\r\n    select qc_getlastesthours($project) into estimate__DELIMITER__\r\n    return estimate__DELIMITER__\r\n    ELSE \r\n    return 0__DELIMITER__\r\n    END IF__DELIMITER__\r\nEND','{\"$project\":{\"showName\":\"\\u6240\\u5c5e\\u9879\\u76ee\",\"varName\":\"$project\",\"varType\":\"select\",\"options\":\"project\",\"defaultValue\":\"\"}}','项目计划最后一个基线版本中所有任务最初预计工时和','','crontab','{\"week\":\"1,2,3,4,5,6,0\",\"type\":\"week\"}','00:00','','admin','2020-07-23 14:54:42','','1970-01-01 00:00:01',265,'0');

REPLACE INTO `zt_cron` (`m`, `h`, `dom`, `mon`, `dow`, `command`, `remark`, `type`, `buildin`, `status`) VALUES
('1','0','*','*','*','moduleName=weekly&methodName=computeWeekly','更新项目周报','zentao',0,'normal');

-- DROP TABLE IF EXISTS `zt_pivot`;
CREATE TABLE IF NOT EXISTS `zt_pivot`  (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `dimension` mediumint(8) unsigned NOT NULL DEFAULT 0,
  `group` varchar(255) NOT NULL DEFAULT '',
  `code` varchar(255) NOT NULL DEFAULT '',
  `driver` enum('mysql', 'duckdb') not NULL default 'mysql',
  `name` text NULL,
  `desc` text NULL,
  `sql` mediumtext NULL,
  `fields` mediumtext NULL,
  `langs` mediumtext NULL,
  `vars` mediumtext NULL,
  `objects` mediumtext NULL,
  `settings` mediumtext NULL,
  `filters` mediumtext NULL,
  `step` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `stage` enum('draft','published') NOT NULL DEFAULT 'draft',
  `builtin` enum('0', '1') NOT NULL DEFAULT '0',
  `createdBy` varchar(30) NOT NULL DEFAULT '',
  `createdDate` datetime NULL,
  `editedBy` varchar(30) NOT NULL DEFAULT '',
  `editedDate` datetime NULL,
  `deleted` enum('0', '1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE = InnoDB DEFAULT CHARSET=utf8;
CREATE INDEX `dimension` ON `zt_pivot` (`dimension`);
CREATE INDEX `group`     ON `zt_pivot` (`group`);

-- DROP TABLE IF EXISTS `zt_pivotdrill`;
CREATE TABLE `zt_pivotdrill` (
  `pivot`     mediumint    NOT NULL,
  `field`     varchar(255) NOT NULL,
  `object`    varchar(40)  NOT NULL,
  `whereSql`  mediumtext   NOT NULL,
  `condition` mediumtext   NOT NULL,
  `status`    enum('design', 'published') NOT NULL DEFAULT 'published',
  `account`   varchar(30) NOT NULL DEFAULT '',
  `type`      enum('auto','manual') NOT NULL DEFAULT 'manual'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `zt_sqlview`;
CREATE TABLE IF NOT EXISTS `zt_sqlview` (
  `id` mediumint(8) unsigned NOT NULL auto_increment,
  `name` varchar(90) NOT NULL DEFAULT '',
  `code` varchar(45) NOT NULL DEFAULT '',
  `sql` text NULL,
  `desc` text NULL,
  `createdBy` varchar(30) NOT NULL DEFAULT '',
  `createdDate` datetime NULL,
  `editedBy` varchar(30) NOT NULL DEFAULT '',
  `editedDate` datetime NULL,
  `deleted` enum('0','1') NOT NULL default '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

INSERT INTO `zt_dimension`(`id`, `name`, `code`, `desc`, `createdBy`, `createdDate`, `editedBy`, `editedDate`, `deleted`) VALUES
(1, '宏观管理维度', 'macro', '', 'system', '2023-04-27 20:22:16', '', NULL, '0'),
(2, '效能管理维度', 'efficiency', '', 'system', '2023-04-27 20:22:16', '', NULL, '0'),
(3, '质量管理维度', 'quality', '', 'system', '2023-04-27 20:22:16', '', NULL, '0');

INSERT INTO `zt_module`(`id`, `root`, `branch`, `name`, `parent`, `path`, `grade`, `order`, `type`, `from`, `owner`, `collector`, `short`, `deleted`) VALUES
(32, 1, 0, '产品', 0, ',32,', 1, 10, 'chart', 0, 'system', 'product', '', '0'),
(33, 1, 0, '项目', 0, ',33,', 1, 20, 'chart', 0, 'system', 'project', '', '0'),
(34, 1, 0, '测试', 0, ',34,', 1, 30, 'chart', 0, 'system', 'test', '', '0'),
(35, 1, 0, '组织', 0, ',35,', 1, 40, 'chart', 0, 'system', 'staff', '', '0'),
(36, 1, 0, '需求', 32, ',32,36,', 2, 10, 'chart', 0, '', NULL, '', '0'),
(37, 1, 0, '发布', 32, ',32,37,', 2, 20, 'chart', 0, '', NULL, '', '0'),
(38, 1, 0, '项目', 33, ',33,38,', 2, 10, 'chart', 0, '', NULL, '', '0'),
(39, 1, 0, '任务', 33, ',33,39,', 2, 20, 'chart', 0, '', NULL, '', '0'),
(40, 1, 0, '迭代', 33, ',33,40,', 2, 30, 'chart', 0, '', NULL, '', '0'),
(41, 1, 0, '成本', 33, ',33,41,', 2, 40, 'chart', 0, '', NULL, '', '0'),
(42, 1, 0, '工期', 33, ',33,42,', 2, 50, 'chart', 0, '', NULL, '', '0'),
(43, 1, 0, '需求', 33, ',33,43,', 2, 60, 'chart', 0, '', NULL, '', '0'),
(44, 1, 0, 'Bug', 34, ',34,44,', 2, 10, 'chart', 0, '', NULL, '', '0'),
(45, 1, 0, '项目集', 35, ',35,45,', 2, 10, 'chart', 0, '', NULL, '', '0'),
(46, 1, 0, '项目', 35, ',35,46,', 2, 20, 'chart', 0, '', NULL, '', '0'),
(47, 1, 0, '产品', 35, ',35,47,', 2, 30, 'chart', 0, '', NULL, '', '0'),
(48, 1, 0, '计划', 35, ',35,48,', 2, 40, 'chart', 0, '', NULL, '', '0'),
(49, 1, 0, '迭代', 35, ',35,49,', 2, 50, 'chart', 0, '', NULL, '', '0'),
(50, 1, 0, '发布', 35, ',35,50,', 2, 60, 'chart', 0, '', NULL, '', '0'),
(51, 1, 0, '需求', 35, ',35,51,', 2, 70, 'chart', 0, '', NULL, '', '0'),
(52, 1, 0, '任务', 35, ',35,52,', 2, 80, 'chart', 0, '', NULL, '', '0'),
(53, 1, 0, 'Bug', 35, ',35,53,', 2, 90, 'chart', 0, '', NULL, '', '0'),
(54, 1, 0, '文档', 35, ',35,54,', 2, 100, 'chart', 0, '', NULL, '', '0'),
(55, 1, 0, '成本', 35, ',35,55,', 2, 110, 'chart', 0, '', NULL, '', '0'),
(56, 1, 0, '人员', 35, ',35,56,', 2, 120, 'chart', 0, '', NULL, '', '0'),
(57, 1, 0, '工时', 35, ',35,57,', 2, 130, 'chart', 0, '', NULL, '', '0'),
(58, 1, 0, '行为', 35, ',35,58,', 2, 140, 'chart', 0, '', NULL, '', '0'),
(59, 1, 0, '产品', 0, ',59,', 1, 10, 'pivot', 0, 'system', 'product', '', '0'),
(60, 1, 0, '项目', 0, ',60,', 1, 20, 'pivot', 0, 'system', 'project', '', '0'),
(61, 1, 0, '测试', 0, ',61,', 1, 30, 'pivot', 0, 'system', 'test', '', '0'),
(62, 1, 0, '组织', 0, ',62,', 1, 40, 'pivot', 0, 'system', 'staff', '', '0'),
(63, 1, 0, '产品', 59, ',59,63,', 2, 10, 'pivot', 0, '', NULL, '', '0'),
(64, 1, 0, '项目集', 62, ',62,64,', 2, 10, 'pivot', 0, '', NULL, '', '0'),
(65, 2, 0, '产品', 0, ',65,', 1, 10, 'chart', 0, 'system', 'product', '', '0'),
(66, 2, 0, '项目', 0, ',66,', 1, 20, 'chart', 0, 'system', 'project', '', '0'),
(67, 2, 0, '测试', 0, ',67,', 1, 30, 'chart', 0, 'system', 'test', '', '0'),
(68, 2, 0, '组织', 0, ',68,', 1, 40, 'chart', 0, 'system', 'staff', '', '0'),
(69, 2, 0, '进度', 66, ',66,69,', 2, 10, 'chart', 0, '', NULL, '', '0'),
(70, 2, 0, '成本', 66, ',66,70,', 2, 20, 'chart', 0, '', NULL, '', '0'),
(71, 2, 0, '工期', 66, ',66,71,', 2, 30, 'chart', 0, '', NULL, '', '0'),
(72, 2, 0, '项目', 68, ',68,72,', 2, 10, 'chart', 0, '', NULL, '', '0'),
(73, 2, 0, '迭代', 68, ',68,73,', 2, 20, 'chart', 0, '', NULL, '', '0'),
(74, 2, 0, '发布', 68, ',68,74,', 2, 30, 'chart', 0, '', NULL, '', '0'),
(75, 2, 0, '需求', 68, ',68,75,', 2, 40, 'chart', 0, '', NULL, '', '0'),
(76, 2, 0, '任务', 68, ',68,76,', 2, 50, 'chart', 0, '', NULL, '', '0'),
(77, 2, 0, 'Bug', 68, ',68,77,', 2, 60, 'chart', 0, '', NULL, '', '0'),
(78, 2, 0, '成本', 68, ',68,78,', 2, 70, 'chart', 0, '', NULL, '', '0'),
(79, 2, 0, '产品', 0, ',79,', 1, 10, 'pivot', 0, 'system', 'product', '', '0'),
(80, 2, 0, '项目', 0, ',80,', 1, 20, 'pivot', 0, 'system', 'project', '', '0'),
(81, 2, 0, '测试', 0, ',81,', 1, 30, 'pivot', 0, 'system', 'test', '', '0'),
(82, 2, 0, '组织', 0, ',82,', 1, 40, 'pivot', 0, 'system', 'staff', '', '0'),
(83, 2, 0, '项目', 80, ',80,83,', 2, 10, 'pivot', 0, '', NULL, '', '0'),
(84, 2, 0, '进度', 80, ',80,84,', 2, 20, 'pivot', 0, '', NULL, '', '0'),
(85, 2, 0, '成本', 80, ',80,85,', 2, 30, 'pivot', 0, '', NULL, '', '0'),
(86, 2, 0, '工期', 80, ',80,86,', 2, 40, 'pivot', 0, '', NULL, '', '0'),
(87, 3, 0, '产品', 0, ',87,', 1, 10, 'chart', 0, 'system', 'product', '', '0'),
(88, 3, 0, '项目', 0, ',88,', 1, 20, 'chart', 0, 'system', 'project', '', '0'),
(89, 3, 0, '测试', 0, ',89,', 1, 30, 'chart', 0, 'system', 'test', '', '0'),
(90, 3, 0, '组织', 0, ',90,', 1, 40, 'chart', 0, 'system', 'staff', '', '0'),
(91, 3, 0, 'Bug', 89, ',89,91,', 2, 10, 'chart', 0, '', NULL, '', '0'),
(92, 3, 0, '用例', 89, ',89,92,', 2, 20, 'chart', 0, '', NULL, '', '0'),
(93, 3, 0, '需求', 90, ',90,93,', 2, 10, 'chart', 0, '', NULL, '', '0'),
(94, 3, 0, 'Bug', 90, ',90,94,', 2, 20, 'chart', 0, '', NULL, '', '0'),
(95, 3, 0, '用例', 90, ',90,95,', 2, 30, 'chart', 0, '', NULL, '', '0'),
(96, 3, 0, '产品', 0, ',96,', 1, 10, 'pivot', 0, 'system', 'product', '', '0'),
(97, 3, 0, '项目', 0, ',97,', 1, 20, 'pivot', 0, 'system', 'project', '', '0'),
(98, 3, 0, '测试', 0, ',98,', 1, 30, 'pivot', 0, 'system', 'test', '', '0'),
(99, 3, 0, '组织', 0, ',99,', 1, 40, 'pivot', 0, 'system', 'staff', '', '0'),
(100, 3, 0, 'Bug', 98, ',98,100,', 2, 10, 'pivot', 0, '', NULL, '', '0');

-- DROP TABLE IF EXISTS `zt_space`;
CREATE TABLE `zt_space` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(200) NOT NULL,
  `k8space` char(64) NOT NULL,
  `owner` char(30) NOT NULL,
  `default` tinyint(1) NOT NULL DEFAULT 0,
  `createdAt` datetime NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`),
  KEY `name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `zt_instance`;
CREATE TABLE IF NOT EXISTS `zt_instance` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `space` mediumint(8) unsigned NOT NULL DEFAULT 0,
  `solution` mediumint(8) unsigned NOT NULL DEFAULT 0,
  `name` char(50) NOT NULL DEFAULT '',
  `appID` mediumint(8) unsigned NOT NULL DEFAULT 0,
  `appName` char(50) NOT NULL DEFAULT '',
  `appVersion` char(20) NOT NULL DEFAULT '',
  `chart` char(50) NOT NULL DEFAULT '',
  `logo` varchar(255) NOT NULL DEFAULT '',
  `version` char(50) NOT NULL DEFAULT '',
  `desc` text NULL,
  `introduction` text NULL,
  `source` char(20) NOT NULL DEFAULT '',
  `channel` char(20) NOT NULL DEFAULT '',
  `k8name` char(64) NOT NULL DEFAULT '',
  `status` char(20) NOT NULL DEFAULT '',
  `pinned` enum('0', '1') NOT NULL DEFAULT '0',
  `domain` char(255) NOT NULL DEFAULT '',
  `smtpSnippetName` char(30) NOT NULL DEFAULT '',
  `ldapSnippetName` char(30) NOT NULL DEFAULT '',
  `ldapSettings` text NULL,
  `dbSettings` text NULL,
  `autoBackup` tinyint(1) NOT NULL DEFAULT 0,
  `backupKeepDays` int unsigned NOT NULL DEFAULT 1,
  `autoRestore` tinyint(1) NOT NULL DEFAULT 0,
  `env` text NULL,
  `createdBy` char(30) NOT NULL DEFAULT '',
  `createdAt` datetime NULL,
  `deleted` tinyint(1) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`),
  KEY `space` (`space`),
  KEY `k8name` (`k8name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `zt_solution`;
CREATE TABLE IF NOT EXISTS `zt_solution` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `name` char(50) NOT NULL DEFAULT '',
  `appID` mediumint(8) unsigned NOT NULL DEFAULT 0,
  `appName` char(50) NOT NULL DEFAULT '',
  `appVersion` char(20) NOT NULL DEFAULT '',
  `version` char(50) NOT NULL DEFAULT '',
  `chart` char(50) NOT NULL DEFAULT '',
  `cover` varchar(255) NOT NULL DEFAULT '',
  `desc` text NULL,
  `introduction` varchar(255) NOT NULL DEFAULT '',
  `source` char(20) NOT NULL DEFAULT '',
  `channel` char(20) NOT NULL DEFAULT '',
  `components` text NULL,
  `status` char(20) NOT NULL DEFAULT '',
  `deleted` tinyint(1) NOT NULL DEFAULT 0,
  `createdBy` char(30) NOT NULL DEFAULT '',
  `createdAt` datetime NULL,
  `updatedDate` datetime NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP FUNCTION IF EXISTS `get_monday`;
CREATE FUNCTION `get_monday`(day date) RETURNS date READS SQL DATA
  begin if date_format(day, '%w') = 0 then return subdate(day, date_format(day, '%w') - 6)__DELIMITER__
  else  return subdate(day, date_format(day, '%w') -1)__DELIMITER__
  end if__DELIMITER__
END;

DROP FUNCTION IF EXISTS `get_sunday`;
CREATE FUNCTION `get_sunday`(day date) RETURNS date READS SQL DATA
begin
  if date_format(day, '%w') = 0 then return day__DELIMITER__
  else return subdate(day, date_format(day, '%w') - 7)__DELIMITER__
  end if__DELIMITER__
END;

DROP FUNCTION IF EXISTS `qc_cminited`;
CREATE FUNCTION qc_cminited($project int, $category varchar(30)) returns int READS SQL DATA
begin
    declare products int default 0__DELIMITER__
    declare objects  int default 0__DELIMITER__
    select COUNT(1) from zt_projectproduct where project = $project into products__DELIMITER__
    select COUNT(DISTINCT product) from zt_object where project = $project and category = $category and type = 'taged' and product in (select product from zt_projectproduct where project = $project) into objects__DELIMITER__
    IF products = objects THEN
    return 1__DELIMITER__
    ELSEIF products != objects THEN
    return 0__DELIMITER__
    END IF__DELIMITER__
END;

DROP FUNCTION IF EXISTS `qc_initscale`;
CREATE FUNCTION qc_initscale($project int, $category varchar(30), $estimateType varchar(30)) RETURNS float(10,2) READS SQL DATA
BEGIN
    declare $estimate int default 0__DELIMITER__
    declare $storyEst varchar(30) default 'storyEst'__DELIMITER__
    declare $requestEst varchar(30) default 'requestEst'__DELIMITER__
    if($estimateType = $storyEst) THEN SELECT sum(storyEst) as estimate FROM zt_object WHERE id in(SELECT MIN(id) FROM zt_object WHERE project = $project and category = $category and type = 'taged' and product in (select product from zt_projectproduct where project = $project) group by `product`) into @estimate__DELIMITER__
    end if__DELIMITER__
    if($estimateType = $requestEst) THEN SELECT sum(requestEst) as estimate FROM zt_object WHERE id in(SELECT MIN(id) FROM zt_object WHERE project = $project and category = $category and type = 'taged' and product in (select product from zt_projectproduct where project = $project) group by `product`) into @estimate__DELIMITER__
    end if__DELIMITER__
    RETURN @estimate__DELIMITER__
END;

DROP FUNCTION IF EXISTS `qc_pgmplanscale`;
CREATE FUNCTION `qc_pgmplanscale`($project int) RETURNS float(10,2) READS SQL DATA
BEGIN
   declare programScale float (10,2) default 0__DELIMITER__
   select `scale` from zt_workestimation where project = $project into @programScale__DELIMITER__
   return @programScale__DELIMITER__
END;

DROP FUNCTION IF EXISTS `qc_pgmsrinitscale`;
CREATE FUNCTION `qc_pgmsrinitscale`($project int) RETURNS float(10,2) READS SQL DATA
begin
    declare scale int default 0__DELIMITER__
    declare inited int default 0__DELIMITER__
    select qc_cminited($project, 'SRS') into inited__DELIMITER__
    IF inited = 1 THEN
    select qc_initscale($project, 'SRS', 'storyEst') into scale __DELIMITER__
    return scale __DELIMITER__
    ELSE
    return 0__DELIMITER__
    END IF__DELIMITER__
END;

DROP FUNCTION IF EXISTS `qc_pgmsrrealscale`;
CREATE FUNCTION `qc_pgmsrrealscale`($project int) RETURNS float(10,2) READS SQL DATA
BEGIN
  declare totalEstimate float(10,2) default 0__DELIMITER__
  select CAST(sum(estimate) as DECIMAL(10,2)) as estimate from zt_story where id in (select story from zt_projectstory where project=$project) and type='story' and deleted='0' and closedReason not in ('subdivided', 'duplicate', 'willnotdo', 'cancel', 'bydesign') into totalEstimate__DELIMITER__
  return totalEstimate__DELIMITER__
END;

DROP FUNCTION IF EXISTS `qc_pgmurinitscale`;
CREATE FUNCTION `qc_pgmurinitscale`($project int) RETURNS float(10,2) READS SQL DATA
begin
    declare scale int default 0__DELIMITER__
    declare inited int default 0__DELIMITER__
    select qc_cminited($project, 'URS') into inited__DELIMITER__
    IF inited = 1 THEN
    select qc_initscale($project, 'URS', 'requestEst') into scale__DELIMITER__
    return scale__DELIMITER__
    ELSE
    return 0__DELIMITER__
    END IF__DELIMITER__
END;

DROP FUNCTION IF EXISTS `qc_pgmurrealscale`;
CREATE FUNCTION `qc_pgmurrealscale`($project int) RETURNS float(10,2) READS SQL DATA
BEGIN
  declare totalEstimate float(10,2) default 0__DELIMITER__
  select CAST(sum(estimate) as DECIMAL(10,2)) as estimate from zt_story where project=$project and type='requirement' and deleted='0' and closedReason not in ('subdivided', 'duplicate', 'willnotdo', 'cancel', 'bydesign') into totalEstimate__DELIMITER__
  return totalEstimate__DELIMITER__
END;

DROP FUNCTION IF EXISTS `qc_pgmallrequirementstage`;
CREATE FUNCTION `qc_pgmallrequirementstage`($project int) RETURNS int(1) READS SQL DATA
BEGIN
    -- 获取项目产品总数
    select COUNT(1) AS products from zt_projectproduct where project = $project into @totalproduct__DELIMITER__
    -- 获取已经设置需求阶段的产品总数
    select COUNT(1) AS product from (select product from zt_projectproduct where project in (select id from zt_project where project = $project and type = 'stage' and attribute = 'request' and deleted = '0') GROUP BY product) as product into @product__DELIMITER__
    -- 让项目产品总数和已设置需求阶段产品总数比较,都设置返回1,否则返回0
    if @totalproduct = @product then return 1__DELIMITER__
    end if__DELIMITER__
    RETURN 0__DELIMITER__
END;

DROP FUNCTION IF EXISTS `qc_pgmdesigntplandays`;
CREATE FUNCTION `qc_pgmdesigntplandays`($project int) RETURNS int(11) READS SQL DATA
BEGIN
    select qc_pgmspecifiedtypeplanneddays($project,'design') as days into @days__DELIMITER__
    return @days__DELIMITER__
END;

DROP FUNCTION IF EXISTS `qc_pgmdesigntrealdays`;
CREATE FUNCTION `qc_pgmdesigntrealdays`($project int) RETURNS int(11) READS SQL DATA
BEGIN
    select qc_pgmspecifiedtypeactualdays($project,'design') as days into @days__DELIMITER__
    return @days__DELIMITER__
END;

DROP FUNCTION IF EXISTS `qc_pgmdevelplandays`;
CREATE FUNCTION `qc_pgmdevelplandays`($project int) RETURNS int(11) READS SQL DATA
BEGIN
    select qc_pgmspecifiedtypeplanneddays($project,'dev') as days into @days__DELIMITER__
    return @days__DELIMITER__
END;

DROP FUNCTION IF EXISTS `qc_pgmdevelrealdays`;
CREATE FUNCTION `qc_pgmdevelrealdays`($project int) RETURNS int(11) READS SQL DATA
BEGIN
    select qc_pgmspecifiedtypeactualdays($project,'dev') as days into @days__DELIMITER__
    return @days__DELIMITER__
END;

DROP FUNCTION IF EXISTS `qc_pgmrequestplandays`;
CREATE FUNCTION `qc_pgmrequestplandays`($project int) RETURNS int(11) READS SQL DATA
BEGIN
    select qc_pgmspecifiedtypeplanneddays($project,'request') as days into @days__DELIMITER__
    return @days__DELIMITER__
END;

DROP FUNCTION IF EXISTS `qc_pgmrequestrealdays`;
CREATE FUNCTION `qc_pgmrequestrealdays`($project int) RETURNS int(11) READS SQL DATA
BEGIN
    select qc_pgmspecifiedtypeactualdays($project,'request') as days into @days__DELIMITER__
    return @days__DELIMITER__
END;

DROP FUNCTION IF EXISTS `qc_pgmspecifiedtypeactualdays`;
CREATE FUNCTION `qc_pgmspecifiedtypeactualdays`($project int,$attribute varchar(50)) RETURNS int(11) READS SQL DATA
BEGIN
    -- 查询某类型的阶段总数
    select COUNT(1) from zt_project where project = $project and attribute = $attribute and deleted = '0' and id not in (select parent from zt_project where project = $project and attribute = $attribute and grade = 2 group by parent) into @totalstory__DELIMITER__
    -- 查询某类型已设置实际工期的阶段总数
    select COUNT(1) from zt_project where project = $project and attribute = $attribute and deleted = '0' and realDuration > 0 and id not in (select parent from zt_project where project = $project and attribute = $attribute and grade = 2 group by parent) into @setstory__DELIMITER__
    -- 查询项目下某类型阶段实际工期总数
    select sum(realDuration) as realDuration from zt_project where project = $project and attribute = $attribute and deleted = '0' and realDuration > 0 and id not in (select parent from zt_project where project = $project and attribute = $attribute and grade = 2 group by parent) into @days__DELIMITER__
    -- 判断项目下某类型的阶段是否都已设置实际工期
    if @totalstory != @setstory then
        set @days = 0__DELIMITER__
    end if__DELIMITER__
    return @days__DELIMITER__
END;

DROP FUNCTION IF EXISTS `qc_pgmspecifiedtypeplanneddays`;
CREATE FUNCTION `qc_pgmspecifiedtypeplanneddays`($project int,$attribute varchar(50)) RETURNS int(11) READS SQL DATA
BEGIN
    select sum(planDuration) as planDuration from zt_project where project = $project and attribute = $attribute and deleted = '0' and id not in (select parent from zt_project where project = $project and attribute = $attribute and grade = 2 group by parent) into @days__DELIMITER__
    return @days__DELIMITER__
END;

DROP FUNCTION IF EXISTS `qc_pgmstageactualduration`;
CREATE FUNCTION `qc_pgmstageactualduration`($product int, $attribute varchar(50)) RETURNS int(11) READS SQL DATA
BEGIN
    -- 查找某类型的阶段总数
    select COUNT(1) AS totalduration from zt_project where id in (select project from zt_projectproduct where product = $product) and type = 'stage' and attribute = $attribute and deleted = '0' and id not in (select parent from zt_project where id in (select project from zt_projectproduct where product = $product) and attribute = $attribute and grade = 2 group by parent) into @totalduration__DELIMITER__
    -- 查某类型阶段已设置实际工期的总数
    select COUNT(1) AS setduration from zt_project where id in (select project from zt_projectproduct where product = $product) and type = 'stage' and attribute = $attribute and deleted = '0' and id not in (select parent from zt_project where id in (select project from zt_projectproduct where product = $product) and attribute = $attribute and grade = 2 group by parent) and realDuration > 0 into @setduration__DELIMITER__
    -- 指定产品下某类型的阶段实际工期总和
    select sum(realDuration) as duration from zt_project where id in (select project from zt_projectproduct where product = $product) and type = 'stage' and attribute = $attribute and deleted = '0' and id not in (select parent from zt_project where id in (select project from zt_projectproduct where product = $product) and attribute = $attribute and grade = 2 group by parent) and realDuration > 0 into @duration__DELIMITER__
    -- 需要判断该类型阶段都已设置实际工期,否则不统计
    if @totalduration != @setduration then
        set @duration = 0__DELIMITER__
    end if__DELIMITER__
    return @duration__DELIMITER__
END;

DROP FUNCTION IF EXISTS `qc_pgmstageplannedduration`;
CREATE FUNCTION `qc_pgmstageplannedduration`($product int, $attribute varchar(50)) RETURNS int(11) READS SQL DATA
BEGIN
    -- 查找某产品对应阶段
    select sum(planDuration) as duration from zt_project where id in (select project from zt_projectproduct where product = $product) and attribute = $attribute and deleted = '0' and id not in (select parent from zt_project where id in (select project from zt_projectproduct where product = $product) and attribute = $attribute and grade = 2 group by parent) and planDuration > 0 into @duration__DELIMITER__
    RETURN @duration__DELIMITER__
END;

DROP FUNCTION IF EXISTS `qc_pgmtestplandays`;
CREATE FUNCTION `qc_pgmtestplandays`($project int) RETURNS int(11) READS SQL DATA
BEGIN
    select qc_pgmspecifiedtypeplanneddays($project,'qa') as days into @days__DELIMITER__
    return @days__DELIMITER__
END;

DROP FUNCTION IF EXISTS `qc_pgmtestrealdays`;
CREATE FUNCTION `qc_pgmtestrealdays`($project int) RETURNS int(11) READS SQL DATA
BEGIN
    select qc_pgmspecifiedtypeactualdays($project,'qa') as days into @days__DELIMITER__
    return @days__DELIMITER__
END;

DROP FUNCTION IF EXISTS `qc_prddesigntplandays`;
CREATE FUNCTION `qc_prddesigntplandays`($project int, $product int) RETURNS int(11) READS SQL DATA
BEGIN
    select qc_pgmstageplannedduration($project, $product, 'design') as days into @days__DELIMITER__
    return @days__DELIMITER__
END;

DROP FUNCTION IF EXISTS `qc_prddesigntrealdays`;
CREATE FUNCTION `qc_prddesigntrealdays`($project int, $product int) RETURNS int(11) READS SQL DATA
BEGIN
    select qc_pgmstageactualduration($project, $product, 'design') as days into @days__DELIMITER__
    return @days__DELIMITER__
END;

DROP FUNCTION IF EXISTS `qc_prddevelplandays`;
CREATE FUNCTION `qc_prddevelplandays`($project int, $product int) RETURNS int(11) READS SQL DATA
BEGIN
    select qc_pgmstageplannedduration($project, $product, 'dev') as days into @days__DELIMITER__
    return @days__DELIMITER__
END;

DROP FUNCTION IF EXISTS `qc_prddevelrealdays`;
CREATE FUNCTION `qc_prddevelrealdays`($project int, $product int) RETURNS int(11) READS SQL DATA
BEGIN
    select qc_pgmstageactualduration($project, $product, 'dev') as days into @days__DELIMITER__
    return @days__DELIMITER__
END;

DROP FUNCTION IF EXISTS `qc_prdrequestplandays`;
CREATE FUNCTION `qc_prdrequestplandays`($project int, $product int) RETURNS int(11) READS SQL DATA
BEGIN
    select qc_pgmstageplannedduration($project, $product, 'request') as days into @days__DELIMITER__
    return @days__DELIMITER__
END;

DROP FUNCTION IF EXISTS `qc_prdrequestrealdays`;
CREATE FUNCTION `qc_prdrequestrealdays`($project int, $product int) RETURNS int(11) READS SQL DATA
BEGIN
    select qc_pgmstageactualduration($project, $product, 'request') as days into @days__DELIMITER__
    return @days__DELIMITER__
END;

DROP FUNCTION IF EXISTS `qc_prdtestplandays`;
CREATE FUNCTION `qc_prdtestplandays`($project int, $product int) RETURNS int(11) READS SQL DATA
BEGIN
    select qc_pgmstageplannedduration($project, $product, 'qa') as days into @days__DELIMITER__
    return @days__DELIMITER__
END;

DROP FUNCTION IF EXISTS `qc_prdtestrealdays`;
CREATE FUNCTION `qc_prdtestrealdays`($project int, $product int) RETURNS int(11) READS SQL DATA
BEGIN
    select qc_pgmstageactualduration($project, $product, 'qa') as days into @days__DELIMITER__
    return @days__DELIMITER__
END;

DROP FUNCTION IF EXISTS `qc_pgmdesgignrealesthours`;
CREATE FUNCTION `qc_pgmdesgignrealesthours`($project int) RETURNS float(10,2) READS SQL DATA
BEGIN
return qc_pgmesthoursbytype($project, 'design')__DELIMITER__
END;

DROP FUNCTION IF EXISTS `qc_pgmdesignrealhours`;
CREATE FUNCTION `qc_pgmdesignrealhours`($project int) RETURNS float(10,2) READS SQL DATA
BEGIN
return qc_pgmrealhoursbytype($project, 'design')__DELIMITER__
END;

DROP FUNCTION IF EXISTS `qc_pgmdevelrealesthours`;
CREATE FUNCTION `qc_pgmdevelrealesthours`($project int) RETURNS float(10,2) READS SQL DATA
BEGIN
return qc_pgmesthoursbytype($project, 'devel')__DELIMITER__
END;

DROP FUNCTION IF EXISTS `qc_pgmdevelrealhours`;
CREATE FUNCTION `qc_pgmdevelrealhours`($project int) RETURNS float(10,2) READS SQL DATA
BEGIN
return qc_pgmrealhoursbytype($project, 'devel')__DELIMITER__
END;

DROP FUNCTION IF EXISTS `qc_pgmrealesthours`;
CREATE FUNCTION `qc_pgmrealesthours`($project int) RETURNS float(10,2) READS SQL DATA
BEGIN
  select CAST(sum(estimate) as DECIMAL(10,2)) as estimate from zt_task where project=$project and parent >= 0 and status != 'cancel' and deleted = '0' into @estimate__DELIMITER__
  return @estimate__DELIMITER__
END;

DROP FUNCTION IF EXISTS `qc_pgmesthoursbytype`;
CREATE FUNCTION `qc_pgmesthoursbytype`($project int, $type char(30)) RETURNS float(10,2) READS SQL DATA
BEGIN
  select CAST(sum(estimate) as DECIMAL(10,2)) as estimate from zt_task where project=$project and type = $type and parent >= 0 and status != 'cancel' and deleted = '0' into @estimate__DELIMITER__
  return @estimate__DELIMITER__
END;

DROP FUNCTION IF EXISTS `qc_pgmrealhours`;
CREATE FUNCTION `qc_pgmrealhours`($project int) RETURNS float(10,2) READS SQL DATA
BEGIN
  select CAST(sum(consumed) as DECIMAL(10,2)) as consumed from zt_task where project=$project and parent >= 0 and status != 'cancel' and deleted = '0' into @consumed__DELIMITER__
  return @consumed__DELIMITER__
END;

DROP FUNCTION IF EXISTS `qc_pgmrealhoursbytype`;
CREATE FUNCTION `qc_pgmrealhoursbytype`($project int, $type char(30)) RETURNS float(10,2) READS SQL DATA
BEGIN
  select CAST(sum(consumed) as DECIMAL(10,2)) as consumed from zt_task where project=$project and type = $type and parent >= 0 and status != 'cancel' and deleted = '0' into @consumed__DELIMITER__
  return @consumed__DELIMITER__
END;

DROP FUNCTION IF EXISTS `qc_pgmrequestrealesthours`;
CREATE FUNCTION `qc_pgmrequestrealesthours`($project int) RETURNS float(10,2) READS SQL DATA
BEGIN
return qc_pgmesthoursbytype($project, 'request')__DELIMITER__
END;

DROP FUNCTION IF EXISTS `qc_pgmrequestrealhours`;
CREATE FUNCTION `qc_pgmrequestrealhours`($project int) RETURNS float(10,2) READS SQL DATA
BEGIN
return qc_pgmrealhoursbytype($project, 'request')__DELIMITER__
END;

DROP FUNCTION IF EXISTS `qc_pgmtestrealesthours`;
CREATE FUNCTION `qc_pgmtestrealesthours`($project int) RETURNS float(10,2) READS SQL DATA
BEGIN
return qc_pgmesthoursbytype($project, 'test')__DELIMITER__
END;

DROP FUNCTION IF EXISTS `qc_pgmtestrealhours`;
CREATE FUNCTION `qc_pgmtestrealhours`($project int) RETURNS float(10,2) READS SQL DATA
BEGIN
return qc_pgmrealhoursbytype($project, 'test')__DELIMITER__
END;

DROP FUNCTION IF EXISTS `qc_getdevelfirstesthours`;
CREATE FUNCTION `qc_getdevelfirstesthours`($project int) RETURNS float(10,2) READS SQL DATA
BEGIN
    SELECT sum(devEst) as estimate FROM zt_object WHERE id in(SELECT MIN(id) FROM zt_object WHERE project = $project and category = 'PP' and type = 'taged' and product in (select product from zt_projectproduct where project = $project) group by `product`) into @estimate__DELIMITER__

    return @estimate__DELIMITER__
END;

DROP FUNCTION IF EXISTS `qc_getdesignfirstesthours`;
CREATE FUNCTION `qc_getdesignfirstesthours`($project int) RETURNS float(10,2) READS SQL DATA
BEGIN
    SELECT sum(designEst) as estimate FROM zt_object WHERE id in(SELECT MIN(id) FROM zt_object WHERE project = $project and category = 'PP' and type = 'taged' and product in (select product from zt_projectproduct where project = $project) group by `product`) into @estimate__DELIMITER__

    return @estimate__DELIMITER__
END;

DROP FUNCTION IF EXISTS `qc_getstoryfirstesthours`;
CREATE FUNCTION `qc_getstoryfirstesthours`($project int) RETURNS float(10,2) READS SQL DATA
BEGIN
    SELECT sum(requestEst) as estimate FROM zt_object WHERE id in(SELECT MIN(id) FROM zt_object WHERE project = $project and category = 'PP' and type = 'taged' and product in (select product from zt_projectproduct where project = $project) group by `product`) into @estimate__DELIMITER__

    return @estimate__DELIMITER__
END;

DROP FUNCTION IF EXISTS `qc_gettestfirstesthours`;
CREATE FUNCTION `qc_gettestfirstesthours`($project int) RETURNS float(10,2) READS SQL DATA
BEGIN
    SELECT sum(testEst) as estimate FROM zt_object WHERE id in(SELECT MIN(id) FROM zt_object WHERE project = $project and category = 'PP' and type = 'taged' and product in (select product from zt_projectproduct where project = $project) group by `product`) into @estimate__DELIMITER__

    return @estimate__DELIMITER__
END;

DROP FUNCTION IF EXISTS `qc_getfirstesthours`;
CREATE FUNCTION `qc_getfirstesthours`($project int) RETURNS float(10,2) READS SQL DATA
BEGIN
    SELECT sum(taskEst) as estimate FROM zt_object WHERE id in(SELECT MIN(id) FROM zt_object WHERE project = $project and category = 'PP' and type = 'taged' and product in (select product from zt_projectproduct where project = $project) group by `product`) into @estimate__DELIMITER__

    return @estimate__DELIMITER__
END;

DROP FUNCTION IF EXISTS `qc_getdevlastesthours`;
CREATE FUNCTION `qc_getdevlastesthours`($project int) RETURNS float(10,2) READS SQL DATA
BEGIN
    SELECT sum(devEst) as estimate FROM zt_object WHERE id in(SELECT MAX(id) FROM zt_object WHERE project = $project and category = 'PP' and type = 'taged' and product in (select product from zt_projectproduct where project = $project) group by `product`) into @estimate__DELIMITER__

    return @estimate__DELIMITER__
END;

DROP FUNCTION IF EXISTS `qc_getrequestlastesthours`;
CREATE FUNCTION `qc_getrequestlastesthours`($project int) RETURNS float(10,2) READS SQL DATA
BEGIN
    SELECT sum(requestEst) as estimate FROM zt_object WHERE id in(SELECT MAX(id) FROM zt_object WHERE project = $project and category = 'PP' and type = 'taged' and product in (select product from zt_projectproduct where project = $project) group by `product`) into @estimate__DELIMITER__

    return @estimate__DELIMITER__
END;

DROP FUNCTION IF EXISTS `qc_gettestlastesthours`;
CREATE FUNCTION `qc_gettestlastesthours`($project int) RETURNS float(10,2) READS SQL DATA
BEGIN
    SELECT sum(testEst) as estimate FROM zt_object WHERE id in(SELECT MAX(id) FROM zt_object WHERE project = $project and category = 'PP' and type = 'taged' and product in (select product from zt_projectproduct where project = $project) group by `product`) into @estimate__DELIMITER__

    return @estimate__DELIMITER__
END;

DROP FUNCTION IF EXISTS `qc_getdesignlastesthours`;
CREATE FUNCTION `qc_getdesignlastesthours`($project int) RETURNS float(10,2) READS SQL DATA
BEGIN
    SELECT sum(designEst) as estimate FROM zt_object WHERE id in(SELECT MAX(id) FROM zt_object WHERE project = $project and category = 'PP' and type = 'taged' and product in (select product from zt_projectproduct where project = $project) group by `product`) into @estimate__DELIMITER__

    return @estimate__DELIMITER__
END;

DROP FUNCTION IF EXISTS `qc_getlastesthours`;
CREATE FUNCTION `qc_getlastesthours`($project int) RETURNS float(10,2) READS SQL DATA
BEGIN
    SELECT sum(taskEst) as estimate FROM zt_object WHERE id in(SELECT MAX(id) FROM zt_object WHERE project = $project and category = 'PP' and type = 'taged' and product in (select product from zt_projectproduct where project = $project) group by `product`) into @estimate__DELIMITER__

    return @estimate__DELIMITER__
END;

DROP FUNCTION IF EXISTS `qc_pgmlastesthours`;
CREATE FUNCTION `qc_pgmlastesthours`($project int) RETURNS float(10,2) READS SQL DATA
BEGIN
    declare estimate float(10,2) default 0__DELIMITER__
    declare inited int default 0__DELIMITER__
    select qc_cminited($project,'PP') into inited__DELIMITER__
    IF inited = 1 THEN
    select qc_getlastesthours($project) into estimate__DELIMITER__
    return estimate__DELIMITER__
    ELSE
    return 0__DELIMITER__
    END IF__DELIMITER__
END;

-- DROP TABLE IF EXISTS `zt_demandpool`;
CREATE TABLE `zt_demandpool` (
  `id` int(8) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL DEFAULT '',
  `desc` mediumtext NULL,
  `status` char(30) NOT NULL DEFAULT '',
  `products` varchar(255) NOT NULL DEFAULT '',
  `createdBy` char(30) NOT NULL DEFAULT '',
  `createdDate` date NULL,
  `owner` text NULL,
  `reviewer` text NULL,
  `acl` char(30) NULL,
  `deleted` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `zt_demand`;
CREATE TABLE `zt_demand` (
  `id` int(8) NOT NULL AUTO_INCREMENT,
  `pool` int(8) NOT NULL DEFAULT '0',
  `module` int(8) NOT NULL DEFAULT '0',
  `product` varchar(255) NOT NULL DEFAULT '',
  `parent` mediumint(8) NOT NULL DEFAULT '0',
  `pri` char(30) NOT NULL DEFAULT '',
  `category` char(30) NOT NULL DEFAULT '',
  `source` char(30) NOT NULL DEFAULT '',
  `sourceNote` varchar(255) NOT NULL DEFAULT '',
  `title` varchar(255) NOT NULL DEFAULT '',
  `feedbackedBy` varchar(255) NOT NULL DEFAULT '',
  `email` varchar(255) NOT NULL DEFAULT '',
  `assignedTo` char(30) NOT NULL DEFAULT '',
  `assignedDate` datetime NULL,
  `reviewedBy` text NULL,
  `reviewedDate` datetime NULL,
  `status` char(30) NOT NULL DEFAULT '',
  `stage` enum('wait','distributed','inroadmap','incharter','developing','delivering','delivered','closed') NOT NULL DEFAULT 'wait',
  `duration` char(30) NOT NULL DEFAULT '',
  `BSA` char(30) NOT NULL DEFAULT '',
  `story` mediumint(8) NOT NULL DEFAULT '0',
  `roadmap` mediumint(8) NOT NULL DEFAULT '0',
  `createdBy` char(30) NOT NULL DEFAULT '',
  `createdDate` datetime NULL,
  `mailto` text NULL,
  `duplicateDemand` mediumint(8) NULL,
  `childDemands` varchar(255) NOT NULL DEFAULT '',
  `version` varchar(255) NOT NULL DEFAULT '',
  `parentVersion` smallint NOT NULL DEFAULT 0,
  `vision` varchar(255) NOT NULL DEFAULT 'or',
  `color` varchar(255) NOT NULL DEFAULT '',
  `changedBy` char(30) NOT NULL DEFAULT '',
  `changedDate` datetime NULL,
  `closedBy` char(30) NOT NULL DEFAULT '',
  `closedDate` datetime NULL,
  `closedReason` varchar(30) NOT NULL DEFAULT '',
  `submitedBy` varchar(30) NOT NULL DEFAULT '',
  `lastEditedBy` varchar(30) NOT NULL DEFAULT '',
  `lastEditedDate` datetime NULL,
  `activatedDate` datetime NULL,
  `distributedBy` varchar(30) NOT NULL DEFAULT '',
  `distributedDate` datetime NULL,
  `feedback` mediumint(9) NOT NULL DEFAULT '0',
  `keywords` varchar(255) NOT NULL DEFAULT '',
  `deleted` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `zt_demandspec`;
CREATE TABLE `zt_demandspec` (
  `demand` mediumint(9) NOT NULL DEFAULT '0',
  `version` smallint(6) NOT NULL DEFAULT '0',
  `title` varchar(255) NOT NULL DEFAULT '',
  `spec` mediumtext NULL,
  `verify` mediumtext NULL,
  `files` text NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE UNIQUE INDEX `demand` ON `zt_demandspec`(`demand`,`version`);

-- DROP TABLE IF EXISTS `zt_demandreview`;
CREATE TABLE `zt_demandreview` (
  `demand` mediumint(9) NOT NULL DEFAULT '0',
  `version` smallint(6) NOT NULL DEFAULT '0',
  `reviewer` varchar(30) NOT NULL DEFAULT '',
  `result` varchar(30) NOT NULL DEFAULT '',
  `reviewDate` datetime NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE UNIQUE INDEX `demand` ON `zt_demandreview`(`demand`,`version`,`reviewer`);

-- DROP TABLE IF EXISTS `zt_charter`;
CREATE TABLE `zt_charter` (
  `id` int(8) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL DEFAULT '',
  `level` int(8) NOT NULL DEFAULT '0',
  `category` char(30) NOT NULL DEFAULT '',
  `market` varchar(30) NOT NULL DEFAULT '',
  `check` enum('0','1') NOT NULL DEFAULT '0',
  `appliedBy` char(30) NOT NULL DEFAULT '',
  `appliedDate` datetime NULL,
  `budget` char(30) NOT NULL DEFAULT '',
  `budgetUnit` char(30) NOT NULL DEFAULT '',
  `product` text NULL,
  `roadmap` text NULL,
  `spec` mediumtext NULL,
  `status` char(30) NOT NULL DEFAULT '',
  `createdBy` char(30) NOT NULL DEFAULT '',
  `createdDate` datetime NULL,
  `charterFiles` text NULL,
  `closedBy` char(30) NOT NULL DEFAULT '',
  `closedDate` datetime NULL,
  `closedReason` varchar(255) NOT NULL DEFAULT '',
  `activatedBy` char(30) NOT NULL DEFAULT '',
  `activatedDate` datetime NULL,
  `reviewedBy` varchar(255) NOT NULL DEFAULT '',
  `reviewedResult` char(30) NOT NULL DEFAULT '',
  `reviewedDate` datetime NULL,
  `meetingDate` date NULL,
  `meetingLocation` varchar(255) NOT NULL DEFAULT '',
  `meetingMinutes` mediumtext NULL,
  `deleted` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

REPLACE INTO `zt_config` (`vision`, `owner`, `module`, `section`, `key`, `value`) VALUES ('or', 'system', 'demand', '', 'reviewRules', 'allpass');
REPLACE INTO `zt_config` (`vision`, `owner`, `module`, `section`, `key`, `value`) VALUES ('or', 'system', 'demand', '', 'needReview', 1);

-- DROP TABLE IF EXISTS `zt_roadmap`;
CREATE TABLE `zt_roadmap` (
  `id` mediumint(8) NOT NULL AUTO_INCREMENT,
  `product` mediumint(8) NOT NULL DEFAULT '0',
  `branch` mediumint(8) NOT NULL DEFAULT '0',
  `name` varchar(255) NOT NULL DEFAULT '',
  `status` char(30) NOT NULL DEFAULT '',
  `begin` date NULL,
  `end` date NULL,
  `desc` longtext NULL,
  `createdBy` char(30) NOT NULL DEFAULT '',
  `createdDate` date NULL,
  `closedBy` char(30) NOT NULL DEFAULT '',
  `closedDate` datetime NULL,
  `closedReason` enum('done','canceled') DEFAULT NULL,
  `deleted` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `zt_roadmapstory`;
CREATE TABLE `zt_roadmapstory` (
  `roadmap` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `story` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `order` mediumint(8)  UNSIGNED  NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE UNIQUE INDEX `roadmap_story` ON `zt_roadmapstory`(`roadmap`,`story`);

REPLACE INTO `zt_stage` (`name`, `percent`, `type`, `projectType`, `createdBy`, `createdDate`, `editedBy`, `editedDate`, `deleted`) VALUES
('概念',        '10',   'concept',   'ipd', 'admin', '2020-02-08 21:08:30',  'admin', '2020-02-12 13:50:27',  '0'),
('计划',        '10',   'plan',      'ipd', 'admin', '2020-02-08 21:08:30',  'admin', '2020-02-12 13:50:27',  '0'),
('开发',        '50',   'develop',   'ipd', 'admin', '2020-02-08 21:08:30',  'admin', '2020-02-12 13:50:27',  '0'),
('验证',        '15',   'qualify',   'ipd', 'admin', '2020-02-08 21:08:30',  'admin', '2020-02-12 13:50:27',  '0'),
('发布',        '10',   'launch',    'ipd', 'admin', '2020-02-08 21:08:30',  'admin', '2020-02-12 13:50:27',  '0'),
('生命周期',    '5',    'lifecycle', 'ipd', 'admin', '2020-02-08 21:08:45',  'admin', '2020-02-12 13:50:27',  '0');

-- DROP TABLE IF EXISTS `zt_ai_model`;
CREATE TABLE IF NOT EXISTS `zt_ai_model` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `type` varchar(20) NOT NULL,
  `vendor` varchar(20) NOT NULL,
  `credentials` text NOT NULL,
  `proxy` text DEFAULT NULL,
  `name` varchar(20) DEFAULT NULL,
  `desc` text DEFAULT NULL,
  `createdBy` varchar(30) NOT NULL,
  `createdDate` datetime NOT NULL,
  `editedBy` varchar(30) DEFAULT NULL,
  `editedDate` datetime DEFAULT NULL,
  `enabled` enum('0', '1') NOT NULL DEFAULT '1',
  `deleted` enum('0', '1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `zt_ai_prompt`;
CREATE TABLE IF NOT EXISTS `zt_ai_prompt` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(20) NOT NULL,
  `desc` text DEFAULT NULL,
  `model` mediumint(8) unsigned DEFAULT NULL,
  `module` varchar(30) DEFAULT NULL,
  `source` text DEFAULT NULL,
  `targetForm` varchar(30) DEFAULT NULL,
  `purpose` text DEFAULT NULL,
  `elaboration` text DEFAULT NULL,
  `role` text DEFAULT NULL,
  `characterization` text DEFAULT NULL,
  `status` enum('draft','active') NOT NULL DEFAULT 'draft',
  `createdBy` varchar(30) NOT NULL,
  `createdDate` datetime NOT NULL,
  `editedBy` varchar(30) DEFAULT NULL,
  `editedDate` datetime DEFAULT NULL,
  `deleted` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

INSERT INTO `zt_ai_prompt` (`name`, `model`, `module`, `source`, `targetForm`, `purpose`, `elaboration`, `role`, `characterization`, `createdBy`, `createdDate`, `status`) VALUES
('需求润色', 0, 'story', ',story.title,story.spec,story.verify,story.product,story.module,story.pri,story.category,story.estimate,', 'story.change', '帮忙优化其中各字段的表述，使表述清晰准确。必要时可以修改需求使其更加合理。', '需求描述格式建议使用：作为一名<某种类型的用户>，我希望<达成某些目的>，这样可以<开发的价值>。验收标准建议列举多条。直接给出你的润色结果，无需建议。', '请你扮演一名资深的产品经理。', '负责产品战略、设计、开发、数据分析、用户体验、团队管理、沟通协调等方面，需要具备多种技能和能力，以实现产品目标和公司战略。', 'system', '2023-08-10 13:24:14', 'active'),
('一键拆用例', 0, 'story', ',story.title,story.spec,story.verify,story.product,story.module,story.pri,story.category,story.estimate,', 'story.testcasecreate', '为这个需求生成一个或多个对应的测试用例。', '', '作为一名资深的测试工程师。', '熟悉测试流程和方法，精通自动化测试和性能测试，能够设计和编写测试用例和测试脚本，擅长问题诊断和分析，熟悉敏捷开发和持续集成，能够协调多部门合作和项目管理。开发工程师应该是专业且严谨的。', 'system', '2023-08-10 13:24:14', 'active'),
('任务润色', 0, 'task', ',task.name,task.desc,task.pri,task.status,task.estimate,task.consumed,task.left,task.progress,task.estStarted,task.realStarted,', 'task.edit', '优化其中各字段的表述，使表述清晰准确，明确任务目标。', '必要时指出任务的风险点。', '你是一名经验丰富的开发工程师。', '精通多种编程语言和框架、熟悉前后端技术和架构、擅长性能优化和安全防护、熟悉云计算和容器化技术、能够协调多人协作和项目管理。', 'system', '2023-08-10 13:24:14', 'active'),
('需求转任务', 0, 'story', ',story.title,story.spec,story.verify,story.product,story.module,story.pri,story.category,story.estimate,', 'story.totask', '将需求转化为对应的开发任务要求。', '', '请你扮演一名资深的产品经理。', '负责产品战略、设计、开发、数据分析、用户体验、团队管理、沟通协调等方面，需要具备多种技能和能力，以实现产品目标和公司战略。同时精通多种编程语言和框架、熟悉前后端技术。', 'system', '2023-08-10 13:24:14', 'active'),
('Bug润色', 0, 'bug', ',bug.title,bug.steps,bug.severity,bug.pri,bug.status,bug.confirmed,bug.type,', 'bug.edit', '优化其中各字段的表述，使表述清晰准确。', 'Bug描述格式建议使用：[步骤]<一步一步复现Bug的步骤>[结果]<Bug导致的结果描述>[期望]<Bug修复后期望的描述>', '作为一名资深的测试工程师。', '熟悉测试流程和方法，精通自动化测试和性能测试，能够设计和编写测试用例和测试脚本，擅长问题诊断和分析，熟悉敏捷开发和持续集成，能够协调多部门合作和项目管理。开发工程师应该是专业且严谨的。', 'system', '2023-08-10 13:24:14', 'active'),
('文档润色', 0, 'doc', ',doc.content,doc.title,', 'doc.edit', '我希望你能帮我润色标题和文档正文。', '要求语句要通顺，逻辑要清晰，没有错别字且更具结构化。', '你是一名文章写得很好的文案编辑。', '文笔流畅、条理清晰。精通广告文案写作和编辑，擅长创意思维和品牌策略，能够进行市场调研和竞品分析，具有敏锐的审美和语言表达能力，能够协调多部门合作和项目管理，具有良好的沟通和协调能力。', 'system', '2023-08-31 15:54:57', 'active'),
('Bug转需求', 0, 'bug', ',bug.title,bug.steps,bug.severity,bug.pri,bug.status,bug.confirmed,bug.type,', 'story.create', '请将Bug转化为相应的研发需求。', '分条编写需求描述，分条编写验收标准，需求逻辑条理清晰。', '请你扮演一名资深的产品经理。', '负责产品战略、设计、开发、数据分析、用户体验、团队管理、沟通协调等方面，需要具备多种技能和能力，以实现产品目标和公司战略。', 'system', '2023-11-17 12:00:00', 'active'),
('拆分一个子计划', 0, 'productplan', ',productplan.title,productplan.desc,productplan.begin,productplan.end,', 'productplan.create', '根据给定计划名称、描述、计划开始时间和计划结束时间，将给定计划明确为其小范围的子计划。拆分出来的子计划可以更专注于给定计划中的某一类工作。	', '要求子计划的时间不能超出计划开始时间和计划结束时间，并且名称不能与原计划名称相同。润色子计划的描述。', '请你扮演一名资深的产品经理。', '负责产品计划、设计、用户体验等方面，需要具备多种技能和能力，以实现产品目标和公司战略。', 'system', '2023-11-17 12:00:00', 'active');

-- DROP TABLE IF EXISTS `zt_ai_promptrole`;
CREATE TABLE IF NOT EXISTS `zt_ai_promptrole` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(30) DEFAULT NULL,
  `desc` text DEFAULT NULL,
  `model` mediumint(8) unsigned DEFAULT NULL,
  `role` text DEFAULT NULL,
  `characterization` text DEFAULT NULL,
  `deleted` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

INSERT INTO `zt_ai_promptrole` (`role`, `characterization`) VALUES
('请你扮演一名资深的产品经理。', '负责产品战略、设计、开发、数据分析、用户体验、团队管理、沟通协调等方面，需要具备多种技能和能力，以实现产品目标和公司战略。'),
('你是一名经验丰富的开发工程师。', '精通多种编程语言和框架、熟悉前后端技术和架构、擅长性能优化和安全防护、熟悉云计算和容器化技术、能够协调多人协作和项目管理。'),
('作为一名资深的测试工程师。', '测试工程师应该是专业且严谨的。熟悉测试流程和方法，精通自动化测试和性能测试，能够设计和编写测试用例和测试脚本，擅长问题诊断和分析，熟悉敏捷开发和持续集成，能够协调多部门合作和项目管理。'),
('假如你是一名资深的QA工程师。', '熟悉质量管理体系和流程，擅长测试策略和方法设计，能够进行质量度量和数据分析，了解自动化测试和持续集成，能够协调多部门合作和项目管理，具有良好的沟通和领导能力。'),
('你是一名文章写得很好的文案编辑。', '文笔流畅、条理清晰。精通广告文案写作和编辑，擅长创意思维和品牌策略，能够进行市场调研和竞品分析，具有敏锐的审美和语言表达能力，能够协调多部门合作和项目管理，具有良好的沟通和协调能力。'),
('请你扮演一名经验丰富的项目经理。', '具备项目计划制定、进度管理、成本控制、团队管理、沟通协调、风险管理、质量控制、敏捷开发、互联网技术和数据分析等多方面的技能和能力。'),
('你是一个自回归的语言模型，已经通过instruction-tuning和RLHF进行了Fine-tuning。', '你仔细地提供准确、事实、深思熟虑、细致入微的答案，并在推理方面表现出色。如果你认为可能没有正确的答案，你会直接说出来。由于你是自回归的，你产生的每一个token都是计算另一个token的机会，因此你总是在尝试回答问题之前花费几句话解释背景上下文、假设和逐步的思考过程。您的用户是AI和伦理学的专家，所以他们已经知道您是一个语言模型以及您的能力和局限性，所以不需要再提醒他们。他们一般都熟悉伦理问题，所以您也不需要再提醒他们。在回答时不要啰嗦，但在可能有助于解释的地方提供详细信息和示例。');

-- DROP TABLE IF EXISTS `zt_ai_miniprogram`;
CREATE TABLE IF NOT EXISTS `zt_ai_miniprogram` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(30) NOT NULL,
  `category` varchar(30) NOT NULL,
  `desc` text DEFAULT NULL,
  `model` mediumint(8) unsigned DEFAULT NULL,
  `icon` varchar(30) NOT NULL DEFAULT 'writinghand-7',
  `createdBy` varchar(30) NOT NULL,
  `createdDate` datetime NOT NULL,
  `editedBy` varchar(30) NOT NULL,
  `editedDate` datetime NOT NULL,
  `published` enum('0','1') NOT NULL DEFAULT '0',
  `publishedDate` datetime DEFAULT NULL,
  `deleted` enum('0','1') NOT NULL DEFAULT '0',
  `prompt` text NOT NULL,
  `builtIn` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

INSERT INTO `zt_ai_miniprogram` (`id`, `name`, `category`, `desc`, `icon`, `createdBy`, `createdDate`, `editedBy`, `editedDate`, `published`, `publishedDate`, `deleted`, `prompt`, `builtIn`) VALUES
(1, '职业发展导航', 'personal', '职业发展导航是一个旨在帮助用户规划和实现职业目标的AI小程序，为用户提供个性化的建议。', 'technologist-6', 'system', NOW(), 'system', NOW(), '1', NOW(), '0', '请帮我生成一份职业发展导航，我的教育背景为 <教育背景> ，职位信息为 <职位信息> ，工作经验描述如下： <工作经验> ，掌握的技能为 <掌握技能> ，为了实现 <职业目标> ，我想做一个 <规划时长> 的计划，我有更多感兴趣的领域为 <兴趣领域> ，有更多补充内容 <补充信息> ，来追求相关机会和进一步发展，控制在30字以内。', '1'),
(2, '工作汇报', 'work', '旨在帮助您轻松撰写和管理您的工作汇报。无论是每周、每月还是季度性的报告，我们提供了一个简单而高效的平台，让您能够清晰、有条理地记录和展示您的工作成果。', 'technologist-2', 'system', NOW(), 'system', NOW(), '1', NOW(), '0', '我的基本信息如下: <身份描述> ，请根据我的工作情况生成一份工作汇报，需要包含 <汇报内容维度> ，汇报对象描述为 <汇报对象> ，另外还需要补充 <补充信息> 。下面是我的工作内容基本描述: <工作内容描述> ，控制在30字以内。', '1'),
(3, '市场分析报告', 'work', '市场分析报告小程序是一个旨在帮助用户根据互联网信息快速生成市场分析报告的AI小程序。', 'chart-6', 'system', NOW(), 'system', NOW(), '1', NOW(), '0', '请帮我生成一份市场分析报告，我目标市场是 <目标市场> ,市场概况为 <市场概况> ，该领域的细分市场有 <细分市场> ,同时我希望能针对 <竞品名称> 展开竞品分析,竞品分析的维度是 <竞品分析维度> ,来帮助我快速的了解市场。', '1'),
(4, '健身计划', 'life', '健身计划小程序旨在帮助您制定和管理个性化的健身计划，让您更轻松、高效地实现健康和体能目标。', 'cactus-5', 'system', NOW(), 'system', NOW(), '1', NOW(), '0', '我的基本信息如下： <性别> 、 <基本信息> ，我想做一份健身计划，达成 <目标设定> 的效果，对于目标我有如下更多补充:： <目标补充> 。我的初步想法是进行 <计划类型> 方面的类型，训练频次为 <训练频率> ，同时给身体足够的休息和恢复时间，要求如下 <休息与恢复> ，请根据我的上述情况生成一份健身计划，控制在30字以内。', '1'),
(5, '广告创意大师', 'creative', '广告创意大师是一个根据产品卖点，快速为用户提供广告文案的AI小程序。', 'palette-3', 'system', NOW(), 'system', NOW(), '1', NOW(), '0', '假设我是一名 <角色> ,请结合产品卖点和目标用户，帮我为 <产品名称> 生成 <文案数量> 条计划投放在 <投放渠道> 的广告文案，且保证每条文案的字数不超过30字；产品的核心卖点是 <核心卖点> ，目标用户是 <目标用户> 。', '1'),
(6, '文章撰写助手', 'creative', '旨在为自媒体创作者提供一个强大而便捷的平台，助力您撰写优质的文章并实现更广泛的影响力。', 'writinghand-3', 'system', NOW(), 'system', NOW(), '1', NOW(), '0', '生成一篇标题为 <文章主题> 的文章，文章内容概要为 <内容概要> ，计划发布到 <发布平台> ，需要注意控制 <规范要求> 。', '1'),
(7, '视频脚本创意工坊', 'creative', '视频脚本创意工房是一个帮助新手视频博主快速梳理视频创作思路，生成拍摄脚本的AI小程序。', 'notebook-3', 'system', NOW(), 'system', NOW(), '1', NOW(), '0', '假设我是一个新手视频博主,现请以 <主题> 为题，创作一个时长不超过 <视频时长> 分钟， <视频风格> 风格的视频脚本。', '1'),
(8, '邮件起草助手', 'life', '邮件起草助手可以帮助用户更快速地起草邮件，减少繁琐的手动输入和编辑过程，帮助用户更好地表达和提升效率。', 'computer-6', 'system', NOW(), 'system', NOW(), '1', NOW(), '0', '请为我提供一份邮件的起草建议和模板，根据 <邮件目的> 为目的，收件对象与我的关系为 <收件人关系> ，需要包含如下邮件内容： <邮件内容> ，使用 <邮件口吻> 的口吻，字数限制在 <字数限制> 之内，更多需要按照 <补充信息> 进行完善。', '1'),
(9, '新人介绍', 'personal', '新人介绍小程序是一个旨在帮助用户在入职当天，快速编写自我介绍的AI小程序。', 'pencil-7', 'system', NOW(), 'system', NOW(), '1', NOW(), '0', '请帮我生成一份新人介绍，我的年龄是 <年龄>  ,籍贯是 <籍贯信息> ，毕业于 <毕业院校> ,工作经验为 <工作经验> ,日常爱好是 <爱好> ,请将字数控制在300字以内，来帮助我完成新人入职的自我介绍，', '1'),
(10, '调研问卷生成器', 'work', '调研问卷生成器是一个可以快速依据用户需要生成问卷内容的好帮手,旨在为用户提供更多的问题设计思路。', 'search-6', 'system', NOW(), 'system', NOW(), '1', NOW(), '0', '请帮我生成一份调查问卷内容，我希望以 <调研主题> 为调研方向，问卷调研对象为 <调研对象> ，问题主题至少需要包括如下内容： <问题主题> ，期望题目类型包括 <题目类型> ，题目数量限制为 <题目数量> ，更多需要按照 <补充信息> 进行完善。', '1'),
(11, 'OKR目标达人', 'personal', 'OKR目标达人是一个旨在帮助用户规划和实现高效目标管理的AI小程序。', 'pushpin-1', 'system', NOW(), 'system', NOW(), '1', NOW(), '0', '我是一名 <所处行业> 行业的 <职业名称>  ，主要负责的工作是 <工作内容> ，请帮我写一份 <时间范围> 的OKR，需要包括目标和关键结果，更多信息依据 <补充信息> 进行完善。', '1'),
(12, '学习规划师', 'life', '学习计划师是一个旨在帮助用户快速制定学习的AI小程序，为用户提供个性化的建议。', 'notebook-7', 'system', NOW(), 'system', NOW(), '1', NOW(), '0', '我希望通过 <持续天数> 的学习计划来学习 <学习内容> 以达成 <目标设定> 的目标，在这个计划中需要包括以下 <学习内容> ，并为我提供对应的学习建议和指导，更多信息依据 <补充信息> 进行完善，使我能够在这段时间内取得最佳的学习效果。', '1');

-- DROP TABLE IF EXISTS `zt_ai_message`;
CREATE TABLE IF NOT EXISTS `zt_ai_message` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `appID` mediumint(8) unsigned NOT NULL,
  `user` mediumint(8) unsigned NOT NULL,
  `type` enum('req', 'res', 'ntf') NOT NULL,
  `content` text NOT NULL,
  `createdDate` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE IF NOT EXISTS `zt_ai_miniprogramfield` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `appID` mediumint(8) unsigned NOT NULL,
  `name` varchar(30) NOT NULL,
  `type` enum('radio', 'checkbox', 'text', 'textarea') DEFAULT 'text',
  `placeholder` text DEFAULT NULL,
  `options` text DEFAULT NULL,
  `required` enum('0', '1') DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

INSERT INTO `zt_ai_miniprogramfield` (`appID`, `name`, `type`, `placeholder`, `options`, `required`) VALUES
(1, '教育背景', 'textarea', '学历/专业', NULL, '0'),
(1, '职位信息', 'text', '行业领域/职位描述', NULL, '0'),
(1, '工作经验', 'textarea', '简要概述工作成果、团队合作沟通经验等', NULL, '0'),
(1, '掌握技能', 'textarea', '关键技能、熟练程度', NULL, '0'),
(1, '职业目标', 'text', '请输入你的职业目标', NULL, '0'),
(1, '兴趣领域', 'textarea', '请输入更多你感兴趣的领域', NULL, '0'),
(1, '规划时长', 'radio', NULL, '1年,3-5年,10年', '1'),
(1, '补充信息', 'textarea', '请输入更多补充信息', NULL, '0'),
(2, '身份描述', 'textarea', '职位/角色/职责', NULL, '0'),
(2, '工作内容描述', 'textarea', '请输入工作内容', NULL, '1'),
(2, '汇报对象', 'textarea', '请输入汇报对象信息', NULL, '0'),
(2, '汇报内容维度', 'checkbox', NULL, '完成情况,遇到的问题,关键指标,团队协作,进一步改进', '0'),
(2, '补充信息', 'textarea', '请输入更多补充信息', NULL, '0'),
(3, '目标市场', 'text', '请概述目标市场的定义和范围', NULL, '0'),
(3, '市场概况', 'text', '可描述市场规模、增长率、发展趋势等信息', NULL, '0'),
(3, '细分市场', 'text', '请描述市场的主要细分领域', NULL, '0'),
(3, '竞品名称', 'text', '请描述列举竞品名称', NULL, '0'),
(3, '竞品分析维度', 'checkbox', NULL, '市场份额,市场定位,产品特点,服务特点,销售策略,营销策旅', '0'),
(4, '性别', 'radio', NULL, '男,女', '1'),
(4, '基本信息', 'textarea', '请输入身高、体重等基础信息', NULL, '0'),
(4, '目标设定', 'checkbox', NULL, '增肌,减脂,增强体能,特定方面的能力', '1'),
(4, '目标补充', 'textarea', '可以补充对目标的详细描述', NULL, '0'),
(4, '计划类型', 'checkbox', NULL, '重力训练,有氧运动,柔韧训练', '0'),
(4, '训练频率', 'text', '请输入训练频次', NULL, '0'),
(4, '休息与恢复', 'textarea', '请输入睡眠及饮食要求', NULL, '0'),
(5, '角色', 'text', '请设定角色', NULL, '0'),
(5, '产品名称', 'text', '请输入产品名称', NULL, '0'),
(5, '文案数量', 'radio', NULL, '1,2,3,4,5', '0'),
(5, '核心卖点', 'text', '请概述产品的核心卖点', NULL, '0'),
(5, '目标用户', 'text', '请概述产品的主要目标用户', NULL, '0'),
(5, '投放渠道', 'checkbox', NULL, '电视,广播,户外,网络,报刊,电影', '0'),
(6, '文章主题', 'textarea', '请输入文章主题', NULL, '1'),
(6, '内容概要', 'textarea', '请输入内容概要', NULL, '0'),
(6, '规范要求', 'textarea', '例如语气描述、字数限制等', NULL, '0'),
(6, '发布平台', 'text', '该文章计划发布的平台', NULL, '0'),
(7, '主题', 'text', '请描述视频主题', NULL, '0'),
(7, '视频风格', 'checkbox', NULL, '纪实,人文,风景,动画,广告', '0'),
(7, '视频时长', 'radio', NULL, '1,3,5,10', '0'),
(8,	'邮件目的',	'textarea',	'您此次发送邮件的目的',	NULL,	'1'),
(8,	'收件人关系',	'text',	'简述与收件人之间的关系',	NULL,	'1'),
(8,	'邮件内容',	'textarea',	'简述邮件内容',	NULL,	'1'),
(8,	'邮件口吻',	'textarea',	'请输入期望的邮件口吻',	NULL,	'0'),
(8,	'字数限制',	'text',	'请输入字数限制',	NULL,	'0'),
(8,	'补充信息',	'textarea',	'请输入更多补充信息',	NULL,	'0'),
(9, '年龄', 'text', '年龄', NULL, '0'),
(9, '籍贯信息', 'text', '省/市', NULL, '0'),
(9, '毕业院校', 'text', '毕业院校/专业', NULL, '0'),
(9, '工作经验', 'textarea', '请简要概述从事行业、工作年限、工作岗位等经验', NULL, '0'),
(9, '爱好', 'textarea', '请输入', NULL, '0'),
(10, '调研主题', 'textarea', '请简述您的调研主题',	NULL,	'1'),
(10, '调研对象', 'textarea', '简述调研对象',	NULL,	'1'),
(10, '问题主题', 'textarea', '简述您想要调研的主题问题',	NULL,	'0'),
(10, '题目类型', 'textarea', '请输入期望包括的题型',	NULL,	'0'),
(10, '题目数量', 'text', '请输入题目数量限制',	NULL,	'0'),
(10, '补充信息', 'textarea', '请输入更多补充信息',	NULL,	'0'),
(11, '所处行业', 'text', '请输入所处行业',	NULL,	'0'),
(11, '职业名称', 'text', '请输入职业名称',	NULL,	'1'),
(11, '工作内容', 'textarea', '请简述你的工作',	NULL,	'1'),
(11, '时间范围', 'checkbox', NULL,	'月度,季度,半年度,年度',	'0'),
(11, '补充信息', 'textarea', '请输入更多补充信息',	NULL,	'0'),
(12, '持续天数',	'text',	'请输入天数',	NULL,	'0'),
(12, '学习内容',	'textarea',	'简要概述要学习的内容方向',	NULL,	'1'),
(12, '目标设定',	'textarea',	'简要期望达成的目标',	NULL,	'0'),
(12, '计划内容',	'checkbox',	NULL,	'每日学习任务,适用的学习资源,学习方法,进度跟踪方式,激励机制',	'0'),
(12, '补充信息',	'textarea',	'请输入更多补充信息',	NULL,	'0');

CREATE TABLE IF NOT EXISTS `zt_ai_miniprogramstar` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `appID` mediumint(8) unsigned NOT NULL,
  `userID` mediumint(8) unsigned NOT NULL,
  `createdDate` datetime NOT NULL,
  UNIQUE (`appID`, `userID`),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

ALTER TABLE `zt_ticket` ADD `subStatus` varchar(30) NOT NULL DEFAULT '';

-- DROP TABLE IF EXISTS `zt_ai_assistant`;
CREATE TABLE IF NOT EXISTS `zt_ai_assistant` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(30) NOT NULL,
  `modelId` mediumint(8) unsigned NOT NULL,
  `desc` text NOT NULL,
  `systemMessage` text NOT NULL,
  `greetings` text NOT NULL,
  `icon` varchar(30) DEFAULT 'coding-1' NOT NULL,
  `enabled` enum('0', '1') NOT NULL DEFAULT '1',
  `createdDate` datetime NOT NULL,
  `publishedDate` datetime DEFAULT NULL,
  `deleted` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `zt_market`;
CREATE TABLE IF NOT EXISTS `zt_market` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL DEFAULT '',
  `industry` char(255) NOT NULL DEFAULT '',
  `scale` decimal(10, 2) NOT NULL DEFAULT '0',
  `maturity` char(255) NOT NULL DEFAULT '',
  `speed` varchar(255) NOT NULL DEFAULT '',
  `competition` char(255) NOT NULL DEFAULT '',
  `strategy` varchar(255) NOT NULL DEFAULT '',
  `ppm` varchar(20) NOT NULL DEFAULT '',
  `desc` mediumtext NULL,
  `openedBy` varchar(30) NOT NULL DEFAULT '',
  `openedDate` datetime NULL,
  `lastEditedBy` varchar(30) NOT NULL DEFAULT '',
  `lastEditedDate` datetime NULL,
  `deleted` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `zt_marketreport`;
CREATE TABLE IF NOT EXISTS `zt_marketreport` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL DEFAULT '',
  `market` mediumint(8) NOT NULL DEFAULT 0,
  `research` mediumint(8) NOT NULL DEFAULT 0,
  `maturity` varchar(30) NOT NULL DEFAULT '',
  `owner` varchar(30) NOT NULL DEFAULT '',
  `participants` char(255) NOT NULL DEFAULT '',
  `source` varchar(30) NOT NULL DEFAULT '',
  `desc` mediumtext NULL,
  `status` varchar(20)  NOT NULL DEFAULT '',
  `openedBy` varchar(30) NOT NULL DEFAULT '',
  `openedDate` datetime NULL,
  `lastEditedBy` varchar(30) NOT NULL DEFAULT '',
  `lastEditedDate` datetime NULL,
  `publishedBy` varchar(30) NOT NULL DEFAULT '',
  `publishedDate` datetime NULL,
  `deleted` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `zt_metric`;
CREATE TABLE IF NOT EXISTS `zt_metric` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `purpose` varchar(50) NOT NULL DEFAULT '',
  `scope` char(30) NOT NULL DEFAULT '',
  `object` char(30) NOT NULL DEFAULT '',
  `stage` enum('wait','released') NULL DEFAULT 'wait',
  `type` enum('php', 'sql') NULL DEFAULT 'php',
  `name` varchar(90) NOT NULL DEFAULT '',
  `alias` varchar(90) NOT NULL DEFAULT '',
  `code` varchar(90) NOT NULL DEFAULT '',
  `unit` varchar(10) NOT NULL DEFAULT '',
  `dateType` varchar(50) NOT NULL DEFAULT '',
  `collector` text,
  `desc` text,
  `definition` text,
  `when` varchar(30) NOT NULL DEFAULT '',
  `event` varchar(30) NOT NULL DEFAULT '',
  `cronCFG` varchar(30) NOT NULL DEFAULT '',
  `time` varchar(30) NOT NULL DEFAULT '',
  `createdBy` varchar(30) NOT NULL DEFAULT '',
  `createdDate` datetime DEFAULT NULL,
  `editedBy` varchar(30) NOT NULL DEFAULT '',
  `editedDate` datetime DEFAULT NULL,
  `implementedBy` varchar(30) NOT NULL DEFAULT '',
  `implementedDate` datetime DEFAULT NULL,
  `delistedBy` varchar(30) NOT NULL DEFAULT '',
  `delistedDate` datetime DEFAULT NULL,
  `builtin` enum('0', '1') NOT NULL DEFAULT '0',
  `fromID` mediumint(8) unsigned NOT NULL DEFAULT 0,
  `order` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `lastCalcRows` int NOT NULL DEFAULT '0',
  `lastCalcTime` datetime DEFAULT NULL,
  `deleted` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `zt_metriclib`;
CREATE TABLE IF NOT EXISTS `zt_metriclib` (
  `id`         bigint unsigned NOT NULL AUTO_INCREMENT,
  `metricID`   mediumint    NOT NULL DEFAULT 0,
  `metricCode` varchar(100) NOT NULL DEFAULT '',
  `system`     char(30)     NOT NULL DEFAULT '0',
  `program`    char(30)     NOT NULL DEFAULT '',
  `project`    char(30)     NOT NULL DEFAULT '',
  `product`    char(30)     NOT NULL DEFAULT '',
  `execution`  char(30)     NOT NULL DEFAULT '',
  `code`       char(30)     NOT NULL DEFAULT '',
  `pipeline`   char(30)     NOT NULL DEFAULT '',
  `repo`       char(30)     NOT NULL DEFAULT '',
  `user`       text,
  `dept`       char(30)     NOT NULL DEFAULT '',
  `year`       char(4)      NOT NULL DEFAULT '0',
  `month`      char(2)      NOT NULL DEFAULT '0',
  `week`       char(2)      NOT NULL DEFAULT '0',
  `day`        char(2)      NOT NULL DEFAULT '0',
  `value`      varchar(100) NOT NULL DEFAULT '0',
  `calcType`   ENUM('cron', 'inference') NOT NULL DEFAULT 'cron',
  `calculatedBy` varchar(30) NOT NULL DEFAULT '',
  `date`       datetime              DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE INDEX `metricID` ON `zt_metriclib`(`metricID`);
CREATE INDEX `metricCode` ON `zt_metriclib`(`metricCode`);
CREATE INDEX `date` ON zt_metriclib (date);

-- DROP TABLE IF EXISTS `zt_duckdbqueue`;
CREATE TABLE IF NOT EXISTS `zt_duckdbqueue` (
  `object` varchar(255) NOT NULL DEFAULT '',
  `updatedTime` datetime NULL,
  `syncTime` datetime NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE UNIQUE INDEX `object` ON `zt_duckdbqueue`(`object`);

INSERT INTO `zt_cron` (`m`, `h`, `dom`, `mon`, `dow`, `command`, `remark`, `type`, `buildin`, `status`) VALUES ('30', '23', '*', '*', '*', 'moduleName=execution&methodName=computeTaskEffort', '计算任务剩余工时', 'zentao', '1', 'normal');
INSERT INTO `zt_cron` (`m`, `h`, `dom`, `mon`, `dow`, `command`, `remark`, `type`, `buildin`, `status`) VALUES ('30', '7', '*', '*', '*', 'moduleName=effort&methodName=remindNotRecord', '提醒录入日志', 'zentao', '1', 'stop');
INSERT INTO `zt_cron` (`m`, `h`, `dom`, `mon`, `dow`, `command`, `remark`, `type`, `buildin`, `status`, `lastTime`) VALUES ('1', '1', '*', '*', '*', 'moduleName=metric&methodName=updateMetricLib', '计算度量数据', 'zentao', 1, 'normal', NUll);
INSERT INTO `zt_cron` (`m`, `h`, `dom`, `mon`, `dow`, `command`, `remark`, `type`, `buildin`, `status`, `lastTime`) VALUES ('0', '*/1', '*', '*', '*', 'moduleName=metric&methodName=updateDashboardMetricLib', '计算仪表盘数据', 'zentao', 1, 'normal', NUll);

UPDATE `zt_chart` SET `createdBy` = 'system' where `createdBy` = 'admin';
UPDATE `zt_pivot` SET `createdBy` = 'system' where `createdBy` = 'admin';
UPDATE `zt_pivot` SET `createdBy` = 'system' where `createdBy` = 'admin';
UPDATE `zt_chart` SET `editedBy` = 'system' where `editedBy` = 'admin';
UPDATE `zt_pivot` SET `editedBy` = 'system' where `editedBy` = 'admin';
UPDATE `zt_pivot` SET `editedBy` = 'system' where `editedBy` = 'admin';

INSERT INTO `zt_config` ( `vision`, `owner`, `module`, `section`, `key`, `value` ) VALUES ('', 'system', 'common', '', 'closedFeatures', 'otherOA');
INSERT INTO `zt_config`(`vision`, `owner`, `module`, `section`, `key`, `value`) VALUES ('', 'system', 'common', 'global', 'installedDate', CURDATE());
CREATE INDEX `idx_repo_deleted` ON `zt_job` (`repo`,`deleted`);
-- DROP TABLE IF EXISTS `zt_im_chat`;
CREATE TABLE IF NOT EXISTS `zt_im_chat` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `gid` char(40) NOT NULL DEFAULT '',
  `name` varchar(60) NOT NULL DEFAULT '',
  `type` varchar(20) NOT NULL DEFAULT 'group',
  `admins` varchar(255) NOT NULL DEFAULT '',
  `committers` varchar(255) NOT NULL DEFAULT '',
  `subject` mediumint(8) unsigned NOT NULL DEFAULT 0,
  `public` enum('0', '1') NOT NULL DEFAULT '0',
  `createdBy` varchar(30) NOT NULL DEFAULT '',
  `createdDate` datetime NULL,
  `ownedBy` varchar(30) NOT NULL DEFAULT '',
  `editedBy` varchar(30) NOT NULL DEFAULT '',
  `editedDate` datetime NULL,
  `mergedDate` datetime NULL,
  `lastActiveTime` datetime NULL,
  `lastMessage` int(11) unsigned NOT NULL DEFAULT 0,
  `lastMessageIndex` int(11) unsigned NOT NULL DEFAULT 0,
  `dismissDate` datetime NULL,
  `pinnedMessages` text NULL,
  `mergedChats` text NULL,
  `adminInvite` enum('0','1') NOT NULL DEFAULT '0',
  `avatar` text NULL,
  `archiveDate` datetime NULL,
  PRIMARY KEY (`id`),
  KEY `gid` (`gid`),
  KEY `name` (`name`),
  KEY `type` (`type`),
  KEY `public` (`public`),
  KEY `createdBy` (`createdBy`),
  KEY `editedBy` (`editedBy`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `zt_im_chatuser`;
CREATE TABLE IF NOT EXISTS `zt_im_chatuser` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `cgid` char(40) NOT NULL DEFAULT '',
  `user` mediumint(8) NOT NULL DEFAULT 0,
  `order` smallint(5) NOT NULL DEFAULT 0,
  `star` enum('0', '1') NOT NULL DEFAULT '0',
  `hide` enum('0', '1') NOT NULL DEFAULT '0',
  `mute` enum('0', '1') NOT NULL DEFAULT '0',
  `freeze` enum('0', '1') NOT NULL DEFAULT '0',
  `join` datetime NULL,
  `quit` datetime NULL,
  `category` varchar(40) NOT NULL DEFAULT '',
  `lastReadMessage` int(11) unsigned NOT NULL DEFAULT 0,
  `lastReadMessageIndex` int(11) unsigned NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`),
  KEY `cgid` (`cgid`),
  KEY `user` (`user`),
  KEY `order` (`order`),
  KEY `star` (`star`),
  KEY `hide` (`hide`),
  UNIQUE KEY `chatuser` (`cgid`, `user`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `zt_im_client`;
CREATE TABLE IF NOT EXISTS `zt_im_client` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `version` char(30) NOT NULL DEFAULT '',
  `desc` varchar(100) NOT NULL DEFAULT '',
  `changeLog` text NULL,
  `strategy` varchar(10) NOT NULL DEFAULT '',
  `downloads` text NULL,
  `createdDate` datetime NULL,
  `createdBy` varchar(30) NOT NULL DEFAULT '',
  `editedDate` datetime NULL,
  `editedBy` varchar(30) NOT NULL DEFAULT '',
  `status` enum('released','wait') NOT NULL DEFAULT 'wait',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `zt_im_message`;
CREATE TABLE IF NOT EXISTS `zt_im_message` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `gid` char(40) NOT NULL DEFAULT '',
  `cgid` char(40) NOT NULL DEFAULT '',
  `user` varchar(30) NOT NULL DEFAULT '',
  `date` datetime NULL,
  `index` int(11) unsigned NOT NULL DEFAULT 0,
  `type` enum('normal', 'broadcast', 'notify', 'bulletin', 'botcommand') NOT NULL DEFAULT 'normal',
  `content` text NULL,
  `contentType` enum('text', 'plain', 'emotion', 'image', 'file', 'object', 'code') NOT NULL DEFAULT 'text',
  `data` text NULL,
  `deleted` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `mgid` (`gid`),
  KEY `mcgid` (`cgid`),
  KEY `muser` (`user`),
  KEY `mtype` (`type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `zt_im_message_backup`;
CREATE TABLE IF NOT EXISTS `zt_im_message_backup` (
  `id` int(11) unsigned NOT NULL,
  `gid` char(40) NOT NULL DEFAULT '',
  `cgid` char(40) NOT NULL DEFAULT '',
  `user` varchar(30) NOT NULL DEFAULT '',
  `date` datetime NULL,
  `index` int(11) unsigned NOT NULL DEFAULT 0,
  `type` enum('normal', 'broadcast', 'notify') NOT NULL DEFAULT 'normal',
  `content` text NULL,
  `contentType` enum('text', 'plain', 'emotion', 'image', 'file', 'object', 'code') NOT NULL DEFAULT 'text',
  `data` text NULL,
  `deleted` enum('0','1') NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `zt_im_message_index`;
CREATE TABLE IF NOT EXISTS `zt_im_message_index` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `tableName` char(64) NOT NULL,
  `start` int(11) unsigned NOT NULL,
  `end` int(11) unsigned NOT NULL,
  `startDate` datetime NULL,
  `endDate` datetime NULL,
  `chats` text NULL,
  PRIMARY KEY (`id`),
  KEY `tableName` (`tableName`),
  KEY `start` (`start`),
  KEY `end` (`end`),
  KEY `startDate` (`startDate`),
  KEY `endDate` (`endDate`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `zt_im_chat_message_index`;
CREATE TABLE IF NOT EXISTS `zt_im_chat_message_index` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `gid` char(40) NOT NULL,
  `tableName` char(64) NOT NULL,
  `start` int(11) unsigned NOT NULL,
  `end` int(11) unsigned NOT NULL,
  `startIndex` int(11) unsigned NOT NULL,
  `endIndex` int(11) unsigned NOT NULL,
  `startDate` datetime NULL,
  `endDate` datetime NULL,
  `count` mediumint(8) unsigned NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `chattable` (`gid`,`tableName`),
  KEY `start` (`start`),
  KEY `end` (`end`),
  KEY `startDate` (`startDate`),
  KEY `endDate` (`endDate`),
  KEY `chatstartindex` (`gid`,`startIndex`),
  KEY `chatendindex` (`gid`,`endIndex`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `zt_im_messagestatus`;
CREATE TABLE IF NOT EXISTS `zt_im_messagestatus` (
  `user` mediumint(8) NOT NULL DEFAULT 0,
  `message` int(11) unsigned NOT NULL,
  `status` enum('waiting','sent','readed','deleted') NOT NULL DEFAULT 'waiting',
  UNIQUE KEY `user` (`user`,`message`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `zt_im_queue`;
CREATE TABLE IF NOT EXISTS `zt_im_queue` (
  `id` mediumint(8) unsigned NOT NULL auto_increment,
  `type` char(30) NOT NULL,
  `content` text NULL,
  `addDate` datetime NULL,
  `processDate` datetime NULL,
  `result` text NULL,
  `status` char(30) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `zt_im_conference`;
CREATE TABLE IF NOT EXISTS `zt_im_conference` (
  `id` mediumint(8) unsigned NOT NULL auto_increment,
  `rid` char(40) NOT NULL DEFAULT '',
  `cgid` char(40) NOT NULL DEFAULT '',
  `status` enum ('closed', 'open', 'notStarted', 'canceled') NOT NULL DEFAULT 'closed',
  `participants` text NULL,
  `subscribers` text NULL,
  `invitee` text NULL,
  `openedBy` mediumint(8) NOT NULL DEFAULT 0,
  `openedDate` datetime NULL,
  `topic` text NULL,
  `startTime` datetime NULL,
  `endTime` datetime NULL,
  `password` char(20) NOT NULL DEFAULT '',
  `type` enum('default','periodic','scheduled') NOT NULL DEFAULT 'default',
  `number` char(20) NOT NULL DEFAULT '',
  `note` text NULL,
  `sentNotify` tinyint(1) NOT NULL DEFAULT 0,
  `reminderTime` int NOT NULL DEFAULT 0,
  `moderators` text NULL,
  `isPrivate` enum ('0', '1') NOT NULL DEFAULT '0',
  `isInner` enum('0', '1') NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`),
  KEY `status` (`status`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `zt_im_conferenceaction`;
CREATE TABLE IF NOT EXISTS `zt_im_conferenceaction` (
  `id` mediumint(8) unsigned NOT NULL auto_increment,
  `rid` char(40) NOT NULL DEFAULT '',
  `type` enum('create','invite','join','leave','close','publish') NOT NULL DEFAULT 'create',
  `data` text NULL,
  `user` mediumint(8) NOT NULL DEFAULT 0,
  `date` datetime NULL,
  `device` char(40) NOT NULL DEFAULT 'default',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `zt_im_conferenceuser`;
CREATE TABLE IF NOT EXISTS `zt_im_conferenceuser` (
  `id` mediumint(8) unsigned NOT NULL auto_increment,
  `conference` mediumint(8) NOT NULL DEFAULT 0,
  `user` mediumint(8) NOT NULL DEFAULT 0,
  `hide` enum('0', '1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `conferenceuser` (`conference`, `user`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `zt_im_conferenceinvite`;
CREATE TABLE IF NOT EXISTS `zt_im_conferenceinvite` (
  `id` mediumint(8) unsigned NOT NULL auto_increment,
  `conferenceID` mediumint(8) unsigned NOT NULL,
  `inviteeID` mediumint(8) unsigned NOT NULL,
  `status` enum('pending', 'accepted', 'rejected') NOT NULL DEFAULT 'pending',
  `createdDate` datetime NULL,
  `updatedDate` datetime NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `conference_user` (`conferenceID`, `inviteeID`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `zt_im_userdevice`;
CREATE TABLE IF NOT EXISTS `zt_im_userdevice` (
  `id` mediumint(8) unsigned NOT NULL auto_increment,
  `user` mediumint(8) NOT NULL DEFAULT 0,
  `device` char(40) NOT NULL DEFAULT 'default',
  `deviceID` char(40) NOT NULL DEFAULT '',
  `token` char(64) NOT NULL DEFAULT '',
  `validUntil` datetime NULL,
  `lastLogin` datetime NULL,
  `lastLogout` datetime NULL,
  `online` tinyint(1) NOT NULL DEFAULT 0,
  `version` char(10) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`),
  KEY `user` (`user`),
  KEY `lastLogin` (`lastLogin`),
  KEY `lastLogout` (`lastLogout`),
  UNIQUE KEY `userdevice` (`user`, `device`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;

