-- DROP TABLE IF EXISTS `ameba_budget`;
CREATE TABLE IF NOT EXISTS `ameba_budget` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `year` char(4) NOT NULL,
  `month` char(2) NOT NULL,
  `week` char(2) NOT NULL,
  `dept` mediumint(8) unsigned NOT NULL,
  `amebaAccount` varchar(30) NOT NULL,
  `tradeDept` mediumint(8) unsigned NOT NULL,
  `line` varchar(60) NOT NULL,
  `product` mediumint(8) unsigned NOT NULL,
  `category` varchar(30) NOT NULL,
  `money` decimal(12,2) NOT NULL,
  `desc` text NOT NULL,
  `createdBy` varchar(30) NOT NULL,
  `createdDate` datetime NOT NULL,
  `editedBy` varchar(30) NOT NULL,
  `editedDate` datetime NOT NULL,
  `sharedDept` mediumint(8) unsigned NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `amebaBudget` (`year`, `month`, `week`, `dept`, `amebaAccount`, `tradeDept`, `line`, `product`, `category`),
  KEY `year` (`year`),
  KEY `dept` (`dept`),
  KEY `category` (`category`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `ameba_category`;
CREATE TABLE IF NOT EXISTS `ameba_category` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `origin` mediumint(8) unsigned NOT NULL,
  `year` char(4) NOT NULL,
  `root` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `parent` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `path` char(255) NOT NULL DEFAULT '',
  `grade` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `order` smallint(5) unsigned NOT NULL DEFAULT '0',
  `type` char(30) NOT NULL DEFAULT 'amebaAccount',
  `amebaAccount` varchar(30) NOT NULL,
  `category` mediumint(8) unsigned NOT NULL,
  `desc` text NOT NULL,
  PRIMARY KEY (`id`),
  KEY `origin` (`origin`),
  KEY `year` (`year`),
  KEY `parent` (`parent`),
  KEY `path` (`path`),
  KEY `grade` (`grade`),
  KEY `order` (`order`),
  KEY `type` (`type`),
  KEY `category` (`category`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `ameba_deal`;
CREATE TABLE IF NOT EXISTS `ameba_deal` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `from` mediumint(8) unsigned NOT NULL,
  `date` date NOT NULL,
  `amebaAccount` varchar(30) NOT NULL,
  `dept` mediumint(8) unsigned NOT NULL,
  `category` mediumint(8) unsigned NOT NULL,
  `product` mediumint(8) unsigned NOT NULL,
  `type` varchar(30) NOT NULL,
  `trade` mediumint(8) unsigned NOT NULL,
  `contract` mediumint(8) unsigned NOT NULL,
  `money` decimal(12,2) NOT NULL,
  `desc` text NOT NULL,
  `status` enum('wait', 'normal') NOT NULL DEFAULT 'wait',
  `createdBy` varchar(30) NOT NULL,
  `createdDate` datetime NOT NULL,
  `editedBy` varchar(30) NOT NULL,
  `editedDate` datetime NOT NULL,
  `confirmedBy` varchar(30) NOT NULL,
  `confirmedDate` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `date` (`date`),
  KEY `amebaAccount` (`amebaAccount`),
  KEY `dept` (`dept`),
  KEY `category` (`category`),
  KEY `type` (`type`),
  KEY `contract` (`contract`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `ameba_fee`;
CREATE TABLE IF NOT EXISTS `ameba_fee` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `month` char(6) NOT NULL,
  `type` varchar(20) NOT NULL,
  `category` varchar(30) NOT NULL,
  `dept` mediumint(8) unsigned NOT NULL,
  `period` varchar(10) NOT NULL DEFAULT 'month',
  `shareType` varchar(30) NOT NULL DEFAULT 'person',
  `money` decimal(12,2) NOT NULL,
  `desc` text NOT NULL,
  `createdBy` varchar(30) NOT NULL,
  `createdDate` datetime NOT NULL,
  `editedBy` varchar(30) NOT NULL,
  `editedDate` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `amebaFee` (`month`, `category`, `dept`),
  KEY `month` (`month`),
  KEY `type` (`type`),
  KEY `category` (`category`),
  KEY `dept` (`dept`),
  KEY `period` (`period`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `ameba_rule`;
CREATE TABLE IF NOT EXISTS `ameba_rule` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `parent` mediumint(8) unsigned NOT NULL,
  `month` char(6) NOT NULL,
  `product` mediumint(8) unsigned NOT NULL,
  `category` mediumint(8) unsigned NOT NULL,
  `from` mediumint(8) unsigned NOT NULL,
  `fromCategory` mediumint(8) unsigned NOT NULL,
  `to` mediumint(8) unsigned NOT NULL,
  `toCategory` mediumint(8) unsigned NOT NULL,
  `rate` decimal(6,2) NOT NULL,
  `desc` text NOT NULL,
  `createdBy` varchar(30) NOT NULL,
  `createdDate` datetime NOT NULL,
  `editedBy` varchar(30) NOT NULL,
  `editedDate` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `amebaRule` (`parent`, `month`, `product`, `category`, `to`),
  KEY `month` (`month`),
  KEY `product` (`product`),
  KEY `category` (`category`),
  KEY `to` (`to`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `ameba_sharefee`;
CREATE TABLE IF NOT EXISTS `ameba_sharefee` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `fee` mediumint(8) unsigned NOT NULL,
  `month` char(6) NOT NULL,
  `dept` mediumint(8) unsigned NOT NULL,
  `rate` decimal(6,2) NOT NULL,
  `desc` text NOT NULL,
  `createdBy` varchar(30) NOT NULL,
  `createdDate` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `feeDept` (`fee`, `dept`),
  KEY `fee` (`fee`),
  KEY `month` (`month`),
  KEY `dept` (`dept`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `ameba_statement`;
CREATE TABLE IF NOT EXISTS `ameba_statement` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `month` char(6) NOT NULL,
  `dept` mediumint(8) unsigned NOT NULL,
  `type` varchar(30) NOT NULL,
  `amebaAccount` varchar(30) NOT NULL,
  `category` varchar(30) NOT NULL,
  `item` varchar(30) NOT NULL,
  `date` date NOT NULL,
  `expect` decimal(12,2) NOT NULL,
  `actual` decimal(12,2) NOT NULL,
  `desc` text NOT NULL,
  `createdBy` varchar(30) NOT NULL,
  `createdDate` datetime NOT NULL,
  `archived` enum('0', '1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `amebaStatement` (`month`, `dept`, `type`, `amebaAccount`, `category`, `date`),
  KEY `month` (`month`),
  KEY `dept` (`dept`),
  KEY `type` (`type`),
  KEY `amebaAccount` (`amebaAccount`),
  KEY `category` (`category`),
  KEY `date` (`date`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `ameba_dept`;
CREATE TABLE IF NOT EXISTS `ameba_dept` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `dept` mediumint(8) unsigned NOT NULL,
  `month` char(6) NOT NULL,
  `name` char(30) NOT NULL,
  `root` mediumint(8) unsigned NOT NULL,
  `parent` mediumint(8) unsigned NOT NULL,
  `path` char(255) NOT NULL,
  `grade` tinyint(3) unsigned NOT NULL,
  `order` smallint(5) unsigned NOT NULL,
  `moderators` varchar(255) NOT NULL,
  `isAmebaDept` enum('0', '1') NOT NULL DEFAULT '0',
  `amebaDept` varchar(10) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `deptMonth` (`dept`, `month`),
  KEY `dept` (`dept`),
  KEY `month` (`month`),
  KEY `parent` (`parent`),
  KEY `path` (`path`),
  KEY `grade` (`grade`),
  KEY `order` (`order`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `ameba_user`;
CREATE TABLE IF NOT EXISTS `ameba_user` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `month` char(6) NOT NULL,
  `parent` varchar(30) NOT NULL,
  `unofficial` enum('0', '1') NOT NULL DEFAULT '0',
  `dept` mediumint(8) unsigned NOT NULL,
  `account` char(30) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`),
  UNIQUE KEY `monthAccount` (`month`, `account`),
  KEY `parent` (`parent`),
  KEY `dept` (`dept`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `ameba_setting`;
CREATE TABLE IF NOT EXISTS `ameba_setting` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `month` char(6) NOT NULL,
  `taxRate` decimal(5, 2) unsigned NOT NULL,
  `shareDepts` varchar(255) NOT NULL,
  `laborCategory` mediumint(8) unsigned NOT NULL,
  `excludeCategories` text NOT NULL,
  `reportType` varchar(20) NOT NULL,
  `reportNum` smallint(5) unsigned NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `month` (`month`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `cash_fund`;
CREATE TABLE IF NOT EXISTS `cash_fund` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `type` varchar(20) NOT NULL DEFAULT 'receivable',
  `origin` varchar(20) NOT NULL,
  `parent` int(11) signed NOT NULL,
  `trader` mediumint(8) unsigned NOT NULL,
  `contract` mediumint(8) unsigned NOT NULL,
  `order` mediumint(8) unsigned NOT NULL,
  `batch` mediumint(8) unsigned NOT NULL,
  `deserved` decimal(15,2) NOT NULL,
  `actual` decimal(15,2) NOT NULL,
  `balance` decimal(15,2) NOT NULL,
  `custom` enum('0', '1') NOT NULL DEFAULT '0',
  `desc` text NOT NULL,
  `createdBy` char(30) NOT NULL,
  `createdDate` datetime NOT NULL,
  `editedBy` char(30) NOT NULL,
  `editedDate` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `type` (`type`),
  KEY `origin` (`origin`),
  KEY `parent` (`parent`),
  KEY `trader` (`trader`),
  KEY `order` (`order`),
  KEY `batch` (`batch`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `cash_invoice`;
CREATE TABLE IF NOT EXISTS `cash_invoice` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `sn` varchar(20) NOT NULL,
  `company` mediumint(8) unsigned NOT NULL,
  `customer` mediumint(8) unsigned NOT NULL,
  `contract` mediumint(8) unsigned NOT NULL,
  `contact` mediumint(8) unsigned NOT NULL,
  `address` mediumint(8) unsigned NOT NULL,
  `money` decimal(12,2) NOT NULL,
  `type` varchar(30) NOT NULL,
  `saleType` varchar(30) NOT NULL,
  `taxRate` tinyint(3) unsigned NOT NULL,
  `invoiceTitle` varchar(100) NOT NULL,
  `taxNumber` varchar(20) NOT NULL,
  `registedAddress` varchar(90) NOT NULL,
  `phone` varchar(50) NOT NULL,
  `bankName` varchar(100) NOT NULL,
  `bankAccount` varchar(30) NOT NULL,
  `express` varchar(30) NOT NULL,
  `waybill` varchar(30) NOT NULL,
  `sendway` varchar(30) NOT NULL,
  `sendAccount` varchar(100) NOT NULL,
  `status` varchar(30) NOT NULL,
  `desc` text NOT NULL,
  `createdBy` varchar(30) NOT NULL,
  `createdDate` datetime NOT NULL,
  `editedBy` varchar(30) NOT NULL,
  `editedDate` datetime NOT NULL,
  `receivedBy` varchar(30) NOT NULL,
  `receivedDate` datetime NOT NULL,
  `checkedBy` varchar(30) NOT NULL,
  `checkedDate` datetime NOT NULL,
  `drawnBy` varchar(30) NOT NULL,
  `drawnDate` datetime NOT NULL,
  `expressedBy` varchar(30) NOT NULL,
  `expressedDate` datetime NOT NULL,
  `taxRefundedBy` varchar(30) NOT NULL,
  `taxRefundedDate` datetime NOT NULL,
  `deleted` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `customer` (`customer`),
  KEY `contract` (`contract`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `cash_invoicedetail`;
CREATE TABLE IF NOT EXISTS `cash_invoicedetail` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `invoice` mediumint(8) unsigned NOT NULL,
  `item` varchar(100) NOT NULL,
  `itemType` varchar(10) NOT NULL,
  `itemID` mediumint(8) unsigned NOT NULL,
  `model` varchar(100) NOT NULL,
  `unit` varchar(20) NOT NULL,
  `amount` decimal(12,2) NOT NULL,
  `price` decimal(12,2) NOT NULL,
  `money` decimal(12,2) NOT NULL,
  `taxRate` tinyint(3) unsigned NOT NULL,
  `taxMoney` decimal(12,2) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `invoice` (`invoice`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `cash_tradeinvoice`;
CREATE TABLE IF NOT EXISTS `cash_tradeinvoice` (
  `trade` mediumint(8) unsigned NOT NULL,
  `invoice` mediumint(8) unsigned NOT NULL,
  `createdBy` varchar(30) NOT NULL,
  `createdDate` datetime NOT NULL,
  UNIQUE KEY `tradeInvoice` (`trade`,`invoice`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `cash_kingdeeaccount`;
CREATE TABLE IF NOT EXISTS `cash_kingdeeaccount` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `company` mediumint(8) unsigned NOT NULL,
  `number` varchar(128) NOT NULL,
  `name` varchar(160) NOT NULL,
  `helperCode` varchar(40) NOT NULL,
  `groupID` varchar(255) NOT NULL,
  `dc` varchar(10) NOT NULL,
  `currencyID` varchar(255) NOT NULL,
  `adjustRate` varchar(10) NOT NULL,
  `contact` varchar(10) NOT NULL,
  `quantities` varchar(10) NOT NULL,
  `unitGroupID` varchar(255) NOT NULL,
  `measureUnitID` varchar(255) NOT NULL,
  `isCash` varchar(10) NOT NULL,
  `isBank` varchar(10) NOT NULL,
  `journal` varchar(10) NOT NULL,
  `detailID` varchar(10) NOT NULL,
  `isBalance` varchar(10) NOT NULL,
  `mainItemID` varchar(255) NOT NULL,
  `subItemID` varchar(255) NOT NULL,
  `itemClassNumber` varchar(255) NOT NULL,
  `itemClassName` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `cash_mappingrelation`;
CREATE TABLE IF NOT EXISTS `cash_mappingrelation` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `company` mediumint(8) unsigned NOT NULL,
  `type` varchar(10) NOT NULL,
  `depositor` mediumint(8) unsigned NOT NULL,
  `category` mediumint(8) unsigned NOT NULL,
  `product` mediumint(8) unsigned NOT NULL,
  `invoice` varchar(50) NOT NULl,
  `saleType` varchar(30) NOT NULl,
  `account` varchar(255) NOT NULL,
  `createdBy` varchar(30) NOT NULL,
  `createdDate` datetime NOT NULL,
  `editedBy` varchar(30) NOT NULL,
  `editedDate` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY (`company`, `type`, `depositor`, `category`, `product`, `invoice`, `saleType`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `cash_voucher`;
CREATE TABLE IF NOT EXISTS `cash_voucher` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `company` mediumint(8) unsigned NOT NULL,
  `origin` varchar(10) NOT NULL,
  `date` date NOT NULL COMMENT '凭证日期',
  `type` char(3) NOT NULL COMMENT '凭证字',
  `number` smallint(5) unsigned NOT NULL COMMENT '凭证号',
  `currency` varchar(5) NOT NULL DEFAULT 'RMB' COMMENT '币别代码',
  `debit` decimal(12,2) NOT NULL COMMENT '借方',
  `credit` decimal(12,2) NOT NULL COMMENT '贷方',
  `preparer` varchar(30) NOT NULL COMMENT '制单',
  `checker` varchar(30) NOT NULL COMMENT '审核',
  `approve` varchar(30) NOT NULL COMMENT '核准',
  `cashier` varchar(30) NOT NULL COMMENT '出纳',
  `handler` varchar(30) NOT NULL COMMENT '经办',
  `settleType` varchar(10) NOT NULL COMMENT '结算方式',
  `settleNo` varchar(10) NOT NULL COMMENT '结算号',
  `explanation` text NOT NULL COMMENT '凭证摘要',
  `reference` varchar(10) NOT NULL COMMENT '参考信息',
  `transDate` date NOT NULL COMMENT '业务日期',
  `transNo` varchar(10) NOT NULL COMMENT '往来业务编号',
  `attachments` tinyint(3) NOT NULL COMMENT '附件数',
  `serialNum` smallint(5) unsigned NOT NULL COMMENT '序号',
  `objectName` varchar(10) NOT NULL COMMENT '系统模块',
  `parameter` varchar(10) NOT NULL COMMENT '业务描述',
  `exchangeRate` decimal(12,4) NOT NULL COMMENT '汇率',
  `posted` tinyint(3) unsigned NOT NULL COMMENT '过账',
  `internalInd` varchar(10) NOT NULL COMMENT '机制凭证',
  `cashFlow` varchar(10) NOT NULL COMMENT '现金流量',
  `status` varchar(10) NOT NULL DEFAULT 'wait',
  `createdBy` char(30) NOT NULL,
  `createdDate` datetime NOT NULL,
  `editedBy` char(30) NOT NULL,
  `editedDate` datetime NOT NULL,
  `confirmedBy` char(30) NOT NULL,
  `confirmedDate` datetime NOT NULL,
  PRIMARY KEY `id` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `cash_voucherdetail`;
CREATE TABLE IF NOT EXISTS `cash_voucherdetail` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `voucher` mediumint(8) unsigned NOT NULL,
  `trade` varchar(255) NOT NULL,
  `invoice` varchar(255) NOT NULL,
  `account` varchar(255) NOT NULL COMMENT '科目代码',
  `debit` decimal(12,2) NOT NULL COMMENT '借方',
  `credit` decimal(12,2) NOT NULL COMMENT '贷方',
  `quantity` decimal(12,2) NOT NULL COMMENT '数量',
  `measureUnitID` varchar(10) NOT NULL COMMENT '数量单位',
  `unitPrice` decimal(12,2) NOT NULL COMMENT '单价',
  `exchangeRate` decimal(12,4) NOT NULL COMMENT '汇率',
  `entryID`  tinyint(3) unsigned NOT NULL COMMENT '分录序号',
  `explanation` text NOT NULL COMMENT '凭证摘要',
  `item` varchar(255) NOT NULL COMMENT '核算项目',
  `createdBy` char(30) NOT NULL,
  `createdDate` datetime NOT NULL,
  `editedBy` char(30) NOT NULL,
  `editedDate` datetime NOT NULL,
  PRIMARY KEY `id` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `crm_orderaction`;
CREATE TABLE IF NOT EXISTS `crm_orderaction` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `product` mediumint(8) unsigned NOT NULL,
  `action` char(30) NOT NULL,
  `name` char(100) NOT NULL,
  `conditions` text NOT NULL,
  `inputs` text NOT NULL,
  `results` text NOT NULL,
  `tasks` text NOT NULL,
  PRIMARY KEY (`id`),
  KEY `product` (`product`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `crm_orderfield`;
CREATE TABLE IF NOT EXISTS `crm_orderfield` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `product` mediumint(8) unsigned NOT NULL,
  `field` varchar(50) NOT NULL,
  `name` varchar(50) NOT NULL,
  `order` tinyint(3) unsigned NOT NULL,
  `control` varchar(10) NOT NULL,
  `options` text NOT NULL,
  `default` varchar(100) NOT NULL,
  `rules` varchar(255) NOT NULL,
  `placeholder` varchar(100) NOT NULL,
  `desc` text NOT NULL,
  PRIMARY KEY (`id`),
  KEY `product` (`product`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `crm_customerinvoice`;
CREATE TABLE IF NOT EXISTS `crm_customerinvoice` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `customer` mediumint(8) unsigned NOT NULL,
  `invoiceTitle` char(100) NOT NULL,
  `taxNumber` char(20) NOT NULL,
  `registedAddress` varchar(255) NOT NULL,
  `phone` char(20) NOT NULL,
  `bankName` char(30) NOT NULL,
  `bankAccount` char(90) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `taxNumber` (`customer`, `taxNumber`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `crm_quotation`;
CREATE TABLE IF NOT EXISTS `crm_quotation` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `name` char(100) NOT NULL,
  `amount` decimal(12,2) NOT NULL,
  `version` smallint(5) unsigned NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`),
  KEY `version` (`version`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `hr_bonus`;
CREATE TABLE IF NOT EXISTS `hr_bonus` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `month` char(6) NOT NULL,
  `account` char(30) NOT NULL,
  `dept` mediumint(8) unsigned NOT NULL,
  `performance` decimal(12,2) NOT NULL,
  `bonus` decimal(12,2) NOT NULL,
  `desc` text NOT NULL,
  `createdBy` char(30) NOT NULL,
  `createdDate` datetime NOT NULL,
  `editedBy` char(30) NOT NULL,
  `editedDate` datetime NOT NULL,
  `status` enum('wait', 'confirmed') NOT NULL DEFAULT 'wait',
  PRIMARY KEY (`id`),
  KEY `month` (`month`),
  KEY `account` (`account`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `hr_salary`;
CREATE TABLE IF NOT EXISTS `hr_salary` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `month` char(6) NOT NULL,
  `account` char(30) NOT NULL,
  `dept` mediumint(8) unsigned NOT NULL,
  `basic` decimal(12,2) NOT NULL,
  `performance` decimal(12,2) NOT NULL,
  `bonus` decimal(12,2) NOT NULL,
  `allowance` decimal(12,2) NOT NULL,
  `exemption` decimal(12,2) NOT NULL,
  `deduction` decimal(12,2) NOT NULL,
  `deserved` decimal(12,2) NOT NULL,
  `actual` decimal(12,2) NOT NULL,
  `companySSF` decimal(12,2) NOT NULL,
  `companyHPF` decimal(12,2) NOT NULL,
  `createdBy` char(30) NOT NULL,
  `createdDate` datetime NOT NULL,
  `editedBy` char(30) NOT NULL,
  `editedDate` datetime NOT NULL,
  `desc` text NOT NULL,
  `status` varchar(20) NOT NULL DEFAULT 'wait',
  PRIMARY KEY (`id`),
  KEY `month` (`month`),
  KEY `account` (`account`),
  KEY `dept` (`dept`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `hr_salarydetail`;
CREATE TABLE IF NOT EXISTS `hr_salarydetail` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `salary` mediumint(8) unsigned NOT NULL,
  `item` enum('bonus', 'allowance', 'exemption', 'deduction') NOT NULL,
  `type` varchar(100) NOT NULL,
  `amount` decimal(12,2) NOT NULL,
  `desc` text NOT NULL,
  PRIMARY KEY (`id`),
  KEY `salary` (`salary`),
  KEY `item` (`item`),
  KEY `type` (`type`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `hr_salarycommission`;
CREATE TABLE IF NOT EXISTS `hr_salarycommission` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `salary` mediumint(8) unsigned NOT NULL,
  `type` varchar(10) NOT NULL DEFAULT 'sale',
  `line` varchar(60) NOT NULL,
  `amount` decimal(12,2) NOT NULL,
  `rate` decimal(12,2) NOT NULL,
  `commission` decimal(12,2) NOT NULL,
  `desc` text NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `salarycommission` (`salary`, `type`, `line`),
  KEY `salary` (`salary`),
  KEY `line` (`line`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `hr_tradecommission`;
CREATE TABLE IF NOT EXISTS `hr_tradecommission` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `type` varchar(10) NOT NULL DEFAULT 'sale',
  `trade` mediumint(8) unsigned NOT NULL,
  `account` char(30) NOT NULL,
  `contribution` decimal(12,2) NOT NULL,
  `rate` decimal(12,2) NOT NULL,
  `amount` decimal(12,2) NOT NULL,
  `desc` text NOT NULL,
  `createdBy` char(30) NOT NULL,
  `createdDate` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `account` (`account`),
  KEY `trade` (`trade`),
  UNIQUE KEY `tradecommission` (`type`, `trade`,`account`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `hr_commissionrule`;
CREATE TABLE IF NOT EXISTS `hr_commissionrule` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `month` char(6) NOT NULL,
  `account` char(30) NOT NULL,
  `sale` text NOT NULL,
  `line` text NOT NULL,
  PRIMARY KEY (`id`),
  KEY `month` (`month`),
  KEY `account` (`account`),
  UNIQUE KEY `monthaccount` (`month`, `account`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `psi_batch`;
CREATE TABLE IF NOT EXISTS `psi_batch` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `batchNo` varchar(255) NOT NULL,
  `type` enum('in', 'out') NOT NULL DEFAULT 'in',
  `trader` mediumint(8) unsigned NOT NULL,
  `order` mediumint(8) unsigned NOT NULL,
  `fund` mediumint(8) unsigned NOT NULL,
  `money` decimal(15,2) NOT NULL,
  `pickedBy` char(30) NOT NULL,
  `pickedDate` date  NOT NULL,
  `expressedBy` char(30) NOT NULL,
  `expressedDate` date NOT NULL,
  `express` smallint(5) unsigned NOT NULL,
  `waybill` char(50) NOT NULL,
  `createdBy` char(30) NOT NULL,
  `createdDate` datetime NOT NULL,
  `assignedTo` char(30) NOT NULL,
  `assignedBy` char(30) NOT NULL,
  `assignedDate` datetime NOT NULL,
  `status` char(20) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `order` (`order`),
  KEY `trader` (`trader`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `psi_batchproduct`;
CREATE TABLE IF NOT EXISTS `psi_batchproduct` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `order` mediumint(8) unsigned NOT NULL,
  `trader` mediumint(8) unsigned NOT NULL,
  `batch` mediumint(8) unsigned NOT NULL,
  `product` mediumint(8) unsigned NOT NULL,
  `price` decimal(15,2) NOT NULL,
  `amount` decimal(15,2) NOT NULL,
  `money` decimal(15,2) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `batch` (`batch`),
  KEY `order` (`order`),
  KEY `trader` (`trader`),
  KEY `product` (`product`),
  UNIQUE KEY `batchProduct` (`batch`,`product`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `psi_order`;
CREATE TABLE IF NOT EXISTS `psi_order` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `orderNo` varchar(255) NOT NULL,
  `type` enum('sale', 'purchase') NOT NULL DEFAULT 'sale',
  `trader` mediumint(8) unsigned NOT NULL,
  `contract` mediumint(8) unsigned NOT NULL,
  `money` decimal(15,2) NOT NULL,
  `taxed` enum('0', '1') NOT NULL DEFAULT '1',
  `settlement` char(30) NOT NULL,
  `desc` text NOT NULL,
  `createdBy` char(30) NOT NULL,
  `createdDate` datetime NOT NULL,
  `editedBy` char(30) NOT NULL,
  `editedDate` datetime NOT NULL,
  `assignedTo` char(30) NOT NULL,
  `assignedBy` char(30) NOT NULL,
  `assignedDate` datetime NOT NULL,
  `finishedDate` date NOT NULL,
  `status` char(20) NOT NULL,
  `deleted` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `trader` (`trader`),
  KEY `status` (`status`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `psi_orderproduct`;
CREATE TABLE IF NOT EXISTS `psi_orderproduct` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `app` char(30) NOT NULL,
  `order` mediumint(8) unsigned NOT NULL,
  `quotation` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `trader` mediumint(8) unsigned NOT NULL,
  `product` mediumint(8) unsigned NOT NULL,
  `unit` text NOT NULL,
  `amount` decimal(15,2) NOT NULL,
  `price` decimal(15,2) NOT NULL,
  `money` decimal(15,2) NOT NULL,
  `version` smallint(5) unsigned NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`),
  KEY `order` (`order`),
  KEY `trader` (`trader`),
  KEY `product` (`product`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `psi_purchaseproduct`;
CREATE TABLE IF NOT EXISTS `psi_purchaseproduct` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `order` mediumint(8) unsigned NOT NULL,
  `product` mediumint(8) unsigned NOT NULL,
  `amount` decimal(15,2) NOT NULL,
  `assignedTo` char(30) NOT NULL,
  `status` char(20) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `order` (`order`),
  KEY `product` (`product`),
  UNIQUE KEY `orderProduct` (`order`,`product`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `sys_company` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `name` char(100) NOT NULL,
  `major` enum('0','1') NOT NULL DEFAULT '0',
  `content` text NOT NULL,
  `taxNumber` char(20) NOT NULL,
  `registedAddress` varchar(255) NOT NULL,
  `phone` char(20) NOT NULL,
  `bankName` char(100) NOT NULL,
  `bankAccount` char(90) NOT NULL,
  `status` char(90) NOT NULL,
  `createdBy` char(30) NOT NULL,
  `createdDate` datetime NOT NULL,
  `editedBy` char(30) NOT NULL,
  `editedDate` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `sys_issue`;
CREATE TABLE IF NOT EXISTS `sys_issue` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `product` mediumint(8) unsigned NOT NULL,
  `category` mediumint(8) unsigned NOT NULL,
  `customer` mediumint(8) unsigned NOT NULL,
  `contact` mediumint(8) unsigned NOT NULL,
  `pri` tinyint(3) unsigned DEFAULT NULL,
  `title` varchar(255) NOT NULL,
  `desc` text NOT NULL,
  `type` varchar(30) NOT NULL,
  `addedBy` char(30) NOT NULL,
  `addedDate` datetime NOT NULL,
  `viewedDate` datetime NOT NULL,
  `assignedTo` char(30) NOT NULL,
  `assignedBy` char(30) NOT NULL,
  `assignedDate` datetime NOT NULL,
  `repliedBy` char(30) NOT NULL,
  `repliedDate` datetime NOT NULL,
  `transferedBy` char(30) NOT NULL,
  `transferedDate` datetime NOT NULL,
  `editedBy` char(30) NOT NULL,
  `editedDate` datetime NOT NULL,
  `closedBy` char(30) NOT NULL,
  `closedDate` datetime NOT NULL,
  `closedReason` varchar(30) NOT NULL,
  `activatedBy` char(30) NOT NULL,
  `activatedDate` datetime NOT NULL,
  `toObjectType` varchar(30) NOT NULL,
  `toObjectID` mediumint(8) unsigned NOT NULL,
  `status` varchar(30) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `sys_searchdict`;
CREATE TABLE IF NOT EXISTS `sys_searchdict` (
  `key` smallint(5) unsigned NOT NULL,
  `value` char(3) NOT NULL,
  PRIMARY KEY (`key`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `sys_searchindex`;
CREATE TABLE IF NOT EXISTS `sys_searchindex` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `objectType` char(20) NOT NULL,
  `objectID` mediumint(8) unsigned NOT NULL,
  `title` text NOT NULL,
  `content` text NOT NULL,
  `addedDate` datetime NOT NULL,
  `editedDate` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `object` (`objectType`,`objectID`),
  KEY `addedDate` (`addedDate`),
  FULLTEXT KEY `content` (`title`,`content`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `sys_store`;
CREATE TABLE IF NOT EXISTS `sys_store` (
  `id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(200) NOT NULL,
  `location` varchar(255) NOT NULL,
  `desc` text NOT NULL,
  `manager` varchar(100) NOT NULL,
  `deleted` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `sys_weekly`;
CREATE TABLE IF NOT EXISTS `sys_weekly` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `title` varchar(255) NOT NULL,
  `summary` text NOT NULL,
  `content` text NOT NULL,
  `begin` date NOT NULL,
  `end` date NOT NULL,
  `status` enum('draft', 'normal') NOT NULL DEFAULT 'normal',
  `createdBy` varchar(30) NOT NULL,
  `createdDate` datetime NOT NULL,
  `editedBy` varchar(30) NOT NULL,
  `editedDate` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci;

-- DROP TABLE IF EXISTS `sys_effort`;
CREATE TABLE IF NOT EXISTS `sys_effort` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `objectType` varchar(30) NOT NULL,
  `objectID` mediumint(8) unsigned NOT NULL,
  `project` mediumint(8) unsigned NOT NULL,
  `account` varchar(30) NOT NULL,
  `work` varchar(255) NOT NULL,
  `date` date NOT NULL,
  `left` float NOT NULL,
  `consumed` float NOT NULL,
  `begin` smallint(4) unsigned ZEROFILL NOT NULL,
  `end` smallint(4) unsigned ZEROFILL NOT NULL,
  KEY `effort` (`project`,`objectID`,`date`,`account`)
) ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci;

-- DROP TABLE IF EXISTS `sys_oauth`;
CREATE TABLE IF NOT EXISTS `sys_oauth` (
  `account` varchar(30) NOT NULL,
  `provider` varchar(30) NOT NULL,
  `openID` varchar(60) NOT NULL,
  UNIQUE KEY `openID` (`provider`,`openID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

ALTER TABLE `cash_trade`     ADD `noInvoice` enum('0', '1') NOT NULL DEFAULT '0' AFTER `currency`;
ALTER TABLE `cash_trade`     ADD `commission` decimal(12,2) NOT NULL AFTER `money`;
ALTER TABLE `cash_trade`     ADD `alipayTradeNo` varchar(50) NOT NULL AFTER `category`;
ALTER TABLE `cash_trade`     ADD `shareStatus` varchar(10) NOT NULL DEFAULT 'wait';
ALTER TABLE `cash_trade`     ADD `sharedDate` datetime NOT NULL AFTER `shareStatus`;
ALTER TABLE `cash_depositor` ADD `company` mediumint(8) unsigned NOT NULL AFTER `id`;
ALTER TABLE `crm_order`      ADD `quotation` mediumint(8) unsigned NOT NULL DEFAULT '0' AFTER `customer`;
ALTER TABLE `crm_contact`    ADD `register` datetime NOT NULL;
ALTER TABLE `crm_contact`    ADD `last` datetime NOT NULL;
ALTER TABLE `crm_contact`    ADD `visits` mediumint(8) NOT NULL;
ALTER TABLE `crm_contact`    ADD `ip` char(50) NOT NULL;
ALTER TABLE `crm_contract`   ADD `fund` mediumint(8) unsigned NOT NULL AFTER `contact`;
ALTER TABLE `crm_contract`   ADD `company` mediumint(8) unsigned NOT NULL AFTER `id`;
ALTER TABLE `crm_contract`   ADD `quotation` char(255) NOT NULL AFTER `code`;
ALTER TABLE `crm_plan`       ADD `invoice` char(255) NOT NULL AFTER `contract`;
ALTER TABLE `oa_leave`       ADD `level` tinyint(3) unsigned NOT NULL;
ALTER TABLE `oa_leave`       ADD `assignedTo` varchar(30) NOT NULL;
ALTER TABLE `oa_leave`       ADD `reviewers` text NOT NULL;
ALTER TABLE `oa_leave`       ADD `backReviewers` text NOT NULL;
ALTER TABLE `oa_lieu`        ADD `level` tinyint(3) unsigned NOT NULL;
ALTER TABLE `oa_lieu`        ADD `assignedTo` varchar(30) NOT NULL;
ALTER TABLE `oa_lieu`        ADD `reviewers` text NOT NULL;
ALTER TABLE `oa_overtime`    ADD `level` tinyint(3) unsigned NOT NULL;
ALTER TABLE `oa_overtime`    ADD `assignedTo` varchar(30) NOT NULL;
ALTER TABLE `oa_overtime`    ADD `reviewers` text NOT NULL;
ALTER TABLE `oa_refund`      ADD `refundCompany` mediumint(8) unsigned NOT NULL AFTER `id`;
ALTER TABLE `oa_refund`      ADD `type` enum('reimburse', 'deduction') NOT NULL DEFAULT 'reimburse' AFTER `refundCompany`;
ALTER TABLE `oa_refund`      ADD `deductionMonth` char(6) NOT NULL AFTER `type`;
ALTER TABLE `oa_refund`      ADD `level` tinyint(3) unsigned NOT NULL;
ALTER TABLE `oa_refund`      ADD `assignedTo` varchar(30) NOT NULL;
ALTER TABLE `oa_refund`      ADD `reviewers` text NOT NULL;
ALTER TABLE `sys_action`     ADD `origin` varchar(256) NOT NULL;
ALTER TABLE `sys_action`     ADD `efforted` BOOL NOT NULL DEFAULT  '0';
ALTER TABLE `sys_category`   ADD `wechatDept` varchar(100) NOT NULL AFTER `id`;
ALTER TABLE `sys_category`   ADD `isAmebaDept` enum('0', '1') NOT NULL DEFAULT '0';
ALTER TABLE `sys_category`   ADD `amebaDept` varchar(10) NOT NUll;
ALTER TABLE `sys_product`    ADD `roles` varchar(255) NOT NULL;
ALTER TABLE `sys_product`    ADD `pinyin` char(200) NOT NULL AFTER `category`;
ALTER TABLE `sys_product`    ADD `model` char(30) NOT NULL AFTER `pinyin`;
ALTER TABLE `sys_product`    ADD `unit` char(30) NOT NULL AFTER `model`;
ALTER TABLE `sys_product`    ADD `barcode` char(30) NOT NULL AFTER `unit`;
ALTER TABLE `sys_product`    ADD `brand` varchar(100) NOT NULL AFTER `barcode`;
ALTER TABLE `sys_product`    ADD `store` smallint(5) unsigned NOT NULL AFTER `brand`;
ALTER TABLE `sys_product`    ADD `price` decimal(15,2) NOT NULL AFTER `store`;
ALTER TABLE `sys_product`    ADD `amount` decimal(15,2) NOT NULL AFTER `price`;
ALTER TABLE `sys_user`       ADD `parent` varchar(30) NOT NULL AFTER `id`;
ALTER TABLE `sys_user`       ADD `unofficial` enum('0', '1') NOT NULL DEFAULT '0' AFTER `parent`;
ALTER TABLE `sys_user`       ADD `noSalary` enum('0', '1') NOT NULL DEFAULT '0' AFTER `unofficial`;

ALTER TABLE `crm_plan` CHANGE `trade` `trade` char(255) NOT NULL;

INSERT INTO `ameba_category` (`id`, `parent`, `path`, `grade`, `order`, `type`, `amebaAccount`, `category`) VALUES
(1, 0, ',1,',   1, 1, 'amebaAccount', 'income',          830001),
(2, 1, ',1,2,', 2, 1, 'amebaAccount', 'externalIncome',  830002),
(3, 1, ',1,3,', 2, 2, 'amebaAccount', 'internalIncome',  830003),
(4, 0, ',4,',   1, 2, 'amebaAccount', 'expense',         830004),
(5, 4, ',4,5,', 2, 1, 'amebaAccount', 'internalDeal',    830005),
(6, 4, ',4,6,', 2, 2, 'amebaAccount', 'internalExpense', 830006),
(7, 4, ',4,7,', 2, 3, 'amebaAccount', 'shareExpense',    830007);

INSERT INTO `sys_category` (`id`, `name`, `type`) VALUES
(830001, '收入',     'amebaAccount'),
(830002, '外部收入', 'amebaAccount'),
(830003, '内部收入', 'amebaAccount'),
(830004, '支出',     'amebaAccount'),
(830005, '巴巴交易', 'amebaAccount'),
(830006, '巴内支出', 'amebaAccount'),
(830007, '公摊费用', 'amebaAccount');

INSERT INTO `sys_config` (`owner`, `app`, `module`, `section`, `key`, `value`) VALUES ('system','psi','order','orderNo','sale','[{\"type\":\"fixed\",\"fixed\":\"SO\",\"yearLength\":\"\",\"AILength\":\"\",\"AIClearType\":\"\"},{\"type\":\"year\",\"fixed\":\"\",\"yearLength\":\"4\",\"AILength\":\"\",\"AIClearType\":\"\"},{\"type\":\"month\",\"fixed\":\"\",\"yearLength\":\"\",\"AILength\":\"\",\"AIClearType\":\"\"},{\"type\":\"day\",\"fixed\":\"\",\"yearLength\":\"\",\"AILength\":\"\",\"AIClearType\":\"\"},{\"type\":\"AI\",\"fixed\":\"\",\"yearLength\":\"\",\"AILength\":\"3\",\"AIClearType\":\"day\"}]'),('system','psi','order','orderNo','purchase','[{\"type\":\"fixed\",\"fixed\":\"PI\",\"yearLength\":\"\",\"AILength\":\"\",\"AIClearType\":\"\"},{\"type\":\"year\",\"fixed\":\"\",\"yearLength\":\"4\",\"AILength\":\"\",\"AIClearType\":\"\"},{\"type\":\"month\",\"fixed\":\"\",\"yearLength\":\"\",\"AILength\":\"\",\"AIClearType\":\"\"},{\"type\":\"day\",\"fixed\":\"\",\"yearLength\":\"\",\"AILength\":\"\",\"AIClearType\":\"\"},{\"type\":\"AI\",\"fixed\":\"\",\"yearLength\":\"\",\"AILength\":\"3\",\"AIClearType\":\"day\"}]'),('system','psi','order','orderNo','out','[{\"type\":\"fixed\",\"fixed\":\"IO\",\"yearLength\":\"\",\"AILength\":\"\",\"AIClearType\":\"\"},{\"type\":\"year\",\"fixed\":\"\",\"yearLength\":\"4\",\"AILength\":\"\",\"AIClearType\":\"\"},{\"type\":\"month\",\"fixed\":\"\",\"yearLength\":\"\",\"AILength\":\"\",\"AIClearType\":\"\"},{\"type\":\"day\",\"fixed\":\"\",\"yearLength\":\"\",\"AILength\":\"\",\"AIClearType\":\"\"},{\"type\":\"AI\",\"fixed\":\"\",\"yearLength\":\"\",\"AILength\":\"3\",\"AIClearType\":\"day\"}]'),('system','psi','order','orderNo','in','[{\"type\":\"fixed\",\"fixed\":\"II\",\"yearLength\":\"\",\"AILength\":\"\",\"AIClearType\":\"\"},{\"type\":\"year\",\"fixed\":\"\",\"yearLength\":\"4\",\"AILength\":\"\",\"AIClearType\":\"\"},{\"type\":\"month\",\"fixed\":\"\",\"yearLength\":\"\",\"AILength\":\"\",\"AIClearType\":\"\"},{\"type\":\"day\",\"fixed\":\"\",\"yearLength\":\"\",\"AILength\":\"\",\"AIClearType\":\"\"},{\"type\":\"AI\",\"fixed\":\"\",\"yearLength\":\"\",\"AILength\":\"3\",\"AIClearType\":\"day\"}]');

INSERT INTO `sys_cron` (`m`, `h`, `dom`, `mon`, `dow`, `command`, `remark`, `type`, `buildin`, `status`, `lastTime`) VALUES
('1', '1', '*', '*', '*', 'appName=crm&moduleName=leads&methodName=sync',                    '名单同步任务',      'zdoo', 1, 'normal', '0000-00-00 00:00:00'),
('1', '1', '*', '*', '*', 'appName=cash&moduleName=trade&methodName=syncAlipay',             '支付宝同步任务',    'zdoo', 1, 'normal', '0000-00-00 00:00:00'),
('1', '1', '*', '*', '*', 'appName=ameba&moduleName=deal&methodName=batchShare',             '分配收入/分摊支出', 'zdoo', 1, 'normal', '0000-00-00 00:00:00'),
('1', '1', '*', '*', '*', 'appName=ameba&moduleName=amebareport&methodName=updateStatement', '更新阿米巴核算表',  'zdoo', 1, 'normal', '0000-00-00 00:00:00');

INSERT INTO `sys_entry` (`name`, `abbr`, `code`, `buildin`, `integration`, `open`, `key`, `ip`, `logo`, `login`, `control`, `size`, `position`, `visible`, `order`) VALUES
('人力资源', '人资',   'hr',    1, 1, 'iframe', '70a4ec7bf82d831b09578f554141eed0', '*', 'theme/default/images/ips/app-hr.png',    '../hr/',    'simple', 'max', 'default', 1, 70),
('进销存',   '进销存', 'psi',   1, 1, 'iframe', 'be546d3fbb91fa8236b53a8c5fa90884', '*', 'theme/default/images/ips/app-psi.png',   '../psi/',   'simple', 'max', 'default', 1, 80),
('工作流',   '工作流', 'flow',  1, 1, 'iframe', '68149a7806b73b5b0e16bc0a42bfcf43', '*', 'theme/default/images/ips/app-flow.png',  '../flow/',  'simple', 'max', 'default', 1, 90),
('阿米巴',   '阿米巴', 'ameba', 1, 1, 'iframe', 'c73507819a054358b6f45f3f522bd8d3', '*', 'theme/default/images/ips/app-ameba.png', '../ameba/', 'simple', 'max', 'default', 1, 100);

REPLACE INTO `sys_grouppriv` VALUES
(1,'ameba','setting'),
(1,'amebareport','archive'),
(1,'amebareport','dailyReport'),
(1,'amebareport','export'),
(1,'amebareport','monthlyReport'),
(1,'amebareport','showDetail'),
(1,'amebareport','updateStatement'),
(1,'amebareport','weeklyReport'),
(1,'apppriv','ameba'),
(1,'apppriv','hr'),
(1,'apppriv','psi'),
(1,'attend','import'),
(1,'attend','importSettings'),
(1,'attend','showImportError'),
(1,'batch','browse'),
(1,'batch','browseFinished'),
(1,'batch','browsePurchaseOrders'),
(1,'batch','deliver'),
(1,'batch','detail'),
(1,'batch','editDeliver'),
(1,'batch','editPick'),
(1,'batch','editReceive'),
(1,'batch','printBatch'),
(1,'batch','receive'),
(1,'bonus','batchCreate'),
(1,'bonus','browse'),
(1,'bonus','confirm'),
(1,'bonus','delete'),
(1,'bonus','edit'),
(1,'bonus','viewAll'),
(1,'budget','batchCreate'),
(1,'budget','browse'),
(1,'budget','create'),
(1,'budget','delete'),
(1,'budget','edit'),
(1,'budget','export'),
(1,'budget','report'),
(1,'budget','share'),
(1,'budget','view'),
(1,'commission','batchSwitchIgnore'),
(1,'commission','browse'),
(1,'commission','create'),
(1,'commission','export'),
(1,'commission','report'),
(1,'commission','setCategory'),
(1,'commission','setLineCommission'),
(1,'commission','setSaleCommission'),
(1,'commission','setting'),
(1,'commission','switchIgnore'),
(1,'company','browse'),
(1,'company','cancel'),
(1,'company','create'),
(1,'company','edit'),
(1,'company','setMajor'),
(1,'contract','createQuotation'),
(1,'contract','editQuotation'),
(1,'contract','expense'),
(1,'contract','invoice'),
(1,'contract','setting'),
(1,'customer','createInvoice'),
(1,'customer','deleteInvoice'),
(1,'customer','editInvoice'),
(1,'customer','exportTemplate'),
(1,'customer','import'),
(1,'customer','invoice'),
(1,'customer','invoiceInfo'),
(1,'deal','batchCreate'),
(1,'deal','batchShare'),
(1,'deal','batchSwitchTradeStatus'),
(1,'deal','browse'),
(1,'deal','browseExpense'),
(1,'deal','browseIncome'),
(1,'deal','browseWait'),
(1,'deal','confirm'),
(1,'deal','create'),
(1,'deal','delete'),
(1,'deal','edit'),
(1,'deal','export'),
(1,'deal','switchTradeStatus'),
(1,'deal','view'),
(1,'fee','browse'),
(1,'fee','create'),
(1,'fee','delete'),
(1,'fee','edit'),
(1,'fee','export'),
(1,'fee','view'),
(1,'feedback','activate'),
(1,'feedback','assignTo'),
(1,'feedback','close'),
(1,'feedback','company'),
(1,'feedback','create'),
(1,'feedback','delete'),
(1,'feedback','doubt'),
(1,'feedback','edit'),
(1,'feedback','reply'),
(1,'feedback','transfer'),
(1,'feedback','view'),
(1,'invoice','browse'),
(1,'invoice','create'),
(1,'invoice','delete'),
(1,'invoice','drawn'),
(1,'invoice','edit'),
(1,'invoice','export'),
(1,'invoice','express'),
(1,'invoice','report'),
(1,'invoice','taxRefund'),
(1,'invoice','view'),
(1,'leads','adminSites'),
(1,'leads','createSite'),
(1,'leads','deleteSite'),
(1,'leads','editSite'),
(1,'leads','sync'),
(1,'my','deptSalary'),
(1,'order','team'),
(1,'payable','create'),
(1,'payable','delete'),
(1,'payable','edit'),
(1,'payable','paid'),
(1,'payable','pay'),
(1,'payable','payable'),
(1,'payable','view'),
(1,'product','actionconditions'),
(1,'product','actioninputs'),
(1,'product','actionresults'),
(1,'product','actiontasks'),
(1,'product','adminaction'),
(1,'product','adminfield'),
(1,'product','adminroles'),
(1,'product','batchCreate'),
(1,'product','batchCreateProperties'),
(1,'product','browseProperties'),
(1,'product','copy'),
(1,'product','createaction'),
(1,'product','createfield'),
(1,'product','createFromOrder'),
(1,'product','createresult'),
(1,'product','deleteaction'),
(1,'product','deletefield'),
(1,'product','deleteProperty'),
(1,'product','deleteresult'),
(1,'product','editaction'),
(1,'product','editfield'),
(1,'product','editProperty'),
(1,'product','editresult'),
(1,'purchase','activate'),
(1,'purchase','browse'),
(1,'purchase','cancel'),
(1,'purchase','create'),
(1,'purchase','delete'),
(1,'purchase','detail'),
(1,'purchase','edit'),
(1,'purchase','finish'),
(1,'purchase','printOrder'),
(1,'purchase','purchase'),
(1,'purchase','report'),
(1,'purchase','sendMail'),
(1,'receivable','create'),
(1,'receivable','delete'),
(1,'receivable','edit'),
(1,'receivable','receivable'),
(1,'receivable','receive'),
(1,'receivable','received'),
(1,'receivable','view'),
(1,'rule','browse'),
(1,'rule','create'),
(1,'rule','delete'),
(1,'rule','edit'),
(1,'rule','export'),
(1,'rule','view'),
(1,'salary','batchConfirm'),
(1,'salary','batchCreate'),
(1,'salary','batchDelete'),
(1,'salary','batchEdit'),
(1,'salary','company'),
(1,'salary','confirm'),
(1,'salary','delete'),
(1,'salary','dept'),
(1,'salary','edit'),
(1,'salary','export'),
(1,'salary','report'),
(1,'salary','setAllowance'),
(1,'salary','setBasic'),
(1,'salary','setBonus'),
(1,'salary','setExemption'),
(1,'salary','setSSF'),
(1,'sale','activate'),
(1,'sale','assignToPick'),
(1,'sale','assignToPurchase'),
(1,'sale','browse'),
(1,'sale','cancel'),
(1,'sale','create'),
(1,'sale','delete'),
(1,'sale','detail'),
(1,'sale','edit'),
(1,'sale','finish'),
(1,'sale','printOrder'),
(1,'sale','report'),
(1,'sales','admin'),
(1,'sales','browse'),
(1,'sales','create'),
(1,'sales','delete'),
(1,'sales','edit'),
(1,'store','browse'),
(1,'store','create'),
(1,'store','delete'),
(1,'store','edit'),
(1,'trade','incomeAndReceive'),
(1,'trade','invoice'),
(1,'trade','invoiceStatistics'),
(1,'trade','share'),
(1,'trade','syncAlipay'),
(1,'user','importLDAP'),
(2,'apppriv','hr'),
(2,'bonus','batchCreate'),
(2,'bonus','browse'),
(2,'bonus','confirm'),
(2,'bonus','delete'),
(2,'bonus','edit'),
(2,'bonus','viewAll'),
(2,'commission','batchSwitchIgnore'),
(2,'commission','browse'),
(2,'commission','create'),
(2,'commission','export'),
(2,'commission','report'),
(2,'commission','setCategory'),
(2,'commission','setLineCommission'),
(2,'commission','setSaleCommission'),
(2,'commission','setting'),
(2,'commission','switchIgnore'),
(2,'salary','batchConfirm'),
(2,'salary','batchCreate'),
(2,'salary','batchDelete'),
(2,'salary','batchEdit'),
(2,'salary','company'),
(2,'salary','confirm'),
(2,'salary','delete'),
(2,'salary','dept'),
(2,'salary','edit'),
(2,'salary','export'),
(2,'salary','report'),
(2,'salary','setAllowance'),
(2,'salary','setBasic'),
(2,'salary','setBonus'),
(2,'salary','setExemption'),
(2,'salary','setSSF'),
(2,'trade','incomeAndReceive'),
(2,'trade','invoice'),
(2,'trade','invoiceStatistics'),
(2,'trade','share'),
(2,'trade','syncAlipay'),
(3,'bonus','batchCreate'),
(3,'bonus','browse'),
(3,'bonus','confirm'),
(3,'bonus','delete'),
(3,'bonus','edit'),
(3,'bonus','viewAll'),
(3,'contract','createQuotation'),
(3,'contract','editQuotation'),
(3,'contract','expense'),
(3,'contract','invoice'),
(3,'contract','setting'),
(3,'customer','createInvoice'),
(3,'customer','deleteInvoice'),
(3,'customer','editInvoice'),
(3,'customer','exportTemplate'),
(3,'customer','import'),
(3,'customer','invoice'),
(3,'customer','invoiceInfo'),
(3,'feedback','activate'),
(3,'feedback','assignTo'),
(3,'feedback','close'),
(3,'feedback','company'),
(3,'feedback','create'),
(3,'feedback','delete'),
(3,'feedback','doubt'),
(3,'feedback','edit'),
(3,'feedback','reply'),
(3,'feedback','transfer'),
(3,'feedback','view'),
(3,'invoice','browse'),
(3,'invoice','create'),
(3,'invoice','delete'),
(3,'invoice','edit'),
(3,'invoice','export'),
(3,'invoice','express'),
(3,'invoice','report'),
(3,'invoice','view'),
(3,'leads','adminSites'),
(3,'leads','createSite'),
(3,'leads','deleteSite'),
(3,'leads','editSite'),
(3,'leads','sync'),
(3,'order','team'),
(3,'product','actionconditions'),
(3,'product','actioninputs'),
(3,'product','actionresults'),
(3,'product','actiontasks'),
(3,'product','adminaction'),
(3,'product','adminfield'),
(3,'product','adminroles'),
(3,'product','batchCreate'),
(3,'product','batchCreateProperties'),
(3,'product','browseProperties'),
(3,'product','copy'),
(3,'product','createaction'),
(3,'product','createfield'),
(3,'product','createFromOrder'),
(3,'product','createresult'),
(3,'product','deleteaction'),
(3,'product','deletefield'),
(3,'product','deleteProperty'),
(3,'product','deleteresult'),
(3,'product','editaction'),
(3,'product','editfield'),
(3,'product','editProperty'),
(3,'product','editresult'),
(4,'contract','createQuotation'),
(4,'contract','editQuotation'),
(4,'contract','expense'),
(4,'contract','invoice'),
(4,'customer','createInvoice'),
(4,'customer','deleteInvoice'),
(4,'customer','editInvoice'),
(4,'customer','exportTemplate'),
(4,'customer','import'),
(4,'customer','invoice'),
(4,'customer','invoiceInfo'),
(4,'feedback','activate'),
(4,'feedback','assignTo'),
(4,'feedback','close'),
(4,'feedback','company'),
(4,'feedback','create'),
(4,'feedback','delete'),
(4,'feedback','doubt'),
(4,'feedback','edit'),
(4,'feedback','reply'),
(4,'feedback','transfer'),
(4,'feedback','view'),
(4,'invoice','browse'),
(4,'invoice','create'),
(4,'invoice','delete'),
(4,'invoice','drawn'),
(4,'invoice','edit'),
(4,'invoice','export'),
(4,'invoice','express'),
(4,'invoice','report'),
(4,'invoice','taxRefund'),
(4,'invoice','view');

UPDATE `sys_action` SET `action` = 'submitted' WHERE `objectType` IN ('attend', 'leave', 'lieu', 'makeup', 'overtime', 'refund') AND `action` = 'commited';
-- DROP TABLE IF EXISTS `sys_workflow`;
CREATE TABLE IF NOT EXISTS `sys_workflow` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `parent` varchar(30) NOT NULL, 
  `child` varchar(30) NOT NULL, 
  `type` varchar(10) NOT NULL DEFAULT 'flow',
  `app` varchar(20) NOT NULL,
  `position` varchar(30) NOT NULL,
  `module` varchar(30) NOT NULL,
  `table` varchar(50) NOT NULL,
  `name` varchar(30) NOT NULL,
  `flowchart` text NOT NULL,
  `js` text NOT NULL,
  `css` text NOT NULL,
  `order` smallint(5) unsigned NOT NULL,
  `buildin` tinyint(1) unsigned NOT NULL,
  `administrator` text NOT NULL,
  `desc` text NOT NULL,
  `version` varchar(10) NOT NULL DEFAULT '1.0',
  `status` varchar(10) NOT NULL DEFAULT 'wait',
  `createdBy` varchar(30) NOT NULL,
  `createdDate` datetime NOT NULL,
  `editedBy` varchar(30) NOT NULL,
  `editedDate` datetime NOT NULL,
  PRIMARY KEY `id` (`id`),
  KEY `type` (`type`),
  KEY `app` (`app`),
  KEY `module` (`module`),
  KEY `order` (`order`),
  UNIQUE KEY `unique` (`app`, `module`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `sys_workflowaction`;
CREATE TABLE IF NOT EXISTS `sys_workflowaction` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `module` varchar(30) NOT NULL,
  `action` varchar(50) NOT NULL,
  `name` varchar(50) NOT NULL,
  `type` enum('single', 'batch') NOT NULL DEFAULT 'single',
  `batchMode` enum('same', 'different') NOT NULL DEFAULT 'different',
  `extensionType` varchar(10) NOT NULL DEFAULT 'override' COMMENT 'none | extend | override',
  `open` varchar(20) NOT NULL,
  `position` enum('menu', 'browseandview', 'browse', 'view') NOT NULL DEFAULT 'browseandview',
  `layout` char(20) NOT NULL,
  `show` enum('dropdownlist', 'direct') NOT NULL DEFAULT 'dropdownlist',
  `order` smallint(5) unsigned NOT NULL,
  `buildin` tinyint(1) unsigned NOT NULL,
  `conditions` text NOT NULL,
  `verifications` text NOT NULL,
  `hooks` text NOT NULL,
  `linkages` text NOT NULL,
  `js` text NOT NULL,
  `css` text NOT NULL,
  `toList` char(255) NOT NULL,
  `desc` text NOT NULL,
  `createdBy` varchar(30) NOT NULL,
  `createdDate` datetime NOT NULL,
  `editedBy` varchar(30) NOT NULL,
  `editedDate` datetime NOT NULL,
  PRIMARY KEY `id` (`id`),
  KEY `module` (`module`),
  KEY `action` (`action`),
  KEY `order` (`order`),
  UNIQUE KEY `unique` (`module`, `action`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `sys_workflowdatasource`;
CREATE TABLE IF NOT EXISTS `sys_workflowdatasource` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `type` enum('system', 'sql', 'func', 'option', 'lang') NOT NULL DEFAULT 'option',
  `name` varchar(30) NOT NULL,
  `datasource` text NOT NULL, 
  `createdBy` char(30) NOT NULL,
  `createdDate` datetime NOT NULL,
  `editedBy` char(30) NOT NULL,
  `editedDate` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `type` (`type`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

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

-- DROP TABLE IF EXISTS `sys_workflowlayout`;
CREATE TABLE IF NOT EXISTS `sys_workflowlayout` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `module` varchar(30) NOT NULL,
  `action` varchar(50) NOT NULL,
  `field`  varchar(50) NOT NULL,
  `order` smallint(5) unsigned NOT NULL,
  `width` smallint(5) NOT NULL,
  `position` text NOT NULL,
  `readonly` enum('0', '1') NOT NULL DEFAULT '0',
  `mobileShow` enum('0', '1') NOT NULL DEFAULT '1',
  `totalShow` enum('0', '1') NOT NULL DEFAULT '0',
  `defaultValue` text NOT NULL,
  `layoutRules` varchar(255) NOT NULL,
  PRIMARY KEY `id` (`id`),
  KEY `module` (`module`),
  KEY `action` (`action`),
  KEY `order` (`order`),
  UNIQUE KEY `unique` (`module`, `action`, `field`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `sys_workflowlabel`;
CREATE TABLE IF NOT EXISTS `sys_workflowlabel` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `module` varchar(30) NOT NULL,
  `code` varchar(30) NOT NULL,
  `label` varchar(255) NOT NULL,
  `params` text NOT NULL,
  `order` tinyint(3) NOT NULL,
  `buildin` tinyint(1) unsigned NOT NULL,
  `createdBy` char(30) NOT NULL,
  `createdDate` datetime NOT NULL,
  `editedBy` char(30) NOT NULL,
  `editedDate` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `module` (`module`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `sys_workflowlinkdata`;
CREATE TABLE IF NOT EXISTS `sys_workflowlinkdata` (
  `objectType` varchar(30) NOT NULL,
  `objectID` mediumint(8) unsigned NOT NULL,
  `linkedType` varchar(30) NOT NULL,
  `linkedID` mediumint(8) unsigned NOT NULL,
  `createdBy` varchar(30) NOT NULL,
  `createdDate` datetime NOT NULL,
  UNIQUE KEY `unique` (`objectType`, `objectID`, `linkedType`, `linkedID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `sys_workflowrelation`;
CREATE TABLE IF NOT EXISTS `sys_workflowrelation` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `prev` varchar(30) NOT NULL, 
  `next` varchar(30) NOT NULL,
  `field` varchar(50) NOT NULL,
  `actions` varchar(20) NOT NULL,
  `createdBy` char(30) NOT NULL,
  `createdDate` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

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

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

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

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

ALTER TABLE `sys_action` CHANGE `action` `action` varchar(80) NOT NULL DEFAULT '';
ALTER TABLE `sys_action` CHANGE `extra` `extra` text;
ALTER TABLE `sys_file`   CHANGE `objectType` `objectType` char(30) NOT NULL;

INSERT INTO `sys_workflow` VALUES (1,'','','flow','flow','','meetingroom','flow_meetingroom','会议室','','','',0,0,'{\"users\":[],\"groups\":[]}','','1.0','normal','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(2,'','','flow','flow','','meetingroombooking','flow_meetingroombooking','会议室预订','','','',0,0,'{\"users\":[],\"groups\":[]}','','1.0','normal','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(3,'','','flow','flow','','stamp','flow_stamp','印章申请','','','',0,0,'{\"users\":[],\"groups\":[]}','','1.0','normal','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(4,'','','flow','flow','','car','flow_car','车辆信息','','','',0,0,'{\"users\":[],\"groups\":[]}','','1.0','normal','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(5,'','','flow','flow','','carbooking','flow_carbooking','车辆预订','','','',0,0,'{\"users\":[],\"groups\":[]}','','1.0','normal','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(6,'','','flow','flow','','collect','flow_collect','请款','','','',0,0,'{\"users\":[],\"groups\":[]}','','1.0','normal','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(7,'','','flow','flow','','buy','flow_buy','采购','','','',0,0,'{\"users\":[],\"groups\":[]}','','1.0','normal','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(8,'','','flow','flow','','purchasing','flow_purchasing','物品采购','','','',0,0,'{\"users\":[],\"groups\":[]}','','1.0','normal','admin','2020-07-09 21:05:50','admin','2019-03-29 14:46:45'),(9,'purchasing','','table','flow','','purchasegood','flow_purchasegood','采购商品','','','',0,0,'','','1.0','normal','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00');
INSERT INTO `sys_workflowaction` VALUES (1,'meetingroom','browse','浏览列表','single','different','override','','menu','','direct',0,0,'[]','','[]','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(2,'meetingroom','create','新建','single','different','override','','menu','','direct',0,0,'[]','','[]','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(3,'meetingroom','edit','编辑','single','different','override','','browseandview','','direct',0,0,'[]','','[]','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(4,'meetingroom','view','查看详情','single','different','override','normal','browse','','direct',0,0,'[]','','[]','','','','','','admin','2020-07-09 21:05:50','admin','2016-11-23 11:13:08'),(5,'meetingroom','delete','删除','single','different','override','none','browseandview','','dropdownlist',0,0,'[]','','[]','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(6,'meetingroombooking','browse','浏览列表','single','different','override','','menu','','direct',0,0,'[]','','[]','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(7,'meetingroombooking','create','新建','single','different','override','','menu','','direct',0,0,'[]','{\"type\":\"sql\",\"message\":\"\\u8be5\\u65f6\\u95f4\\u6bb5\\u5df2\\u88ab\\u9884\\u8ba2\",\"sql\":\"select * from flow_meetingroombooking where deleted=\'0\' and room=\'$room\' and ((begin >= \'$begin\' and end <= \'$end\') or (begin <= \'$begin\' and end >= \'$end\') or (begin > \'$begin\' and begin < \'$end\') or (end > \'$begin\' and end < \'$end\'))\",\"sqlVars\":[{\"varName\":\"room\",\"paramType\":\"form\",\"param\":\"room\"},{\"varName\":\"begin\",\"paramType\":\"form\",\"param\":\"begin\"},{\"varName\":\"end\",\"paramType\":\"form\",\"param\":\"end\"}],\"sqlResult\":\"empty\"}','[]','','','','','','admin','2020-07-09 21:05:50','admin','2016-11-23 10:49:48'),(8,'meetingroombooking','edit','编辑','single','different','override','','browseandview','','direct',0,0,'[]','{\"type\":\"sql\",\"message\":\"\\u8be5\\u65f6\\u95f4\\u6bb5\\u5df2\\u88ab\\u9884\\u8ba2\",\"sql\":\"select * from flow_meetingroombooking where deleted=\'0\' and room=\'$room\' and id != \'$id\' and ((begin >= \'$begin\' and end <= \'$end\') or (begin <= \'$begin\' and end >= \'$end\') or (begin > \'$begin\' and begin < \'$end\') or (end > \'$begin\' and end < \'$end\'))\",\"sqlVars\":[{\"varName\":\"room\",\"paramType\":\"form\",\"param\":\"room\"},{\"varName\":\"begin\",\"paramType\":\"form\",\"param\":\"begin\"},{\"varName\":\"end\",\"paramType\":\"form\",\"param\":\"end\"},{\"varName\":\"id\",\"paramType\":\"record\",\"param\":\"id\"}],\"sqlResult\":\"empty\"}','[]','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(9,'meetingroombooking','view','查看详情','single','different','override','normal','browse','','direct',0,0,'[]','','[]','','','','','','admin','2020-07-09 21:05:50','admin','2016-11-23 11:14:53'),(10,'meetingroombooking','delete','删除','single','different','override','none','browseandview','','dropdownlist',0,0,'[]','','[]','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(11,'stamp','browse','浏览列表','single','different','override','','menu','','direct',0,0,'[]','','[]','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(12,'stamp','create','新建','single','different','override','','menu','','direct',0,0,'[]','','[]','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(13,'stamp','edit','编辑','single','different','override','','browseandview','','direct',0,0,'[]','','[]','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(14,'stamp','view','查看详情','single','different','override','','browse','','direct',0,0,'[]','','[]','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(15,'stamp','delete','删除','single','different','override','none','browseandview','','dropdownlist',0,0,'[]','','[]','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(16,'stamp','revoke','撤销','single','different','override','none','browseandview','','direct',0,0,'[{\"conditionType\":\"data\",\"fields\":[{\"field\":\"deleted\",\"operator\":\"equal\",\"param\":\"0\"},{\"field\":\"proposer\",\"operator\":\"equal\",\"param\":\"currentUser\"},{\"field\":\"status\",\"operator\":\"equal\",\"param\":\"wait\"}],\"sql\":\"\",\"sqlResult\":\"empty\"}]','','[{\"action\":\"update\",\"table\":\"stamp\",\"conditionType\":\"data\",\"message\":\"\",\"fields\":[{\"field\":\"status\",\"paramType\":\"custom\",\"param\":\"draft\"}],\"conditions\":[],\"wheres\":[{\"field\":\"id\",\"logicalOperator\":\"and\",\"operator\":\"equal\",\"paramType\":\"record\",\"param\":\"id\"}],\"sql\":\"UPDATE `flow_stamp`  SET  `status` = \'draft\' WHERE 1 AND (1  AND `id` = \'@id\' )\",\"sqlVars\":[],\"formVars\":[],\"recordVars\":{\"id\":\"id\"}}]','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(17,'stamp','submit','提交','single','different','override','none','browseandview','','direct',0,0,'[{\"conditionType\":\"data\",\"fields\":[{\"field\":\"status\",\"operator\":\"equal\",\"param\":\"draft\"},{\"field\":\"deleted\",\"operator\":\"equal\",\"param\":\"0\"},{\"field\":\"proposer\",\"operator\":\"equal\",\"param\":\"currentUser\"}],\"sql\":\"\",\"sqlResult\":\"empty\"}]','','[{\"action\":\"update\",\"table\":\"stamp\",\"conditionType\":\"data\",\"message\":\"\",\"fields\":[{\"field\":\"status\",\"paramType\":\"custom\",\"param\":\"wait\"}],\"conditions\":[],\"wheres\":[{\"field\":\"id\",\"logicalOperator\":\"and\",\"operator\":\"equal\",\"paramType\":\"record\",\"param\":\"id\"}],\"sql\":\"UPDATE `flow_stamp`  SET  `status` = \'wait\' WHERE 1 AND (1  AND `id` = \'@id\' )\",\"sqlVars\":[],\"formVars\":[],\"recordVars\":{\"id\":\"id\"}}]','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(18,'stamp','pass','通过','single','different','override','none','browseandview','','direct',0,0,'[{\"conditionType\":\"data\",\"fields\":[{\"field\":\"deleted\",\"operator\":\"equal\",\"param\":\"0\"},{\"field\":\"status\",\"operator\":\"equal\",\"param\":\"wait\"}],\"sql\":\"\",\"sqlResult\":\"empty\"}]','','[{\"action\":\"update\",\"table\":\"stamp\",\"conditionType\":\"data\",\"message\":\"\",\"fields\":[{\"field\":\"status\",\"paramType\":\"custom\",\"param\":\"pass\"},{\"field\":\"reviewedBy\",\"paramType\":\"actor\",\"param\":\"actor\"},{\"field\":\"reviewedDate\",\"paramType\":\"now\",\"param\":\"now\"}],\"conditions\":[],\"wheres\":[{\"field\":\"id\",\"logicalOperator\":\"and\",\"operator\":\"equal\",\"paramType\":\"record\",\"param\":\"id\"}],\"sql\":\"UPDATE `flow_stamp`  SET  `status` = \'pass\',  `reviewedBy` = \'$actor\',  `reviewedDate` = \'$now\' WHERE 1 AND (1  AND `id` = \'@id\' )\",\"sqlVars\":{\"reviewedBy\":\"actor\",\"reviewedDate\":\"now\"},\"formVars\":[],\"recordVars\":{\"id\":\"id\"}}]','','','','','','admin','2020-07-09 21:05:50','admin','2016-11-23 14:09:09'),(19,'stamp','reject','拒绝','single','different','override','none','browseandview','','direct',0,0,'[{\"conditionType\":\"data\",\"fields\":[{\"field\":\"status\",\"operator\":\"equal\",\"param\":\"wait\"},{\"field\":\"deleted\",\"operator\":\"equal\",\"param\":\"0\"}],\"sql\":\"\",\"sqlResult\":\"empty\"}]','','[{\"action\":\"update\",\"table\":\"stamp\",\"conditionType\":\"data\",\"message\":\"\",\"fields\":[{\"field\":\"status\",\"paramType\":\"custom\",\"param\":\"reject\"},{\"field\":\"reviewedBy\",\"paramType\":\"actor\",\"param\":\"actor\"},{\"field\":\"reviewedDate\",\"paramType\":\"now\",\"param\":\"now\"}],\"conditions\":[],\"wheres\":[{\"field\":\"id\",\"logicalOperator\":\"and\",\"operator\":\"equal\",\"paramType\":\"record\",\"param\":\"id\"}],\"sql\":\"UPDATE `flow_stamp`  SET  `status` = \'reject\',  `reviewedBy` = \'$actor\',  `reviewedDate` = \'$now\' WHERE 1 AND (1  AND `id` = \'@id\' )\",\"sqlVars\":{\"reviewedBy\":\"actor\",\"reviewedDate\":\"now\"},\"formVars\":[],\"recordVars\":{\"id\":\"id\"}}]','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(20,'car','browse','浏览列表','single','different','override','','menu','','direct',0,0,'[]','','[]','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(21,'car','create','新建','single','different','override','','menu','','direct',0,0,'[]','','[]','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(22,'car','edit','编辑','single','different','override','','browseandview','','direct',0,0,'[]','','[]','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(23,'car','view','查看详情','single','different','override','normal','browse','','direct',0,0,'[]','','[]','','','','','','admin','2020-07-09 21:05:50','admin','2016-11-23 13:18:22'),(24,'car','delete','删除','single','different','override','none','browseandview','','dropdownlist',0,0,'[]','','[]','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(25,'carbooking','browse','浏览列表','single','different','override','','menu','','direct',0,0,'[]','','[]','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(26,'carbooking','create','新建','single','different','override','','menu','','direct',0,0,'[]','{\"type\":\"sql\",\"message\":\"\\u8be5\\u65f6\\u95f4\\u6bb5\\u5df2\\u88ab\\u9884\\u8ba2\",\"sql\":\"select * from flow_carbooking where deleted=\'0\' and car=\'$car\' and ((begin >= \'$begin\' and end <= \'$end\') or (begin <= \'$begin\' and end >= \'$end\') or (begin > \'$begin\' and begin < \'$end\') or (end > \'$begin\' and end < \'$end\'))\",\"sqlVars\":[{\"varName\":\"car\",\"paramType\":\"form\",\"param\":\"car\"},{\"varName\":\"begin\",\"paramType\":\"form\",\"param\":\"begin\"},{\"varName\":\"end\",\"paramType\":\"form\",\"param\":\"end\"}],\"sqlResult\":\"empty\"}','[]','','','','','','admin','2020-07-09 21:05:50','admin','2016-11-23 13:36:02'),(27,'carbooking','edit','编辑','single','different','override','','browseandview','','direct',0,0,'[]','{\"type\":\"sql\",\"message\":\"\\u8be5\\u65f6\\u95f4\\u6bb5\\u5df2\\u88ab\\u9884\\u8ba2\",\"sql\":\"select * from flow_carbooking where deleted=\'0\' and car = \'$car\' and id != \'$id\' and  ((begin >= \'$begin\' and end <= \'$end\') or (begin <= \'$begin\' and end >= \'$end\') or (begin > \'$begin\' and begin < \'$end\') or (end > \'$begin\' and end < \'$end\'))\",\"sqlVars\":[{\"varName\":\"car\",\"paramType\":\"form\",\"param\":\"car\"},{\"varName\":\"begin\",\"paramType\":\"form\",\"param\":\"begin\"},{\"varName\":\"end\",\"paramType\":\"form\",\"param\":\"end\"},{\"varName\":\"id\",\"paramType\":\"record\",\"param\":\"id\"}],\"sqlResult\":\"empty\"}','[]','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(28,'carbooking','view','查看详情','single','different','override','normal','browse','','direct',0,0,'[]','','[]','','','','','','admin','2020-07-09 21:05:50','admin','2016-11-23 13:25:59'),(29,'carbooking','delete','删除','single','different','override','none','browseandview','','dropdownlist',0,0,'[]','','[]','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(30,'carbooking','pass','通过','single','different','override','none','browseandview','','direct',0,0,'[{\"conditionType\":\"data\",\"fields\":[{\"field\":\"deleted\",\"operator\":\"equal\",\"param\":\"0\"},{\"field\":\"status\",\"operator\":\"equal\",\"param\":\"wait\"}],\"sql\":\"\",\"sqlResult\":\"empty\"}]','','[{\"action\":\"update\",\"table\":\"carbooking\",\"conditionType\":\"data\",\"message\":\"\",\"fields\":[{\"field\":\"status\",\"paramType\":\"custom\",\"param\":\"pass\"}],\"conditions\":[],\"wheres\":[{\"field\":\"id\",\"logicalOperator\":\"and\",\"operator\":\"equal\",\"paramType\":\"record\",\"param\":\"id\"}],\"sql\":\"UPDATE `flow_carbooking`  SET  `status` = \'pass\' WHERE 1 AND (1  AND `id` = \'@id\' )\",\"sqlVars\":[],\"formVars\":[],\"recordVars\":{\"id\":\"id\"}}]','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(31,'carbooking','reject','拒绝','single','different','override','none','browseandview','','direct',0,0,'[{\"conditionType\":\"data\",\"fields\":[{\"field\":\"deleted\",\"operator\":\"equal\",\"param\":\"0\"},{\"field\":\"status\",\"operator\":\"equal\",\"param\":\"wait\"}],\"sql\":\"\",\"sqlResult\":\"empty\"}]','','[{\"action\":\"update\",\"table\":\"carbooking\",\"conditionType\":\"data\",\"message\":\"\",\"fields\":[{\"field\":\"status\",\"paramType\":\"custom\",\"param\":\"reject\"}],\"conditions\":[],\"wheres\":[{\"field\":\"id\",\"logicalOperator\":\"and\",\"operator\":\"equal\",\"paramType\":\"record\",\"param\":\"id\"}],\"sql\":\"UPDATE `flow_carbooking`  SET  `status` = \'reject\' WHERE 1 AND (1  AND `id` = \'@id\' )\",\"sqlVars\":[],\"formVars\":[],\"recordVars\":{\"id\":\"id\"}}]','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(32,'collect','browse','浏览列表','single','different','override','','menu','','direct',0,0,'[]','','[]','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(33,'collect','create','新建','single','different','override','','menu','','direct',0,0,'[]','','[]','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(34,'collect','edit','编辑','single','different','override','','browseandview','','direct',0,0,'[]','','[]','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(35,'collect','view','查看详情','single','different','override','normal','browse','','direct',0,0,'[]','','[]','','','','','','admin','2020-07-09 21:05:50','admin','2016-11-23 14:00:40'),(36,'collect','delete','删除','single','different','override','none','browseandview','','dropdownlist',0,0,'[]','','[]','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(37,'collect','pass','通过','single','different','override','none','browseandview','','direct',0,0,'[{\"conditionType\":\"data\",\"fields\":[{\"field\":\"status\",\"operator\":\"equal\",\"param\":\"wait\",\"logicalOperator\":\"and\"},{\"field\":\"deleted\",\"operator\":\"equal\",\"param\":\"0\",\"logicalOperator\":\"and\"}],\"sql\":\"\",\"sqlResult\":\"empty\"}]','','[{\"action\":\"update\",\"table\":\"collect\",\"conditionType\":\"data\",\"message\":\"\",\"fields\":[{\"field\":\"status\",\"paramType\":\"custom\",\"param\":\"pass\"},{\"field\":\"reviewedBy\",\"paramType\":\"actor\",\"param\":\"actor\"},{\"field\":\"reviewedDate\",\"paramType\":\"now\",\"param\":\"now\"}],\"conditions\":[],\"wheres\":[{\"field\":\"id\",\"logicalOperator\":\"and\",\"operator\":\"equal\",\"paramType\":\"record\",\"param\":\"id\"}],\"sql\":\"UPDATE `flow_collect`  SET  `status` = \'pass\',  `reviewedBy` = \'$actor\',  `reviewedDate` = \'$now\' WHERE 1 AND (1  AND `id` = \'@id\' )\",\"sqlVars\":{\"reviewedBy\":\"actor\",\"reviewedDate\":\"now\"},\"formVars\":[],\"recordVars\":{\"id\":\"id\"}}]','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(38,'collect','reject','拒绝','single','different','override','none','browseandview','','direct',0,0,'[{\"conditionType\":\"data\",\"fields\":[{\"field\":\"deleted\",\"operator\":\"equal\",\"param\":\"0\"},{\"field\":\"status\",\"operator\":\"equal\",\"param\":\"wait\"}],\"sql\":\"\",\"sqlResult\":\"empty\"}]','','[{\"action\":\"update\",\"table\":\"collect\",\"conditionType\":\"data\",\"message\":\"\",\"fields\":[{\"field\":\"status\",\"paramType\":\"custom\",\"param\":\"reject\"},{\"field\":\"reviewedBy\",\"paramType\":\"actor\",\"param\":\"actor\"},{\"field\":\"reviewedDate\",\"paramType\":\"now\",\"param\":\"now\"}],\"conditions\":[],\"wheres\":[{\"field\":\"id\",\"logicalOperator\":\"and\",\"operator\":\"equal\",\"paramType\":\"record\",\"param\":\"id\"}],\"sql\":\"UPDATE `flow_collect`  SET  `status` = \'reject\',  `reviewedBy` = \'$actor\',  `reviewedDate` = \'$now\' WHERE 1 AND (1  AND `id` = \'@id\' )\",\"sqlVars\":{\"reviewedBy\":\"actor\",\"reviewedDate\":\"now\"},\"formVars\":[],\"recordVars\":{\"id\":\"id\"}}]','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(39,'collect','pay','付款','single','different','override','modal','browseandview','','direct',0,0,'[{\"conditionType\":\"data\",\"fields\":[{\"field\":\"status\",\"operator\":\"equal\",\"param\":\"pass\"},{\"field\":\"deleted\",\"operator\":\"equal\",\"param\":\"0\"}],\"sql\":\"\",\"sqlResult\":\"empty\"}]','','[{\"action\":\"update\",\"table\":\"collect\",\"conditionType\":\"data\",\"message\":\"\",\"fields\":[{\"field\":\"status\",\"paramType\":\"custom\",\"param\":\"closed\"}],\"conditions\":[],\"wheres\":[{\"field\":\"id\",\"logicalOperator\":\"and\",\"operator\":\"equal\",\"paramType\":\"record\",\"param\":\"id\"}],\"sql\":\"UPDATE `flow_collect`  SET  `status` = \'closed\' WHERE 1 AND (1  AND `id` = \'@id\' )\",\"sqlVars\":[],\"formVars\":[],\"recordVars\":{\"id\":\"id\"}},{\"action\":\"insert\",\"table\":\"trade\",\"conditionType\":\"data\",\"message\":\"\",\"fields\":[{\"field\":\"depositor\",\"paramType\":\"form\",\"param\":\"depositor\"},{\"field\":\"category\",\"paramType\":\"form\",\"param\":\"category\"},{\"field\":\"type\",\"paramType\":\"custom\",\"param\":\"out\"},{\"field\":\"desc\",\"paramType\":\"record\",\"param\":\"reason\"},{\"field\":\"money\",\"paramType\":\"record\",\"param\":\"money\"},{\"field\":\"handlers\",\"paramType\":\"actor\",\"param\":\"actor\"},{\"field\":\"date\",\"paramType\":\"today\",\"param\":\"today\"},{\"field\":\"createdBy\",\"paramType\":\"actor\",\"param\":\"actor\"},{\"field\":\"createdDate\",\"paramType\":\"now\",\"param\":\"now\"}],\"conditions\":[],\"wheres\":[],\"sql\":\"INSERT INTO `cash_trade` (`depositor`, `category`, `type`, `desc`, `money`, `handlers`, `date`, `createdBy`, `createdDate`) VALUES (\'#depositor\', \'#category\', \'out\', \'@reason\', \'@money\', \'$actor\', \'$today\', \'$actor\', \'$now\') \",\"sqlVars\":{\"handlers\":\"actor\",\"date\":\"today\",\"createdBy\":\"actor\",\"createdDate\":\"now\"},\"formVars\":{\"depositor\":\"depositor\",\"category\":\"category\"},\"recordVars\":{\"desc\":\"reason\",\"money\":\"money\"}}]','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(40,'buy','browse','浏览列表','single','different','override','','menu','','direct',0,0,'[]','','[]','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(41,'buy','create','新建','single','different','override','','menu','','direct',0,0,'[]','','[]','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(42,'buy','edit','编辑','single','different','override','','browseandview','','direct',0,0,'[]','','[]','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(43,'buy','view','查看详情','single','different','override','','browse','','direct',0,0,'[]','','[]','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(44,'buy','delete','删除','single','different','override','none','browseandview','','dropdownlist',0,0,'[]','','[]','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(45,'buy','pay','付款','single','different','override','modal','browseandview','','direct',0,0,'[{\"conditionType\":\"data\",\"fields\":[{\"field\":\"deleted\",\"operator\":\"equal\",\"param\":\"0\"},{\"field\":\"status\",\"operator\":\"equal\",\"param\":\"unpaid\"}],\"sql\":\"\",\"sqlResult\":\"empty\"}]','','[{\"action\":\"update\",\"table\":\"buy\",\"conditionType\":\"data\",\"message\":\"\",\"fields\":[{\"field\":\"status\",\"paramType\":\"custom\",\"param\":\"paid\"}],\"conditions\":[],\"wheres\":[{\"field\":\"id\",\"logicalOperator\":\"and\",\"operator\":\"equal\",\"paramType\":\"record\",\"param\":\"id\"}],\"sql\":\"UPDATE `flow_buy`  SET  `status` = \'paid\' WHERE 1 AND (1  AND `id` = \'@id\' )\",\"sqlVars\":[],\"formVars\":[],\"recordVars\":{\"id\":\"id\"}},{\"action\":\"insert\",\"table\":\"trade\",\"conditionType\":\"data\",\"message\":\"\",\"fields\":[{\"field\":\"depositor\",\"paramType\":\"form\",\"param\":\"depositor\"},{\"field\":\"category\",\"paramType\":\"form\",\"param\":\"category\"},{\"field\":\"trader\",\"paramType\":\"record\",\"param\":\"provider\"},{\"field\":\"type\",\"paramType\":\"custom\",\"param\":\"out\"},{\"field\":\"handlers\",\"paramType\":\"actor\",\"param\":\"actor\"},{\"field\":\"desc\",\"paramType\":\"record\",\"param\":\"desc\"},{\"field\":\"money\",\"paramType\":\"record\",\"param\":\"money\"},{\"field\":\"date\",\"paramType\":\"today\",\"param\":\"today\"},{\"field\":\"createdBy\",\"paramType\":\"actor\",\"param\":\"actor\"},{\"field\":\"createdDate\",\"paramType\":\"now\",\"param\":\"now\"}],\"conditions\":[],\"wheres\":[],\"sql\":\"INSERT INTO `cash_trade` (`depositor`, `category`, `trader`, `type`, `handlers`, `desc`, `money`, `date`, `createdBy`, `createdDate`) VALUES (\'#depositor\', \'#category\', \'@provider\', \'out\', \'$actor\', \'@desc\', \'@money\', \'$today\', \'$actor\', \'$now\') \",\"sqlVars\":{\"handlers\":\"actor\",\"date\":\"today\",\"createdBy\":\"actor\",\"createdDate\":\"now\"},\"formVars\":{\"depositor\":\"depositor\",\"category\":\"category\"},\"recordVars\":{\"trader\":\"provider\",\"desc\":\"desc\",\"money\":\"money\"}}]','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(46,'purchasing','browse','浏览列表','single','different','override','','menu','','direct',0,0,'[]','','[]','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(47,'purchasing','create','新建','single','different','override','','menu','','direct',0,0,'[]','','[]','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(48,'purchasing','edit','编辑','single','different','override','','browseandview','','direct',0,0,'[]','','[]','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(49,'purchasing','view','查看详情','single','different','override','','browse','','direct',0,0,'[]','','[]','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(50,'purchasing','delete','删除','single','different','override','none','browseandview','','dropdownlist',0,0,'[]','','[]','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(51,'purchasegood','browse','浏览列表','single','different','override','','menu','','direct',0,0,'[]','','[]','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(52,'purchasegood','create','新建','single','different','override','','menu','','direct',0,0,'[]','','[]','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(53,'purchasegood','edit','编辑','single','different','override','','browseandview','','direct',0,0,'[]','','[]','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(54,'purchasegood','view','查看详情','single','different','override','','browse','','direct',0,0,'[]','','[]','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(55,'purchasegood','delete','删除','single','different','override','none','browseandview','','dropdownlist',0,0,'[]','','[]','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(56,'purchasing','pass','通过','single','different','override','none','browseandview','','direct',0,0,'[{\"conditionType\":\"data\",\"fields\":[{\"field\":\"status\",\"operator\":\"equal\",\"param\":\"wait\",\"logicalOperator\":\"and\"}],\"sql\":\"\",\"sqlResult\":\"empty\"}]','','[{\"action\":\"update\",\"table\":\"purchasing\",\"conditionType\":\"data\",\"message\":\"\",\"comment\":\"\",\"fields\":[{\"field\":\"status\",\"paramType\":\"custom\",\"param\":\"pass\"}],\"conditions\":[],\"wheres\":[{\"field\":\"id\",\"logicalOperator\":\"and\",\"operator\":\"equal\",\"paramType\":\"record\",\"param\":\"id\"}],\"sql\":\"UPDATE `flow_purchasing`  SET  `status` = \'pass\' WHERE 1 AND (1  AND `id` = \'@id\' )\",\"sqlVars\":[],\"formVars\":[],\"recordVars\":{\"id\":\"id\"}},{\"action\":\"insert\",\"table\":\"payable\",\"conditionType\":\"data\",\"message\":\"\",\"comment\":\"\\u5ba1\\u6279\\u901a\\u8fc7\\u540e\\u521b\\u5efa\\u4e00\\u6761\\u5e94\\u4ed8\\u6b3e\\u8bb0\\u5f55\\u3002\",\"fields\":[{\"field\":\"type\",\"paramType\":\"custom\",\"param\":\"payable\"},{\"field\":\"parent\",\"paramType\":\"custom\",\"param\":\"-1\"},{\"field\":\"origin\",\"paramType\":\"custom\",\"param\":\"\\u7269\\u54c1\\u91c7\\u8d2d\"},{\"field\":\"trader\",\"paramType\":\"record\",\"param\":\"provider\"},{\"field\":\"deserved\",\"paramType\":\"record\",\"param\":\"money\"},{\"field\":\"balance\",\"paramType\":\"record\",\"param\":\"money\"},{\"field\":\"desc\",\"paramType\":\"record\",\"param\":\"desc\"},{\"field\":\"custom\",\"paramType\":\"custom\",\"param\":\"1\"},{\"field\":\"createdBy\",\"paramType\":\"actor\",\"param\":\"actor\"},{\"field\":\"createdDate\",\"paramType\":\"now\",\"param\":\"now\"},{\"field\":\"editedBy\",\"paramType\":\"actor\",\"param\":\"actor\"},{\"field\":\"editedDate\",\"paramType\":\"now\",\"param\":\"now\"}],\"conditions\":[],\"wheres\":[],\"sql\":\"INSERT INTO `cash_fund` (`type`,`parent`,`origin`,`trader`,`deserved`,`balance`,`desc`,`custom`,`createdBy`,`createdDate`,`editedBy`,`editedDate`) VALUES (\'payable\',\'-1\',\'\\u7269\\u54c1\\u91c7\\u8d2d\',\'@provider\',\'@money\',\'@money\',\'@desc\',\'1\',\'$actor\',\'$now\',\'$actor\',\'$now\') \",\"sqlVars\":{\"createdBy\":\"actor\",\"createdDate\":\"now\",\"editedBy\":\"actor\",\"editedDate\":\"now\"},\"formVars\":[],\"recordVars\":{\"trader\":\"provider\",\"deserved\":\"money\",\"balance\":\"money\",\"desc\":\"desc\"}}]','','','','','','admin','2020-07-09 21:05:50','admin','2019-03-28 15:15:28'),(57,'purchasing','reject','拒绝','single','different','override','none','browseandview','','direct',0,0,'[{\"conditionType\":\"data\",\"fields\":[{\"field\":\"status\",\"operator\":\"equal\",\"param\":\"wait\",\"logicalOperator\":\"and\"}],\"sql\":\"\",\"sqlResult\":\"empty\"}]','','[{\"action\":\"update\",\"table\":\"purchasing\",\"conditionType\":\"data\",\"message\":\"\",\"comment\":\"\",\"fields\":[{\"field\":\"status\",\"paramType\":\"custom\",\"param\":\"reject\"}],\"conditions\":[],\"wheres\":[{\"field\":\"id\",\"logicalOperator\":\"and\",\"operator\":\"equal\",\"paramType\":\"record\",\"param\":\"id\"}],\"sql\":\"UPDATE `flow_purchasing`  SET  `status` = \'reject\' WHERE 1 AND (1  AND `id` = \'@id\' )\",\"sqlVars\":[],\"formVars\":[],\"recordVars\":{\"id\":\"id\"}}]','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(58,'buy','export','导出数据','single','different','override','none','menu','','direct',0,0,'[]','','[]','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(59,'car','export','导出数据','single','different','override','none','menu','','direct',0,0,'[]','','[]','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(60,'carbooking','export','导出数据','single','different','override','none','menu','','direct',0,0,'[]','','[]','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(61,'collect','export','导出数据','single','different','override','none','menu','','direct',0,0,'[]','','[]','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(62,'meetingroom','export','导出数据','single','different','override','none','menu','','direct',0,0,'[]','','[]','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(63,'meetingroombooking','export','导出数据','single','different','override','none','menu','','direct',0,0,'[]','','[]','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(64,'purchasegood','export','导出数据','single','different','override','none','menu','','direct',0,0,'[]','','[]','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(65,'purchasing','export','导出数据','single','different','override','none','menu','','direct',0,0,'[]','','[]','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(66,'stamp','export','导出数据','single','different','override','none','menu','','direct',0,0,'[]','','[]','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(67,'purchasing','batchcreate','批量新建','batch','different','override','normal','menu','','direct',0,0,'','','','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(68,'purchasing','batchedit','批量编辑','batch','different','override','normal','browse','','direct',0,0,'','','','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(69,'purchasing','link','关联数据','single','same','override','none','view','','direct',0,0,'','','','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(70,'purchasing','unlink','移除数据','single','same','override','none','view','','direct',0,0,'','','','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(71,'purchasing','exporttemplate','下载模板','single','same','override','none','menu','','direct',0,0,'','','','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(72,'purchasing','import','导入数据','single','same','override','none','menu','','direct',0,0,'','','','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(73,'purchasing','showimport','导入确认','single','same','override','none','menu','','direct',0,0,'','','','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(74,'buy','batchcreate','批量新建','batch','different','override','normal','menu','','direct',0,0,'','','','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(75,'buy','batchedit','批量编辑','batch','different','override','normal','browse','','direct',0,0,'','','','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(76,'buy','link','关联数据','single','same','override','none','view','','direct',0,0,'','','','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(77,'buy','unlink','移除数据','single','same','override','none','view','','direct',0,0,'','','','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(78,'buy','exporttemplate','下载模板','single','same','override','none','menu','','direct',0,0,'','','','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(79,'buy','import','导入数据','single','same','override','none','menu','','direct',0,0,'','','','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(80,'buy','showimport','导入确认','single','same','override','none','menu','','direct',0,0,'','','','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(81,'collect','batchcreate','批量新建','batch','different','override','normal','menu','','direct',0,0,'','','','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(82,'collect','batchedit','批量编辑','batch','different','override','normal','browse','','direct',0,0,'','','','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(83,'collect','link','关联数据','single','same','override','none','view','','direct',0,0,'','','','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(84,'collect','unlink','移除数据','single','same','override','none','view','','direct',0,0,'','','','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(85,'collect','exporttemplate','下载模板','single','same','override','none','menu','','direct',0,0,'','','','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(86,'collect','import','导入数据','single','same','override','none','menu','','direct',0,0,'','','','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(87,'collect','showimport','导入确认','single','same','override','none','menu','','direct',0,0,'','','','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(88,'carbooking','batchcreate','批量新建','batch','different','override','normal','menu','','direct',0,0,'','','','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(89,'carbooking','batchedit','批量编辑','batch','different','override','normal','browse','','direct',0,0,'','','','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(90,'carbooking','link','关联数据','single','same','override','none','view','','direct',0,0,'','','','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(91,'carbooking','unlink','移除数据','single','same','override','none','view','','direct',0,0,'','','','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(92,'carbooking','exporttemplate','下载模板','single','same','override','none','menu','','direct',0,0,'','','','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(93,'carbooking','import','导入数据','single','same','override','none','menu','','direct',0,0,'','','','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(94,'carbooking','showimport','导入确认','single','same','override','none','menu','','direct',0,0,'','','','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(95,'car','batchcreate','批量新建','batch','different','override','normal','menu','','direct',0,0,'','','','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(96,'car','batchedit','批量编辑','batch','different','override','normal','browse','','direct',0,0,'','','','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(97,'car','link','关联数据','single','same','override','none','view','','direct',0,0,'','','','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(98,'car','unlink','移除数据','single','same','override','none','view','','direct',0,0,'','','','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(99,'car','exporttemplate','下载模板','single','same','override','none','menu','','direct',0,0,'','','','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(100,'car','import','导入数据','single','same','override','none','menu','','direct',0,0,'','','','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(101,'car','showimport','导入确认','single','same','override','none','menu','','direct',0,0,'','','','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(102,'stamp','batchcreate','批量新建','batch','different','override','normal','menu','','direct',0,0,'','','','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(103,'stamp','batchedit','批量编辑','batch','different','override','normal','browse','','direct',0,0,'','','','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(104,'stamp','link','关联数据','single','same','override','none','view','','direct',0,0,'','','','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(105,'stamp','unlink','移除数据','single','same','override','none','view','','direct',0,0,'','','','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(106,'stamp','exporttemplate','下载模板','single','same','override','none','menu','','direct',0,0,'','','','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(107,'stamp','import','导入数据','single','same','override','none','menu','','direct',0,0,'','','','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(108,'stamp','showimport','导入确认','single','same','override','none','menu','','direct',0,0,'','','','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(109,'meetingroombooking','batchcreate','批量新建','batch','different','override','normal','menu','','direct',0,0,'','','','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(110,'meetingroombooking','batchedit','批量编辑','batch','different','override','normal','browse','','direct',0,0,'','','','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(111,'meetingroombooking','link','关联数据','single','same','override','none','view','','direct',0,0,'','','','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(112,'meetingroombooking','unlink','移除数据','single','same','override','none','view','','direct',0,0,'','','','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(113,'meetingroombooking','exporttemplate','下载模板','single','same','override','none','menu','','direct',0,0,'','','','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(114,'meetingroombooking','import','导入数据','single','same','override','none','menu','','direct',0,0,'','','','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(115,'meetingroombooking','showimport','导入确认','single','same','override','none','menu','','direct',0,0,'','','','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(116,'meetingroom','batchcreate','批量新建','batch','different','override','normal','menu','','direct',0,0,'','','','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(117,'meetingroom','batchedit','批量编辑','batch','different','override','normal','browse','','direct',0,0,'','','','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(118,'meetingroom','link','关联数据','single','same','override','none','view','','direct',0,0,'','','','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(119,'meetingroom','unlink','移除数据','single','same','override','none','view','','direct',0,0,'','','','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(120,'meetingroom','exporttemplate','下载模板','single','same','override','none','menu','','direct',0,0,'','','','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(121,'meetingroom','import','导入数据','single','same','override','none','menu','','direct',0,0,'','','','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(122,'meetingroom','showimport','导入确认','single','same','override','none','menu','','direct',0,0,'','','','','','','','','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00');
INSERT INTO `sys_workflowdatasource` VALUES (1,'system','订单','{\"app\":\"crm\",\"module\":\"order\",\"method\":\"getPairs\",\"methodDesc\":\"Get order pairs.\",\"params\":[{\"name\":\"customer\",\"type\":\"int\",\"desc\":\"\",\"value\":\"0\"},{\"name\":\"status\",\"type\":\"string\",\"desc\":\"\",\"value\":\"\"}]}','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(2,'system','合同','{\"app\":\"crm\",\"module\":\"contract\",\"method\":\"getPairs\",\"methodDesc\":\"Get contract pairs.\",\"params\":[{\"name\":\"customerID\",\"type\":\"int\",\"desc\":\"\",\"value\":\"0\"}]}','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(3,'system','客户','{\"app\":\"crm\",\"module\":\"customer\",\"method\":\"getPairs\",\"methodDesc\":\"Get customer pairs.\",\"params\":[{\"name\":\"relation\",\"type\":\"string\",\"desc\":\"\",\"value\":\"customer\"},{\"name\":\"emptyOption\",\"type\":\"bool\",\"desc\":\"\",\"value\":\"1\"}]}','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(4,'system','供应商','{\"app\":\"crm\",\"module\":\"customer\",\"method\":\"getPairs\",\"methodDesc\":\"Get customer pairs.\",\"params\":[{\"name\":\"relation\",\"type\":\"string\",\"desc\":\"\",\"value\":\"provider\"},{\"name\":\"emptyOption\",\"type\":\"bool\",\"desc\":\"\",\"value\":\"1\"}]}','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(5,'system','联系人','{\"app\":\"crm\",\"module\":\"contact\",\"method\":\"getPairs\",\"methodDesc\":\"Get common selecter of contact.\",\"params\":[{\"name\":\"customer\",\"type\":\"int\",\"desc\":\"\",\"value\":\"0\"},{\"name\":\"emptyOption\",\"type\":\"bool\",\"desc\":\"\",\"value\":\"1\"},{\"name\":\"status\",\"type\":\"string\",\"desc\":\"\",\"value\":\"normal\"}]}','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(6,'system','产品','{\"app\":\"crm\",\"module\":\"product\",\"method\":\"getPairs\",\"methodDesc\":\"Get product pairs.\",\"params\":[{\"name\":\"status\",\"type\":\"string\",\"desc\":\"\",\"value\":\"\"},{\"name\":\"orderBy\",\"type\":\"string\",\"desc\":\"\",\"value\":\"id_desc\"}]}','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(7,'sql','会议室','select id, name from flow_meetingroom where deleted = \'0\'','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(8,'option','设备','{\"computer\":\"\\u7535\\u8111\",\"projector\":\"\\u6295\\u5f71\\u4eea\",\"micphone\":\"\\u9ea6\\u514b\\u98ce\",\"audio\":\"\\u97f3\\u54cd\",\"whiteboard\":\"\\u767d\\u677f\"}','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(9,'option','工作日','{\"1\":\"\\u5468\\u4e00\",\"2\":\"\\u5468\\u4e8c\",\"3\":\"\\u5468\\u4e09\",\"4\":\"\\u5468\\u56db\",\"5\":\"\\u5468\\u4e94\",\"6\":\"\\u5468\\u516d\",\"7\":\"\\u5468\\u65e5\"}','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(10,'system','账号','{\"app\":\"cash\",\"module\":\"depositor\",\"method\":\"getPairs\",\"methodDesc\":\"Get depositor option menu.\",\"params\":[]}','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(11,'system','支出科目','{\"app\":\"sys\",\"module\":\"tree\",\"method\":\"getPairs\",\"methodDesc\":\"Get the id => name pairs of some categories.\",\"params\":[{\"name\":\"categories\",\"type\":\"string\",\"desc\":\"the category lists\",\"value\":\"\"},{\"name\":\"type\",\"type\":\"string\",\"desc\":\"the type\",\"value\":\"out\"}]}','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00');
INSERT INTO `sys_workflowfield` VALUES (1,'meetingroom','id','mediumint','8','编号','label','[]','','2','','1','1','1','0',1,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(2,'meetingroom','parent','mediumint','8','父流程ID','label','[]','0','','','1','1','0','0',9,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(3,'meetingroom','createdBy','varchar','30','由谁创建','select','user','','','','1','1','0','0',11,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(4,'meetingroom','createdDate','datetime','','创建日期','datetime','[]','','','','1','1','0','0',12,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(5,'meetingroom','editedBy','varchar','30','由谁编辑','select','user','','','','1','1','0','0',13,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(6,'meetingroom','editedDate','datetime','','编辑日期','datetime','[]','','','','1','1','0','0',20,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(7,'meetingroom','deleted','varchar','200','是否删除','radio','[\"\\u672a\\u5220\\u9664\",\"\\u5df2\\u5220\\u9664\"]','0','','','1','0','0','0',21,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(8,'meetingroom','name','varchar','200','名称','input','[]','','1','','1','1','0','1',3,0,'','0','admin','2020-07-09 21:05:50','admin','2016-11-23 11:14:10'),(9,'meetingroom','position','varchar','200','位置','select','{\"1\":\"\\u4e00\\u697c\",\"2\":\"\\u4e8c\\u697c\",\"3\":\"\\u4e09\\u697c\",\"4\":\"\\u56db\\u697c\",\"5\":\"\\u4e94\\u697c\"}','','1','','1','1','0','0',4,0,'','0','admin','2020-07-09 21:05:50','admin','2016-11-23 10:24:40'),(10,'meetingroom','seats','int','200','容纳人数','input','[]','','1','','1','1','0','0',5,0,'','0','admin','2020-07-09 21:05:50','admin','2018-08-13 10:05:40'),(11,'meetingroom','equipment','varchar','200','设备','checkbox','8','','1','','1','1','0','0',6,0,'','0','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(12,'meetingroom','workday','varchar','200','开放时间','checkbox','9','','1','','1','1','0','0',7,0,'','0','admin','2020-07-09 21:05:50','admin','2016-11-23 10:39:48'),(13,'meetingroombooking','id','mediumint','8','编号','label','[]','','2','','1','1','1','0',13,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(14,'meetingroombooking','parent','mediumint','8','父流程ID','label','[]','0','','','1','1','0','0',20,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(15,'meetingroombooking','createdBy','varchar','30','由谁创建','select','user','','','','1','1','0','0',21,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(16,'meetingroombooking','createdDate','datetime','','创建日期','datetime','[]','','','','1','1','0','0',22,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(17,'meetingroombooking','editedBy','varchar','30','由谁编辑','select','user','','','','1','1','0','0',23,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(18,'meetingroombooking','editedDate','datetime','','编辑日期','datetime','[]','','','','1','1','0','0',24,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(19,'meetingroombooking','deleted','varchar','200','是否删除','radio','[\"\\u672a\\u5220\\u9664\",\"\\u5df2\\u5220\\u9664\"]','0','','','1','0','0','0',25,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(20,'meetingroombooking','room','varchar','200','会议室','select','prevModule','','1','','1','1','0','0',14,0,'','0','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(21,'meetingroombooking','begin','datetime','','开始时间','datetime','[]','','1,3','','1','1','0','0',15,0,'','0','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(22,'meetingroombooking','end','datetime','','结束时间','datetime','[]','','1,3','','1','1','0','0',16,0,'','0','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(23,'meetingroombooking','orderedBy','varchar','30','由谁预订','select','user','','1','','1','1','0','0',17,0,'','0','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(24,'meetingroombooking','orderedDate','datetime','','预订时间','datetime','[]','','1,3','','1','1','0','0',18,0,'','0','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(25,'meetingroombooking','desc','varchar','200','描述','input','[]','','','','1','1','0','0',19,0,'','0','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(26,'stamp','id','mediumint','8','编号','label','[]','','2','','1','1','1','0',26,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(27,'stamp','parent','mediumint','8','父流程ID','label','[]','0','','','1','1','0','0',36,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(28,'stamp','createdBy','varchar','30','由谁创建','select','user','','','','1','1','0','0',37,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(29,'stamp','createdDate','datetime','','创建日期','datetime','[]','','','','1','1','0','0',38,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(30,'stamp','editedBy','varchar','30','由谁编辑','select','user','','','','1','1','0','0',39,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(31,'stamp','editedDate','datetime','','编辑日期','datetime','[]','','','','1','1','0','0',40,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(32,'stamp','deleted','varchar','200','是否删除','radio','[\"\\u672a\\u5220\\u9664\",\"\\u5df2\\u5220\\u9664\"]','0','','','1','0','0','0',41,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(33,'stamp','proposer','varchar','30','申请人','select','user','','1','','1','1','0','0',27,0,'','0','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(34,'stamp','reason','varchar','200','申请事由','input','[]','','1','','1','1','0','0',28,0,'','0','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(35,'stamp','begin','datetime','','开始时间','datetime','[]','','1','','1','1','0','0',29,0,'','0','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(36,'stamp','end','datetime','','结束时间','datetime','[]','','1','','1','1','0','0',30,0,'','0','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(37,'stamp','type','varchar','200','印章类型','checkbox','{\"1\":\"\\u516c\\u7ae0\",\"2\":\"\\u6cd5\\u4eba\\u7ae0\",\"3\":\"\\u5408\\u540c\\u7ae0\",\"4\":\"\\u8d22\\u52a1\\u7ae0\"}','','1','','1','1','0','0',31,0,'','0','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(38,'stamp','desc','varchar','200','备注','input','[]','','','','1','1','0','0',32,0,'','0','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(39,'stamp','status','varchar','200','状态','select','{\"draft\":\"\\u8349\\u7a3f\",\"wait\":\"\\u5f85\\u5ba1\\u6279\",\"pass\":\"\\u901a\\u8fc7\",\"reject\":\"\\u62d2\\u7edd\"}','wait','1','','1','1','0','0',33,0,'','0','admin','2020-07-09 21:05:50','admin','2016-11-23 11:25:25'),(40,'stamp','reviewedBy','varchar','30','审批人','select','user','','1','','1','1','0','0',34,0,'','0','admin','2020-07-09 21:05:50','admin','2016-11-23 11:23:27'),(41,'stamp','reviewedDate','datetime','','审批时间','datetime','[]','','1','','1','1','0','0',35,0,'','0','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(42,'car','id','mediumint','8','编号','label','[]','','2','','1','1','1','0',42,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(43,'car','parent','mediumint','8','父流程ID','label','[]','0','','','1','1','0','0',50,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(44,'car','createdBy','varchar','30','由谁创建','select','user','','','','1','1','0','0',51,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(45,'car','createdDate','datetime','','创建日期','datetime','[]','','','','1','1','0','0',52,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(46,'car','editedBy','varchar','30','由谁编辑','select','user','','','','1','1','0','0',53,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(47,'car','editedDate','datetime','','编辑日期','datetime','[]','','','','1','1','0','0',54,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(48,'car','deleted','varchar','200','是否删除','radio','[\"\\u672a\\u5220\\u9664\",\"\\u5df2\\u5220\\u9664\"]','0','','','1','0','0','0',55,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(49,'car','type','varchar','200','车辆类型','select','{\"audi\":\"\\u5965\\u8fea\",\"benz\":\"\\u5954\\u9a70\",\"vw\":\"\\u5927\\u4f17\"}','','1','','1','1','0','0',43,0,'','0','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(50,'car','code','varchar','200','车牌号','input','[]','','1','','1','1','0','1',44,0,'','0','admin','2020-07-09 21:05:50','admin','2016-11-23 13:40:14'),(51,'car','driver','varchar','30','司机','select','user','','','','1','1','0','0',45,0,'','0','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(52,'car','mobile','varchar','200','手机','input','[]','','5','','1','1','0','0',46,0,'','0','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(53,'car','buyDate','date','','购买日期','date','[]','','3','','1','1','0','0',47,0,'','0','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(54,'car','price','decimal','12,0','价格','input','[]','','','','1','1','0','0',48,0,'','0','admin','2020-07-09 21:05:50','admin','2018-08-13 10:04:51'),(55,'car','status','varchar','200','状态','select','{\"normal\":\"\\u6b63\\u5e38\",\"repairing\":\"\\u7ef4\\u4fee\\u4e2d\",\"broken\":\"\\u635f\\u574f\",\"scrapped\":\"\\u62a5\\u5e9f\"}','normal','1','','1','1','0','0',49,0,'','0','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(56,'carbooking','id','mediumint','8','编号','label','[]','','2','','1','1','1','0',56,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(57,'carbooking','parent','mediumint','8','父流程ID','label','[]','0','','','1','1','0','0',66,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(58,'carbooking','createdBy','varchar','30','由谁创建','select','user','','','','1','1','0','0',67,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(59,'carbooking','createdDate','datetime','','创建日期','datetime','[]','','','','1','1','0','0',68,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(60,'carbooking','editedBy','varchar','30','由谁编辑','select','user','','','','1','1','0','0',69,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(61,'carbooking','editedDate','datetime','','编辑日期','datetime','[]','','','','1','1','0','0',70,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(62,'carbooking','deleted','varchar','200','是否删除','radio','[\"\\u672a\\u5220\\u9664\",\"\\u5df2\\u5220\\u9664\"]','0','','','1','0','0','0',71,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(63,'carbooking','appliedBy','varchar','30','申请人','select','user','','1','','1','1','0','0',57,0,'','0','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(64,'carbooking','appliedDate','datetime','','申请时间','datetime','[]','','1,3','','1','1','0','0',58,0,'','0','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(65,'carbooking','car','varchar','200','车辆','select','prevModule','','1','','1','1','0','0',59,0,'','0','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(66,'carbooking','begin','datetime','','开始时间','datetime','[]','','1,3','','1','1','0','0',60,0,'','0','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(67,'carbooking','end','datetime','','结束时间','datetime','[]','','1,3','','1','1','0','0',61,0,'','0','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(68,'carbooking','reason','varchar','200','理由','input','[]','','','','1','1','0','0',62,0,'','0','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(69,'carbooking','status','varchar','200','状态','select','{\"wait\":\"\\u7b49\\u5f85\\u5ba1\\u6838\",\"pass\":\"\\u901a\\u8fc7\",\"reject\":\"\\u62d2\\u7edd\"}','wait','1','','1','1','0','0',63,0,'','0','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(70,'carbooking','reviewedBy','varchar','30','审核人','select','user','','','','1','1','0','0',64,0,'','0','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(71,'carbooking','reviewedDate','datetime','','审核时间','datetime','[]','','3','','1','1','0','0',65,0,'','0','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(72,'collect','id','mediumint','8','编号','label','[]','','2','','1','1','1','0',72,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(73,'collect','parent','mediumint','8','父流程ID','label','[]','0','','','1','1','0','0',82,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(74,'collect','createdBy','varchar','30','由谁创建','select','user','','','','1','1','0','0',83,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(75,'collect','createdDate','datetime','','创建日期','datetime','[]','','','','1','1','0','0',84,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(76,'collect','editedBy','varchar','30','由谁编辑','select','user','','','','1','1','0','0',85,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(77,'collect','editedDate','datetime','','编辑日期','datetime','[]','','','','1','1','0','0',86,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(78,'collect','deleted','varchar','200','是否删除','radio','[\"\\u672a\\u5220\\u9664\",\"\\u5df2\\u5220\\u9664\"]','0','','','1','0','0','0',87,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(79,'collect','appliedBy','varchar','30','申请人','select','user','','1','','1','1','0','0',73,0,'','0','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(80,'collect','appliedDate','datetime','','申请时间','datetime','[]','','1,3','','1','1','0','0',74,0,'','0','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(81,'collect','money','decimal','12,0','金额','input','[]','','1','','1','1','0','0',75,0,'','0','admin','2020-07-09 21:05:50','admin','2018-08-13 10:04:16'),(82,'collect','reason','varchar','200','用途','input','[]','','','','1','1','0','0',76,0,'','0','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(83,'collect','status','varchar','200','状态','select','{\"wait\":\"\\u7b49\\u5f85\\u5ba1\\u6838\",\"pass\":\"\\u901a\\u8fc7\",\"reject\":\"\\u62d2\\u7edd\",\"closed\":\"\\u5df2\\u5b8c\\u6210\"}','wait','','','1','1','0','0',77,0,'','0','admin','2020-07-09 21:05:50','admin','2016-11-23 13:52:21'),(84,'collect','reviewedBy','varchar','30','由谁审核','select','user','','','','1','1','0','0',78,0,'','0','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(85,'collect','reviewedDate','datetime','','审核时间','datetime','[]','','3','','1','1','0','0',79,0,'','0','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(86,'collect','depositor','varchar','200','付款账号','select','10','','1','','1','1','0','0',80,0,'','0','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(87,'collect','category','varchar','200','支出科目','select','11','','1','','1','1','0','0',81,0,'','0','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(88,'buy','id','mediumint','8','编号','label','[]','','2','','1','1','1','0',88,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(89,'buy','parent','mediumint','8','父流程ID','label','[]','0','','','1','1','0','0',96,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(90,'buy','createdBy','varchar','30','由谁创建','select','user','','','','1','1','0','0',97,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(91,'buy','createdDate','datetime','','创建日期','datetime','[]','','','','1','1','0','0',98,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(92,'buy','editedBy','varchar','30','由谁编辑','select','user','','','','1','1','0','0',99,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(93,'buy','editedDate','datetime','','编辑日期','datetime','[]','','','','1','1','0','0',100,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(94,'buy','deleted','varchar','200','是否删除','radio','[\"\\u672a\\u5220\\u9664\",\"\\u5df2\\u5220\\u9664\"]','0','','','1','0','0','0',101,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(95,'buy','provider','varchar','200','供应商','select','4','','1','','1','1','0','0',89,0,'','0','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(96,'buy','goods','varchar','200','商品','input','[]','','1','','1','1','0','0',90,0,'','0','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(97,'buy','money','decimal','12,0','金额','input','[]','','1','','1','1','0','0',91,0,'','0','admin','2020-07-09 21:05:50','admin','2018-08-13 10:03:37'),(98,'buy','desc','varchar','200','备注','input','[]','','','','1','1','0','0',92,0,'','0','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(99,'buy','status','varchar','200','状态','select','{\"unpaid\":\"\\u672a\\u652f\\u4ed8\",\"paid\":\"\\u5df2\\u652f\\u4ed8\"}','','','','1','1','0','0',93,0,'','0','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(100,'buy','depositor','varchar','200','付款账号','select','10','','1','','1','1','0','0',94,0,'','0','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(101,'buy','category','varchar','200','支出科目','select','11','','1','','1','1','0','0',95,0,'','0','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(102,'purchasing','id','mediumint','8','编号','label','[]','','2','','1','1','1','0',102,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(103,'purchasing','parent','mediumint','8','父流程ID','label','[]','0','','','1','1','0','0',109,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(104,'purchasing','createdBy','varchar','30','由谁创建','select','user','','','','1','1','0','0',110,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(105,'purchasing','createdDate','datetime','','创建日期','datetime','[]','','','','1','1','0','0',111,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(106,'purchasing','editedBy','varchar','30','由谁编辑','select','user','','','','1','1','0','0',112,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(107,'purchasing','editedDate','datetime','','编辑日期','datetime','[]','','','','1','1','0','0',113,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(108,'purchasing','deleted','enum(\'0\',\'1\')','','是否删除','radio','[\"\\u672a\\u5220\\u9664\",\"\\u5df2\\u5220\\u9664\"]','0','','','1','0','0','0',114,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(109,'purchasing','provider','mediumint','150','供应商','select','4','','','','1','1','0','0',103,0,'','0','admin','2020-07-09 21:05:50','admin','2019-03-28 14:14:26'),(110,'purchasing','money','decimal','12,2','金额','input','[]','','1','','1','1','0','0',104,0,'','0','admin','2020-07-09 21:05:50','admin','2019-03-28 14:16:01'),(111,'purchasing','purchasedby','varchar','30','由谁采购','select','user','','1','','1','1','0','0',105,0,'','0','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(112,'purchasing','purchaseddate','datetime','0','采购时间','datetime','[]','','','','1','1','0','0',106,0,'','0','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(113,'purchasing','status','char','30','状态','select','{\"wait\":\"\\u5f85\\u5ba1\\u6279\",\"pass\":\"\\u5df2\\u901a\\u8fc7\",\"reject\":\"\\u5df2\\u62d2\\u7edd\",\"finished\":\"\\u5df2\\u5b8c\\u6210\"}','wait','','','1','1','0','0',107,0,'','0','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(114,'purchasing','desc','text','0','描述','input','[]','','','','1','1','0','0',108,0,'','0','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(115,'purchasegood','id','mediumint','8','编号','label','[]','','2','','1','1','1','0',115,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(116,'purchasegood','parent','mediumint','8','主表编号','label','[]','0','','','1','1','0','0',121,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(117,'purchasegood','createdBy','varchar','30','由谁创建','select','user','','','','1','1','0','0',122,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(118,'purchasegood','createdDate','datetime','','创建日期','datetime','[]','','','','1','1','0','0',123,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(119,'purchasegood','editedBy','varchar','30','由谁编辑','select','user','','','','1','1','0','0',124,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(120,'purchasegood','editedDate','datetime','','编辑日期','datetime','[]','','','','1','1','0','0',125,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(121,'purchasegood','deleted','enum(\'0\',\'1\')','','是否删除','radio','[\"\\u672a\\u5220\\u9664\",\"\\u5df2\\u5220\\u9664\"]','0','','','1','0','0','0',126,0,'','1','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(123,'purchasegood','product','varchar','200','商品','input','[]','','1','','1','1','0','0',116,0,'','0','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(124,'purchasegood','unit','char','20','单位','input','[]','','','','1','1','0','0',117,0,'','0','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(125,'purchasegood','price','decimal','12,2','单价','input','[]','','','','1','1','0','0',118,0,'','0','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(126,'purchasegood','amount','decimal','12,2','数量','input','[]','','','','1','1','0','0',119,0,'','0','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(127,'purchasegood','money','decimal','12,2','金额','input','[]','','','','1','1','0','0',120,0,'','0','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00');
INSERT INTO `sys_workflowlabel` VALUES (1,'meetingroom','label1','所有会议室','[{\"field\":\"deleted\",\"operator\":\"equal\",\"value\":\"0\"}]',0,0,'admin','2020-07-09 21:05:50','admin','2016-11-23 10:48:04'),(2,'meetingroombooking','label2','所有预订','[{\"field\":\"deleted\",\"operator\":\"equal\",\"value\":\"0\"}]',0,0,'admin','2020-07-09 21:05:50','admin','2016-11-23 11:07:32'),(3,'meetingroom','label3','一楼会议室','[{\"field\":\"position\",\"operator\":\"equal\",\"value\":\"1\"}]',0,0,'admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(4,'meetingroom','label4','二楼会议室','[{\"field\":\"position\",\"operator\":\"equal\",\"value\":\"2\"}]',0,0,'admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(5,'meetingroom','label5','三楼会议室','[{\"field\":\"position\",\"operator\":\"equal\",\"value\":\"3\"}]',0,0,'admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(6,'meetingroombooking','label6','我的预订','[{\"field\":\"orderedBy\",\"operator\":\"equal\",\"value\":\"currentUser\"}]',0,0,'admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(7,'stamp','label7','所有','[{\"field\":\"deleted\",\"operator\":\"equal\",\"value\":\"0\"}]',0,0,'admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(8,'car','label8','车辆列表','[{\"field\":\"deleted\",\"operator\":\"equal\",\"value\":\"0\"}]',0,0,'admin','2020-07-09 21:05:50','admin','2016-11-23 13:28:10'),(9,'carbooking','label9','所有预订','[{\"field\":\"deleted\",\"operator\":\"equal\",\"value\":\"0\"}]',0,0,'admin','2020-07-09 21:05:50','admin','2016-11-23 13:29:07'),(10,'stamp','label10','我的申请','[{\"field\":\"proposer\",\"operator\":\"equal\",\"value\":\"currentUser\"},{\"field\":\"deleted\",\"operator\":\"equal\",\"value\":\"0\"}]',0,0,'admin','2020-07-09 21:05:50','admin','2016-11-23 13:27:26'),(11,'stamp','label11','我的审核','[{\"field\":\"status\",\"operator\":\"equal\",\"value\":\"wait\"},{\"field\":\"deleted\",\"operator\":\"equal\",\"value\":\"0\"}]',0,0,'admin','2020-07-09 21:05:50','admin','2016-11-24 13:56:12'),(12,'carbooking','label12','我的预订','[{\"field\":\"deleted\",\"operator\":\"equal\",\"value\":\"0\"},{\"field\":\"appliedBy\",\"operator\":\"equal\",\"value\":\"currentUser\"}]',0,0,'admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(13,'carbooking','label13','我的审核','[{\"field\":\"deleted\",\"operator\":\"equal\",\"value\":\"0\"},{\"field\":\"status\",\"operator\":\"equal\",\"value\":\"wait\"}]',0,0,'admin','2020-07-09 21:05:50','admin','2016-11-24 13:56:46'),(14,'collect','label14','所有','[{\"field\":\"deleted\",\"operator\":\"equal\",\"value\":\"0\"}]',0,0,'admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(15,'collect','label15','我的请款','[{\"field\":\"appliedBy\",\"operator\":\"equal\",\"value\":\"currentUser\"},{\"field\":\"deleted\",\"operator\":\"equal\",\"value\":\"0\"}]',0,0,'admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(16,'collect','label16','我的审核','[{\"field\":\"status\",\"operator\":\"equal\",\"value\":\"wait\"},{\"field\":\"deleted\",\"operator\":\"equal\",\"value\":\"0\"}]',0,0,'admin','2020-07-09 21:05:50','admin','2016-11-24 14:02:10'),(17,'collect','label17','待付款','[{\"field\":\"status\",\"operator\":\"equal\",\"value\":\"pass\"},{\"field\":\"deleted\",\"operator\":\"equal\",\"value\":\"0\"}]',0,0,'admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(18,'buy','label18','所有','[{\"field\":\"deleted\",\"operator\":\"equal\",\"value\":\"0\"}]',0,0,'admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(19,'buy','label19','待付款','[{\"field\":\"status\",\"operator\":\"equal\",\"value\":\"unpaid\"},{\"field\":\"deleted\",\"operator\":\"equal\",\"value\":\"0\"}]',0,0,'admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(20,'buy','label20','已付款','[{\"field\":\"status\",\"operator\":\"equal\",\"value\":\"paid\"},{\"field\":\"deleted\",\"operator\":\"equal\",\"value\":\"0\"}]',0,0,'admin','2020-07-09 21:05:50','admin','2016-11-23 14:22:20'),(21,'purchasing','label21','所有','[{\"field\":\"deleted\",\"operator\":\"equal\",\"value\":\"0\"}]',0,0,'admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(22,'purchasegood','label22','所有','[{\"field\":\"deleted\",\"operator\":\"equal\",\"value\":\"0\"}]',0,0,'admin','2020-07-09 21:05:50','','0000-00-00 00:00:00');
INSERT INTO `sys_workflowlayout` VALUES (679,'meetingroom','browse','actions',7,220,'','0','0','0','',''),(678,'meetingroom','browse','workday',6,0,'left','0','0','0','',''),(677,'meetingroom','browse','equipment',5,0,'left','0','0','0','',''),(675,'meetingroom','browse','position',3,0,'left','0','0','0','',''),(676,'meetingroom','browse','seats',4,0,'left','0','0','0','',''),(10,'meetingroom','create','name',1,0,'','0','0','0','',''),(11,'meetingroom','create','position',2,0,'','0','0','0','',''),(12,'meetingroom','create','seats',3,0,'','0','0','0','',''),(13,'meetingroom','create','equipment',4,0,'','0','0','0','',''),(14,'meetingroom','create','workday',5,0,'','0','0','0','',''),(15,'meetingroom','edit','name',1,0,'','0','0','0','',''),(16,'meetingroom','edit','position',2,0,'','0','0','0','',''),(17,'meetingroom','edit','seats',3,0,'','0','0','0','',''),(18,'meetingroom','edit','equipment',4,0,'','0','0','0','',''),(19,'meetingroom','edit','workday',5,0,'','0','0','0','',''),(20,'meetingroom','view','id',1,0,'basic','0','0','0','',''),(21,'meetingroom','view','name',2,0,'basic','0','0','0','',''),(22,'meetingroom','view','position',3,0,'basic','0','0','0','',''),(23,'meetingroom','view','seats',4,0,'basic','0','0','0','',''),(24,'meetingroom','view','equipment',5,0,'basic','0','0','0','',''),(25,'meetingroom','view','workday',6,0,'basic','0','0','0','',''),(26,'meetingroom','view','createdBy',7,0,'basic','0','0','0','',''),(27,'meetingroom','view','createdDate',8,0,'basic','0','0','0','',''),(28,'meetingroom','view','editedBy',9,0,'basic','0','0','0','',''),(29,'meetingroom','view','editedDate',10,0,'basic','0','0','0','',''),(30,'meetingroombooking','browse','id',1,0,'left','0','0','0','',''),(31,'meetingroombooking','browse','room',2,0,'left','0','0','0','',''),(32,'meetingroombooking','browse','begin',3,0,'left','0','0','0','',''),(33,'meetingroombooking','browse','end',4,0,'left','0','0','0','',''),(34,'meetingroombooking','browse','orderedBy',5,0,'left','0','0','0','',''),(35,'meetingroombooking','browse','orderedDate',6,0,'left','0','0','0','',''),(36,'meetingroombooking','browse','desc',7,0,'left','0','0','0','',''),(37,'meetingroombooking','browse','actions',8,120,'','0','0','0','',''),(47,'meetingroombooking','create','orderedBy',4,0,'','0','0','0','currentUser',''),(46,'meetingroombooking','create','end',3,0,'','0','0','0','',''),(45,'meetingroombooking','create','begin',2,0,'','0','0','0','',''),(44,'meetingroombooking','create','room',1,0,'','0','0','0','',''),(48,'meetingroombooking','create','orderedDate',5,0,'','0','0','0','currentTime',''),(49,'meetingroombooking','create','desc',6,0,'','0','0','0','',''),(50,'meetingroombooking','edit','room',1,0,'','0','0','0','',''),(51,'meetingroombooking','edit','begin',2,0,'','0','0','0','',''),(52,'meetingroombooking','edit','end',3,0,'','0','0','0','',''),(53,'meetingroombooking','edit','orderedBy',4,0,'','0','0','0','currentUser',''),(54,'meetingroombooking','edit','orderedDate',5,0,'','0','0','0','currentTime',''),(55,'meetingroombooking','edit','desc',6,0,'','0','0','0','',''),(74,'meetingroombooking','view','createdDate',8,0,'basic','0','0','0','',''),(73,'meetingroombooking','view','createdBy',7,0,'basic','0','0','0','',''),(72,'meetingroombooking','view','orderedDate',6,0,'basic','0','0','0','',''),(71,'meetingroombooking','view','orderedBy',5,0,'basic','0','0','0','',''),(70,'meetingroombooking','view','end',4,0,'basic','0','0','0','',''),(69,'meetingroombooking','view','begin',3,0,'basic','0','0','0','',''),(68,'meetingroombooking','view','room',2,0,'basic','0','0','0','',''),(67,'meetingroombooking','view','id',1,0,'basic','0','0','0','',''),(75,'meetingroombooking','view','editedBy',9,0,'basic','0','0','0','',''),(76,'meetingroombooking','view','editedDate',10,0,'basic','0','0','0','',''),(77,'meetingroombooking','view','desc',11,0,'info','0','0','0','',''),(673,'meetingroom','browse','id',1,0,'left','0','0','0','',''),(674,'meetingroom','browse','name',2,0,'left','0','0','0','',''),(87,'stamp','browse','id',1,0,'left','0','0','0','',''),(88,'stamp','browse','proposer',2,0,'left','0','0','0','',''),(89,'stamp','browse','reason',3,0,'left','0','0','0','',''),(90,'stamp','browse','begin',4,0,'left','0','0','0','',''),(91,'stamp','browse','end',5,0,'left','0','0','0','',''),(92,'stamp','browse','type',6,0,'left','0','0','0','',''),(93,'stamp','browse','desc',7,0,'left','0','0','0','',''),(94,'stamp','browse','status',8,0,'left','0','0','0','',''),(95,'stamp','browse','reviewedBy',9,0,'left','0','0','0','',''),(96,'stamp','browse','reviewedDate',10,0,'left','0','0','0','',''),(97,'stamp','browse','actions',11,120,'','0','0','0','',''),(98,'stamp','create','proposer',1,0,'','0','0','0','currentUser',''),(99,'stamp','create','reason',2,0,'','0','0','0','',''),(100,'stamp','create','begin',3,0,'','0','0','0','',''),(101,'stamp','create','end',4,0,'','0','0','0','',''),(102,'stamp','create','type',5,0,'','0','0','0','',''),(103,'stamp','create','desc',6,0,'','0','0','0','',''),(113,'stamp','edit','end',4,0,'','0','0','0','',''),(112,'stamp','edit','begin',3,0,'','0','0','0','',''),(111,'stamp','edit','reason',2,0,'','0','0','0','',''),(110,'stamp','edit','proposer',1,0,'','0','0','0','currentUser',''),(114,'stamp','edit','type',5,0,'','0','0','0','',''),(115,'stamp','edit','desc',6,0,'','0','0','0','',''),(116,'stamp','view','id',1,0,'basic','0','0','0','',''),(117,'stamp','view','proposer',2,0,'basic','0','0','0','',''),(118,'stamp','view','reason',3,0,'info','0','0','0','',''),(119,'stamp','view','begin',4,0,'basic','0','0','0','',''),(120,'stamp','view','end',5,0,'basic','0','0','0','',''),(121,'stamp','view','type',6,0,'basic','0','0','0','',''),(122,'stamp','view','desc',7,0,'info','0','0','0','',''),(123,'stamp','view','status',8,0,'basic','0','0','0','',''),(124,'stamp','view','reviewedBy',9,0,'basic','0','0','0','',''),(125,'stamp','view','reviewedDate',10,0,'basic','0','0','0','',''),(126,'stamp','view','createdBy',11,0,'basic','0','0','0','',''),(127,'stamp','view','createdDate',12,0,'basic','0','0','0','',''),(128,'stamp','view','editedBy',13,0,'basic','0','0','0','',''),(129,'stamp','view','editedDate',14,0,'basic','0','0','0','',''),(779,'car','browse','id',1,0,'left','0','0','0','',''),(780,'car','browse','type',2,0,'left','0','0','0','',''),(781,'car','browse','code',3,0,'left','0','0','0','',''),(782,'car','browse','driver',4,0,'left','0','0','0','',''),(783,'car','browse','mobile',5,0,'left','0','0','0','',''),(784,'car','browse','buyDate',6,0,'left','0','0','0','',''),(139,'car','create','type',1,0,'','0','0','0','',''),(140,'car','create','code',2,0,'','0','0','0','',''),(141,'car','create','driver',3,0,'','0','0','0','',''),(142,'car','create','mobile',4,0,'','0','0','0','',''),(143,'car','create','buyDate',5,0,'','0','0','0','',''),(144,'car','create','price',6,0,'','0','0','0','',''),(145,'car','create','status',7,0,'','0','0','0','',''),(146,'car','edit','type',1,0,'','0','0','0','',''),(147,'car','edit','code',2,0,'','0','0','0','',''),(148,'car','edit','driver',3,0,'','0','0','0','',''),(149,'car','edit','mobile',4,0,'','0','0','0','',''),(150,'car','edit','buyDate',5,0,'','0','0','0','',''),(151,'car','edit','price',6,0,'','0','0','0','',''),(152,'car','edit','status',7,0,'','0','0','0','',''),(153,'car','view','id',1,0,'basic','0','0','0','',''),(154,'car','view','type',2,0,'basic','0','0','0','',''),(155,'car','view','code',3,0,'basic','0','0','0','',''),(156,'car','view','driver',4,0,'basic','0','0','0','',''),(157,'car','view','mobile',5,0,'basic','0','0','0','',''),(158,'car','view','buyDate',6,0,'basic','0','0','0','',''),(159,'car','view','price',7,0,'basic','0','0','0','',''),(160,'car','view','status',8,0,'basic','0','0','0','',''),(161,'car','view','createdBy',9,0,'basic','0','0','0','',''),(162,'car','view','createdDate',10,0,'basic','0','0','0','',''),(163,'car','view','editedBy',11,0,'basic','0','0','0','',''),(164,'car','view','editedDate',12,0,'basic','0','0','0','',''),(236,'carbooking','browse','reviewedBy',9,0,'left','0','0','0','',''),(235,'carbooking','browse','appliedDate',8,0,'left','0','0','0','',''),(234,'carbooking','browse','status',7,0,'left','0','0','0','',''),(233,'carbooking','browse','reason',6,0,'left','0','0','0','',''),(232,'carbooking','browse','end',5,0,'left','0','0','0','',''),(231,'carbooking','browse','begin',4,0,'left','0','0','0','',''),(230,'carbooking','browse','car',3,0,'left','0','0','0','',''),(183,'carbooking','create','appliedDate',2,0,'','0','0','0','currentTime',''),(182,'carbooking','create','appliedBy',1,0,'','0','0','0','currentUser',''),(184,'carbooking','create','car',3,0,'','0','0','0','',''),(185,'carbooking','create','begin',4,0,'','0','0','0','',''),(186,'carbooking','create','end',5,0,'','0','0','0','',''),(187,'carbooking','create','reason',6,0,'','0','0','0','',''),(188,'carbooking','edit','appliedBy',1,0,'','0','0','0','currentUser',''),(189,'carbooking','edit','appliedDate',2,0,'','0','0','0','currentTime',''),(190,'carbooking','edit','car',3,0,'','0','0','0','',''),(191,'carbooking','edit','begin',4,0,'','0','0','0','',''),(192,'carbooking','edit','end',5,0,'','0','0','0','',''),(193,'carbooking','edit','reason',6,0,'','0','0','0','',''),(194,'carbooking','view','id',1,0,'basic','0','0','0','',''),(195,'carbooking','view','appliedBy',2,0,'basic','0','0','0','',''),(196,'carbooking','view','appliedDate',3,0,'basic','0','0','0','',''),(197,'carbooking','view','car',4,0,'basic','0','0','0','',''),(198,'carbooking','view','begin',5,0,'basic','0','0','0','',''),(199,'carbooking','view','end',6,0,'basic','0','0','0','',''),(200,'carbooking','view','reason',7,0,'info','0','0','0','',''),(201,'carbooking','view','status',8,0,'basic','0','0','0','',''),(202,'carbooking','view','reviewedBy',9,0,'basic','0','0','0','',''),(203,'carbooking','view','reviewedDate',10,0,'basic','0','0','0','',''),(204,'carbooking','view','createdBy',11,0,'basic','0','0','0','',''),(205,'carbooking','view','createdDate',12,0,'basic','0','0','0','',''),(206,'carbooking','view','editedBy',13,0,'basic','0','0','0','',''),(207,'carbooking','view','editedDate',14,0,'basic','0','0','0','',''),(787,'car','browse','actions',9,220,'','0','0','0','',''),(237,'carbooking','browse','reviewedDate',10,0,'left','0','0','0','',''),(229,'carbooking','browse','appliedBy',2,0,'left','0','0','0','',''),(228,'carbooking','browse','id',1,0,'left','0','0','0','',''),(238,'carbooking','browse','actions',11,160,'','0','0','0','',''),(302,'collect','browse','reviewedBy',7,0,'left','0','0','0','',''),(303,'collect','browse','reviewedDate',8,0,'left','0','0','0','',''),(301,'collect','browse','appliedDate',6,0,'left','0','0','0','',''),(300,'collect','browse','status',5,0,'left','0','0','0','',''),(299,'collect','browse','reason',4,0,'left','0','0','0','',''),(298,'collect','browse','money',3,0,'left','0','0','0','',''),(257,'collect','create','appliedDate',2,0,'','0','0','0','currentTime',''),(256,'collect','create','appliedBy',1,0,'','0','0','0','currentUser',''),(261,'collect','edit','appliedDate',2,0,'','0','0','0','currentTime',''),(260,'collect','edit','appliedBy',1,0,'','0','0','0','currentUser',''),(258,'collect','create','money',3,0,'','0','0','0','',''),(259,'collect','create','reason',4,0,'','0','0','0','',''),(262,'collect','edit','money',3,0,'','0','0','0','',''),(263,'collect','edit','reason',4,0,'','0','0','0','',''),(264,'collect','view','id',1,0,'basic','0','0','0','',''),(265,'collect','view','appliedBy',2,0,'basic','0','0','0','',''),(266,'collect','view','appliedDate',3,0,'basic','0','0','0','',''),(267,'collect','view','money',4,0,'basic','0','0','0','',''),(268,'collect','view','reason',5,0,'info','0','0','0','',''),(269,'collect','view','status',6,0,'basic','0','0','0','',''),(270,'collect','view','reviewedBy',7,0,'basic','0','0','0','',''),(271,'collect','view','reviewedDate',8,0,'basic','0','0','0','',''),(272,'collect','view','createdBy',9,0,'basic','0','0','0','',''),(273,'collect','view','createdDate',10,0,'basic','0','0','0','',''),(274,'collect','view','editedBy',11,0,'basic','0','0','0','',''),(275,'collect','view','editedDate',12,0,'basic','0','0','0','',''),(276,'collect','pay','depositor',1,0,'','0','0','0','',''),(277,'collect','pay','category',2,0,'','0','0','0','',''),(297,'collect','browse','appliedBy',2,0,'left','0','0','0','',''),(296,'collect','browse','id',1,0,'left','0','0','0','',''),(304,'collect','browse','actions',9,180,'','0','0','0','',''),(305,'buy','browse','id',1,0,'left','0','0','0','',''),(306,'buy','browse','provider',2,0,'left','0','0','0','',''),(307,'buy','browse','goods',3,0,'left','0','0','0','',''),(308,'buy','browse','money',4,0,'left','0','0','0','',''),(309,'buy','browse','desc',5,0,'left','0','0','0','',''),(310,'buy','browse','status',6,0,'left','0','0','0','',''),(311,'buy','browse','createdBy',7,0,'left','0','0','0','',''),(312,'buy','browse','createdDate',8,0,'left','0','0','0','',''),(313,'buy','browse','actions',9,120,'','0','0','0','',''),(324,'buy','create','money',3,0,'','0','0','0','',''),(323,'buy','create','goods',2,0,'','0','0','0','',''),(322,'buy','create','provider',1,0,'','0','0','0','',''),(329,'buy','edit','money',3,0,'','0','0','0','',''),(328,'buy','edit','goods',2,0,'','0','0','0','',''),(327,'buy','edit','provider',1,0,'','0','0','0','',''),(325,'buy','create','desc',4,0,'','0','0','0','',''),(326,'buy','create','file',5,0,'','0','0','0','',''),(330,'buy','edit','desc',4,0,'','0','0','0','',''),(331,'buy','edit','file',5,0,'','0','0','0','',''),(332,'buy','view','id',1,0,'basic','0','0','0','',''),(333,'buy','view','provider',2,0,'basic','0','0','0','',''),(334,'buy','view','goods',3,0,'basic','0','0','0','',''),(335,'buy','view','money',4,0,'basic','0','0','0','',''),(336,'buy','view','desc',5,0,'info','0','0','0','',''),(337,'buy','view','status',6,0,'basic','0','0','0','',''),(338,'buy','view','createdBy',7,0,'basic','0','0','0','',''),(339,'buy','view','createdDate',8,0,'basic','0','0','0','',''),(340,'buy','view','editedBy',9,0,'basic','0','0','0','',''),(341,'buy','view','editedDate',10,0,'basic','0','0','0','',''),(342,'buy','view','file',11,0,'info','0','0','0','',''),(343,'buy','pay','depositor',1,0,'','0','0','0','',''),(344,'buy','pay','category',2,0,'','0','0','0','',''),(384,'purchasing','create','sub_purchasegood',2,0,'','0','0','0','',''),(385,'purchasing','create','money',3,0,'','0','0','0','',''),(386,'purchasing','create','purchasedby',4,0,'','0','0','0','',''),(387,'purchasing','create','purchaseddate',5,0,'','0','0','0','',''),(398,'purchasing','edit','money',3,0,'','0','0','0','',''),(397,'purchasing','edit','sub_purchasegood',2,0,'','0','0','0','',''),(396,'purchasing','edit','provider',1,0,'','0','0','0','',''),(516,'purchasing','view','createdDate',9,0,'basic','0','0','0','',''),(512,'purchasing','view','purchaseddate',5,0,'basic','0','0','0','',''),(510,'purchasing','view','status',3,0,'basic','0','0','0','',''),(511,'purchasing','view','purchasedby',4,0,'basic','0','0','0','',''),(508,'purchasing','view','provider',1,0,'basic','0','0','0','',''),(509,'purchasing','view','money',2,0,'basic','0','0','0','',''),(500,'purchasing','browse','id',1,70,'center','0','0','0','',''),(501,'purchasing','browse','provider',2,0,'left','0','1','0','',''),(502,'purchasing','browse','money',3,80,'right','0','1','1','',''),(503,'purchasing','browse','purchasedby',4,120,'center','0','1','0','',''),(504,'purchasing','browse','purchaseddate',5,140,'center','0','1','0','',''),(505,'purchasing','browse','status',6,80,'center','0','1','0','',''),(383,'purchasing','create','provider',1,0,'','0','0','0','',''),(392,'purchasegood','create','amount',4,0,'','0','0','0','',''),(389,'purchasegood','create','product',1,0,'','0','0','0','',''),(390,'purchasegood','create','unit',2,0,'','0','0','0','',''),(391,'purchasegood','create','price',3,0,'','0','0','0','',''),(388,'purchasing','create','desc',6,0,'','0','0','0','',''),(393,'purchasegood','create','money',5,0,'','0','0','0','',''),(395,'purchasegood','create','file',7,0,'','0','0','0','',''),(399,'purchasing','edit','purchasedby',4,0,'','0','0','0','',''),(400,'purchasing','edit','purchaseddate',5,0,'','0','0','0','',''),(401,'purchasing','edit','desc',6,0,'','0','0','0','',''),(403,'purchasegood','edit','product',2,0,'','0','0','0','',''),(404,'purchasegood','edit','unit',3,0,'','0','0','0','',''),(405,'purchasegood','edit','price',4,0,'','0','0','0','',''),(406,'purchasegood','edit','amount',5,0,'','0','0','0','',''),(407,'purchasegood','edit','money',6,0,'','0','0','0','',''),(408,'purchasegood','edit','file',7,0,'','0','0','0','',''),(513,'purchasing','view','sub_purchasegood',6,0,'basic','0','0','0','',''),(514,'purchasing','view','desc',7,0,'info','0','0','0','',''),(515,'purchasing','view','createdBy',8,0,'basic','0','0','0','',''),(521,'purchasegood','view','unit',3,100,'','0','1','0','',''),(522,'purchasegood','view','price',4,100,'','0','1','0','',''),(520,'purchasegood','view','product',2,0,'','0','1','0','',''),(519,'purchasegood','view','id',1,80,'','0','1','0','',''),(507,'purchasing','browse','actions',8,120,'','0','0','0','',''),(506,'purchasing','browse','desc',7,0,'left','0','0','0','',''),(517,'purchasing','view','editedBy',10,0,'basic','0','0','0','',''),(518,'purchasing','view','editedDate',11,0,'basic','0','0','0','',''),(523,'purchasegood','view','amount',5,100,'','0','1','0','',''),(524,'purchasegood','view','money',6,100,'','0','1','0','',''),(820,'purchasing','batchcreate','provider',1,300,'','0','0','0','',''),(821,'purchasing','batchcreate','money',2,200,'','0','0','0','',''),(822,'purchasing','batchcreate','purchasedby',3,120,'','0','0','0','',''),(825,'purchasing','batchedit','provider',1,300,'','0','0','0','',''),(826,'purchasing','batchedit','money',2,200,'','0','0','0','',''),(827,'purchasing','batchedit','purchasedby',3,120,'','0','0','0','',''),(814,'buy','batchcreate','money',3,200,'','0','0','0','',''),(812,'buy','batchcreate','provider',1,300,'','0','0','0','',''),(817,'buy','batchedit','goods',2,300,'','0','0','0','',''),(816,'buy','batchedit','provider',1,300,'','0','0','0','',''),(800,'collect','batchcreate','appliedBy',1,120,'','0','0','0','',''),(801,'collect','batchcreate','appliedDate',2,150,'','0','0','0','',''),(802,'collect','batchcreate','money',3,200,'','0','0','0','',''),(828,'purchasing','batchedit','purchaseddate',4,150,'','0','0','0','',''),(823,'purchasing','batchcreate','purchaseddate',4,150,'','0','0','0','',''),(804,'collect','batchedit','appliedBy',1,120,'','0','0','0','',''),(805,'collect','batchedit','appliedDate',2,150,'','0','0','0','',''),(791,'carbooking','batchcreate','begin',4,150,'','0','0','0','',''),(790,'carbooking','batchcreate','car',3,150,'','0','0','0','',''),(789,'carbooking','batchcreate','appliedDate',2,150,'','0','0','0','',''),(788,'carbooking','batchcreate','appliedBy',1,120,'','0','0','0','',''),(797,'carbooking','batchedit','begin',4,150,'','0','0','0','',''),(796,'carbooking','batchedit','car',3,150,'','0','0','0','',''),(795,'carbooking','batchedit','appliedDate',2,150,'','0','0','0','',''),(794,'carbooking','batchedit','appliedBy',1,120,'','0','0','0','',''),(749,'car','batchcreate','type',1,150,'','0','0','0','',''),(750,'car','batchcreate','code',2,0,'','0','0','0','',''),(751,'car','batchcreate','driver',3,120,'','0','0','0','',''),(752,'car','batchcreate','mobile',4,0,'','0','0','0','',''),(753,'car','batchcreate','buyDate',5,120,'','0','0','0','',''),(763,'car','batchedit','type',1,150,'','0','0','0','',''),(764,'car','batchedit','code',2,0,'','0','0','0','',''),(765,'car','batchedit','driver',3,120,'','0','0','0','',''),(766,'car','batchedit','mobile',4,0,'','0','0','0','',''),(767,'car','batchedit','buyDate',5,120,'','0','0','0','',''),(730,'stamp','batchcreate','reason',2,0,'','0','0','0','',''),(731,'stamp','batchcreate','begin',3,150,'','0','0','0','',''),(732,'stamp','batchcreate','end',4,150,'','0','0','0','',''),(737,'stamp','batchedit','begin',3,150,'','0','0','0','',''),(736,'stamp','batchedit','reason',2,0,'','0','0','0','',''),(738,'stamp','batchedit','end',4,150,'','0','0','0','',''),(735,'stamp','batchedit','proposer',1,120,'','0','0','0','',''),(711,'meetingroombooking','batchcreate','room',1,200,'','0','0','0','',''),(712,'meetingroombooking','batchcreate','begin',2,150,'','0','0','0','',''),(713,'meetingroombooking','batchcreate','end',3,150,'','0','0','0','',''),(714,'meetingroombooking','batchcreate','orderedBy',4,120,'','0','0','0','',''),(715,'meetingroombooking','batchcreate','orderedDate',5,150,'','0','0','0','',''),(717,'meetingroombooking','batchedit','room',1,200,'','0','0','0','',''),(718,'meetingroombooking','batchedit','begin',2,150,'','0','0','0','',''),(719,'meetingroombooking','batchedit','end',3,150,'','0','0','0','',''),(720,'meetingroombooking','batchedit','orderedBy',4,120,'','0','0','0','',''),(690,'meetingroom','batchcreate','name',1,0,'','0','0','0','',''),(691,'meetingroom','batchcreate','position',2,100,'','0','0','0','',''),(692,'meetingroom','batchcreate','seats',3,100,'','0','0','0','',''),(693,'meetingroom','batchcreate','equipment',4,320,'','0','0','0','',''),(698,'meetingroom','batchedit','equipment',4,320,'','0','0','0','',''),(696,'meetingroom','batchedit','position',2,100,'','0','0','0','',''),(697,'meetingroom','batchedit','seats',3,100,'','0','0','0','',''),(695,'meetingroom','batchedit','name',1,0,'','0','0','0','',''),(694,'meetingroom','batchcreate','workday',5,400,'','0','0','0','',''),(699,'meetingroom','batchedit','workday',5,400,'','0','0','0','',''),(716,'meetingroombooking','batchcreate','desc',6,0,'','0','0','0','',''),(721,'meetingroombooking','batchedit','orderedDate',5,150,'','0','0','0','',''),(722,'meetingroombooking','batchedit','desc',6,0,'','0','0','0','',''),(733,'stamp','batchcreate','type',5,280,'','0','0','0','',''),(729,'stamp','batchcreate','proposer',1,120,'','0','0','0','',''),(734,'stamp','batchcreate','desc',6,0,'','0','0','0','',''),(739,'stamp','batchedit','type',5,280,'','0','0','0','',''),(740,'stamp','batchedit','desc',6,0,'','0','0','0','',''),(755,'car','batchcreate','status',7,0,'','0','0','0','normal',''),(754,'car','batchcreate','price',6,0,'','0','0','0','',''),(769,'car','batchedit','status',7,120,'','0','0','0','normal',''),(768,'car','batchedit','price',6,0,'','0','0','0','',''),(786,'car','browse','status',8,0,'left','0','0','0','',''),(785,'car','browse','price',7,0,'left','0','0','0','',''),(792,'carbooking','batchcreate','end',5,150,'','0','0','0','',''),(793,'carbooking','batchcreate','reason',6,0,'','0','0','0','',''),(798,'carbooking','batchedit','end',5,150,'','0','0','0','',''),(799,'carbooking','batchedit','reason',6,0,'','0','0','0','',''),(803,'collect','batchcreate','reason',4,0,'','0','0','0','',''),(806,'collect','batchedit','money',3,200,'','0','0','0','',''),(807,'collect','batchedit','reason',4,0,'','0','0','0','',''),(813,'buy','batchcreate','goods',2,300,'','0','0','0','',''),(815,'buy','batchcreate','desc',4,0,'','0','0','0','',''),(818,'buy','batchedit','money',3,200,'','0','0','0','',''),(819,'buy','batchedit','desc',4,0,'','0','0','0','',''),(824,'purchasing','batchcreate','desc',5,0,'','0','0','0','',''),(829,'purchasing','batchedit','desc',5,0,'','0','0','0','','');
INSERT INTO `sys_workflowrelation` VALUES (1,'meetingroom','meetingroombooking','room','one2one,many2many','','0000-00-00 00:00:00'),(2,'car','carbooking','car','one2one,many2many','','0000-00-00 00:00:00');
INSERT INTO `sys_workflowrule` VALUES (1,'system','必填','notempty','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(2,'system','唯一','unique','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(3,'system','日期','date','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(4,'system','email','email','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(5,'system','数字','float','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(6,'system','电话','phone','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00'),(7,'system','IP','ip','admin','2020-07-09 21:05:50','','0000-00-00 00:00:00');

REPLACE INTO `sys_grouppriv` VALUES
(1,'apppriv','flow'),
(1,'workflow','activate'),
(1,'workflow','backup'),
(1,'workflow','browseDB'),
(1,'workflow','browseFlow'),
(1,'workflow','copy'),
(1,'workflow','create'),
(1,'workflow','css'),
(1,'workflow','deactivate'),
(1,'workflow','delete'),
(1,'workflow','edit'),
(1,'workflow','flowchart'),
(1,'workflow','js'),
(1,'workflow','release'),
(1,'workflow','ui'),
(1,'workflow','upgrade'),
(1,'workflow','view'),
(1,'workflowaction','browse'),
(1,'workflowaction','create'),
(1,'workflowaction','css'),
(1,'workflowaction','delete'),
(1,'workflowaction','edit'),
(1,'workflowaction','js'),
(1,'workflowaction','setNotice'),
(1,'workflowaction','setVerification'),
(1,'workflowaction','view'),
(1,'workflowcondition','browse'),
(1,'workflowcondition','create'),
(1,'workflowcondition','delete'),
(1,'workflowcondition','edit'),
(1,'workflowdatasource','browse'),
(1,'workflowdatasource','create'),
(1,'workflowdatasource','delete'),
(1,'workflowdatasource','edit'),
(1,'workflowfield','browse'),
(1,'workflowfield','create'),
(1,'workflowfield','delete'),
(1,'workflowfield','edit'),
(1,'workflowfield','setExport'),
(1,'workflowfield','setSearch'),
(1,'workflowfield','sort'),
(1,'workflowhook','browse'),
(1,'workflowhook','create'),
(1,'workflowhook','delete'),
(1,'workflowhook','edit'),
(1,'workflowlabel','browse'),
(1,'workflowlabel','create'),
(1,'workflowlabel','delete'),
(1,'workflowlabel','edit'),
(1,'workflowlabel','sort'),
(1,'workflowlayout','admin'),
(1,'workflowlinkage','browse'),
(1,'workflowlinkage','create'),
(1,'workflowlinkage','delete'),
(1,'workflowlinkage','edit'),
(1,'workflowrelation','admin'),
(1,'workflowrule','browse'),
(1,'workflowrule','create'),
(1,'workflowrule','delete'),
(1,'workflowrule','edit'),
(1,'workflowrule','view');

-- DROP TABLE IF EXISTS `flow_buy`;
CREATE TABLE IF NOT EXISTS `flow_buy` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `provider` varchar(200) NOT NULL,
  `goods` varchar(200) NOT NULL,
  `money` varchar(200) NOT NULL,
  `desc` varchar(200) NOT NULL,
  `status` varchar(200) NOT NULL,
  `depositor` varchar(200) NOT NULL,
  `category` varchar(200) NOT NULL,
  `parent` mediumint(8) unsigned NOT NULL,
  `createdBy` varchar(30) NOT NULL,
  `createdDate` datetime NOT NULL,
  `editedBy` varchar(30) NOT NULL,
  `editedDate` datetime NOT NULL,
  `deleted` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `flow_car`;
CREATE TABLE IF NOT EXISTS `flow_car` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `type` varchar(200) NOT NULL,
  `code` varchar(200) NOT NULL,
  `driver` varchar(200) NOT NULL,
  `mobile` varchar(200) NOT NULL,
  `buyDate` date NOT NULL,
  `price` varchar(200) NOT NULL,
  `status` varchar(200) NOT NULL DEFAULT 'normal',
  `parent` mediumint(8) unsigned NOT NULL,
  `createdBy` varchar(30) NOT NULL,
  `createdDate` datetime NOT NULL,
  `editedBy` varchar(30) NOT NULL,
  `editedDate` datetime NOT NULL,
  `deleted` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `flow_carbooking`;
CREATE TABLE IF NOT EXISTS `flow_carbooking` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `appliedBy` varchar(200) NOT NULL,
  `appliedDate` datetime NOT NULL,
  `car` varchar(200) NOT NULL,
  `begin` datetime NOT NULL,
  `end` datetime NOT NULL,
  `reason` varchar(200) NOT NULL,
  `status` varchar(200) NOT NULL DEFAULT 'wait',
  `reviewedBy` varchar(200) NOT NULL,
  `reviewedDate` datetime NOT NULL,
  `parent` mediumint(8) unsigned NOT NULL,
  `createdBy` varchar(30) NOT NULL,
  `createdDate` datetime NOT NULL,
  `editedBy` varchar(30) NOT NULL,
  `editedDate` datetime NOT NULL,
  `deleted` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `flow_collect`;
CREATE TABLE IF NOT EXISTS `flow_collect` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `appliedBy` varchar(200) NOT NULL,
  `appliedDate` datetime NOT NULL,
  `money` varchar(200) NOT NULL,
  `reason` varchar(200) NOT NULL,
  `status` varchar(200) NOT NULL DEFAULT 'wait',
  `reviewedBy` varchar(200) NOT NULL,
  `reviewedDate` datetime NOT NULL,
  `depositor` varchar(200) NOT NULL,
  `category` varchar(200) NOT NULL,
  `parent` mediumint(8) unsigned NOT NULL,
  `createdBy` varchar(30) NOT NULL,
  `createdDate` datetime NOT NULL,
  `editedBy` varchar(30) NOT NULL,
  `editedDate` datetime NOT NULL,
  `deleted` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

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

-- DROP TABLE IF EXISTS `flow_meetingroombooking`;
CREATE TABLE IF NOT EXISTS `flow_meetingroombooking` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `room` varchar(200) NOT NULL,
  `begin` datetime NOT NULL,
  `end` datetime NOT NULL,
  `orderedBy` varchar(200) NOT NULL,
  `orderedDate` datetime NOT NULL,
  `desc` varchar(200) NOT NULL,
  `parent` mediumint(8) unsigned NOT NULL,
  `createdBy` varchar(30) NOT NULL,
  `createdDate` datetime NOT NULL,
  `editedBy` varchar(30) NOT NULL,
  `editedDate` datetime NOT NULL,
  `deleted` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `flow_purchasegood`;
CREATE TABLE IF NOT EXISTS `flow_purchasegood` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `product` varchar(200) NOT NULL,
  `unit` char(20) NOT NULL,
  `price` decimal(12,2) NOT NULL,
  `amount` decimal(12,2) NOT NULL,
  `money` decimal(12,2) NOT NULL,
  `parent` mediumint(8) unsigned NOT NULL,
  `createdBy` varchar(30) NOT NULL,
  `createdDate` datetime NOT NULL,
  `editedBy` varchar(30) NOT NULL,
  `editedDate` datetime NOT NULL,
  `deleted` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `flow_purchasing`;
CREATE TABLE IF NOT EXISTS `flow_purchasing` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `provider` mediumint(150) NOT NULL,
  `money` decimal(12,2) NOT NULL,
  `purchasedby` char(30) NOT NULL,
  `purchaseddate` datetime NOT NULL,
  `status` char(30) NOT NULL DEFAULT 'wait',
  `desc` text NOT NULL,
  `parent` mediumint(8) unsigned NOT NULL,
  `createdBy` varchar(30) NOT NULL,
  `createdDate` datetime NOT NULL,
  `editedBy` varchar(30) NOT NULL,
  `editedDate` datetime NOT NULL,
  `deleted` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- DROP TABLE IF EXISTS `flow_stamp`;
CREATE TABLE IF NOT EXISTS `flow_stamp` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `proposer` varchar(200) NOT NULL,
  `reason` varchar(200) NOT NULL,
  `begin` datetime NOT NULL,
  `end` datetime NOT NULL,
  `type` varchar(200) NOT NULL,
  `desc` varchar(200) NOT NULL,
  `status` varchar(200) NOT NULL DEFAULT 'wait',
  `reviewedBy` varchar(200) NOT NULL,
  `reviewedDate` datetime NOT NULL,
  `parent` mediumint(8) unsigned NOT NULL,
  `createdBy` varchar(30) NOT NULL,
  `createdDate` datetime NOT NULL,
  `editedBy` varchar(30) NOT NULL,
  `editedDate` datetime NOT NULL,
  `deleted` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

REPLACE INTO `sys_grouppriv` VALUES
(1,'buy','18'),
(1,'buy','19'),
(1,'buy','20'),
(1,'buy','batchcreate'),
(1,'buy','batchedit'),
(1,'buy','browse'),
(1,'buy','create'),
(1,'buy','delete'),
(1,'buy','edit'),
(1,'buy','export'),
(1,'buy','exporttemplate'),
(1,'buy','import'),
(1,'buy','link'),
(1,'buy','pay'),
(1,'buy','search'),
(1,'buy','showimport'),
(1,'buy','unlink'),
(1,'buy','view'),
(1,'car','8'),
(1,'car','batchcreate'),
(1,'car','batchedit'),
(1,'car','browse'),
(1,'car','create'),
(1,'car','delete'),
(1,'car','edit'),
(1,'car','export'),
(1,'car','exporttemplate'),
(1,'car','import'),
(1,'car','link'),
(1,'car','search'),
(1,'car','showimport'),
(1,'car','unlink'),
(1,'car','view'),
(1,'carbooking','12'),
(1,'carbooking','13'),
(1,'carbooking','9'),
(1,'carbooking','batchcreate'),
(1,'carbooking','batchedit'),
(1,'carbooking','browse'),
(1,'carbooking','create'),
(1,'carbooking','delete'),
(1,'carbooking','edit'),
(1,'carbooking','export'),
(1,'carbooking','exporttemplate'),
(1,'carbooking','import'),
(1,'carbooking','link'),
(1,'carbooking','pass'),
(1,'carbooking','reject'),
(1,'carbooking','search'),
(1,'carbooking','showimport'),
(1,'carbooking','unlink'),
(1,'carbooking','view'),
(1,'collect','14'),
(1,'collect','15'),
(1,'collect','16'),
(1,'collect','17'),
(1,'collect','batchcreate'),
(1,'collect','batchedit'),
(1,'collect','browse'),
(1,'collect','create'),
(1,'collect','delete'),
(1,'collect','edit'),
(1,'collect','export'),
(1,'collect','exporttemplate'),
(1,'collect','import'),
(1,'collect','link'),
(1,'collect','pass'),
(1,'collect','pay'),
(1,'collect','reject'),
(1,'collect','search'),
(1,'collect','showimport'),
(1,'collect','unlink'),
(1,'collect','view'),
(1,'meetingroom','1'),
(1,'meetingroom','3'),
(1,'meetingroom','4'),
(1,'meetingroom','5'),
(1,'meetingroom','batchcreate'),
(1,'meetingroom','batchedit'),
(1,'meetingroom','browse'),
(1,'meetingroom','create'),
(1,'meetingroom','delete'),
(1,'meetingroom','edit'),
(1,'meetingroom','export'),
(1,'meetingroom','exporttemplate'),
(1,'meetingroom','import'),
(1,'meetingroom','link'),
(1,'meetingroom','search'),
(1,'meetingroom','showimport'),
(1,'meetingroom','unlink'),
(1,'meetingroom','view'),
(1,'meetingroombooking','2'),
(1,'meetingroombooking','6'),
(1,'meetingroombooking','batchcreate'),
(1,'meetingroombooking','batchedit'),
(1,'meetingroombooking','browse'),
(1,'meetingroombooking','create'),
(1,'meetingroombooking','delete'),
(1,'meetingroombooking','edit'),
(1,'meetingroombooking','export'),
(1,'meetingroombooking','exporttemplate'),
(1,'meetingroombooking','import'),
(1,'meetingroombooking','link'),
(1,'meetingroombooking','search'),
(1,'meetingroombooking','showimport'),
(1,'meetingroombooking','unlink'),
(1,'meetingroombooking','view'),
(1,'purchasing','21'),
(1,'purchasing','batchcreate'),
(1,'purchasing','batchedit'),
(1,'purchasing','browse'),
(1,'purchasing','create'),
(1,'purchasing','delete'),
(1,'purchasing','edit'),
(1,'purchasing','export'),
(1,'purchasing','exporttemplate'),
(1,'purchasing','import'),
(1,'purchasing','link'),
(1,'purchasing','pass'),
(1,'purchasing','reject'),
(1,'purchasing','search'),
(1,'purchasing','showimport'),
(1,'purchasing','unlink'),
(1,'purchasing','view'),
(1,'stamp','10'),
(1,'stamp','11'),
(1,'stamp','7'),
(1,'stamp','batchcreate'),
(1,'stamp','batchedit'),
(1,'stamp','browse'),
(1,'stamp','create'),
(1,'stamp','delete'),
(1,'stamp','edit'),
(1,'stamp','export'),
(1,'stamp','exporttemplate'),
(1,'stamp','import'),
(1,'stamp','link'),
(1,'stamp','pass'),
(1,'stamp','reject'),
(1,'stamp','revoke'),
(1,'stamp','search'),
(1,'stamp','showimport'),
(1,'stamp','submit'),
(1,'stamp','unlink'),
(1,'stamp','view');
