-- 添加模块表
-- ----------------------------
-- Table structure for mortals_iot_asset
-- ----------------------------
DROP TABLE IF EXISTS `mortals_iot_asset`;
CREATE TABLE `mortals_iot_asset`(
	`id` bigint(20) NOT NULL  auto_increment  COMMENT 'ID，自增长',
	`assetNum` varchar(50) NOT NULL  COMMENT '资产码，全局唯一',
	`deviceNum` varchar(50) default NULL  COMMENT '业务码，关联的业务码',
	`materiaId` bigint(20) NOT NULL  COMMENT '所属物料ID，materia表ID',
	`materiaCode` varchar(50) NOT NULL  COMMENT '所属物料代码，materia表code',
	`bomId` bigint(20) default NULL  COMMENT '所属bomID，bom表ID',
	`producerId` bigint(20) NULL  COMMENT '生产厂家ID，partner表ID',
	`produceDate` datetime NULL  COMMENT '生产日期',
	`produceCost` bigint(20) NULL  COMMENT '生产成本，单位：厘',
	`beforeFlowStatus` int(10) NOT NULL  COMMENT '前流转状态，参数配置-AssetFlowStatus',
	`flowStatus` int(10) NOT NULL  COMMENT '流转状态，参数配置-AssetFlowStatus',
	`enabled` int(10) NOT NULL  COMMENT '是否启用，0否，1是',
	`updateTime` datetime NOT NULL  COMMENT '变更时间',
	`updateUser` varchar(50) NOT NULL  COMMENT '变更用户loginName',
	`createTime` datetime NOT NULL  COMMENT '创建时间',
	`createUser` varchar(50) NOT NULL  COMMENT '创建用户loginName',
	PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='资产表';

-- ----------------------------
-- Table structure for mortals_iot_materia_supplier
-- ----------------------------
DROP TABLE IF EXISTS `mortals_iot_materia_supplier`;
CREATE TABLE `mortals_iot_materia_supplier`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID，自增长',
  `materiaId` bigint(20) NOT NULL COMMENT '物料ID',
  `supplierId` bigint(20) NOT NULL COMMENT '供应商ID，partner表ID',
  `deliveryPeriod` bigint(20) NOT NULL COMMENT '交货期',
  `deliveryPeriodUnit` tinyint(10) NOT NULL COMMENT '交货期单位，参数配置-DeliveryPeriodUnit小时，工作日，自然日，周，月',
  `supplierMateriaCode` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '供应商物料代码',
  `unitOfMeasure` bigint(20) NOT NULL COMMENT '计量单位，参数配置-UnitOfMeasure',
  `costPlan` bigint(20) NOT NULL COMMENT '供货成本，单位：厘/计量单位',
  `updateTime` datetime(0) NOT NULL COMMENT '变更时间',
  `updateUser` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '变更用户loginName',
  `createTime` datetime(0) NOT NULL COMMENT '创建时间',
  `createUser` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '创建用户loginName',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '物料供应商表' ROW_FORMAT = Dynamic;

DROP TABLE IF EXISTS `mortals_iot_partner`;
CREATE TABLE `mortals_iot_partner`(
	`id` bigint(20) NOT NULL  auto_increment  COMMENT '客户ID，自增长',
	`name` varchar(50) NOT NULL  COMMENT '客户名称，如个人姓名或公司名称全称',
	`code` varchar(50) NOT NULL  COMMENT '客户编码，全局唯一，生成后不可变',
	`tags` varchar(255) NOT NULL  COMMENT '客户标签，多个以逗号分隔;参数配置-PartnerTags',
	`nature` int(10) NOT NULL  default '10' COMMENT '客户性质，10私企，20国企，30外企，40合资，50个体公商户，60个人，默认10',
	`trade` int(10) default NULL  COMMENT '行业类别，参看国家标准：http://www.stats.gov.cn/tjsj/tjbz/hyflbz/201905/P020190716349644060705.pdf',
	`settlementType` int(10) default NULL  COMMENT '结算方式，10现金结算，20票据转让，30转账结算',
	`creditCode` varchar(100) default NULL  COMMENT '信用代码，当客户性质为非个人时：统一信用代码；当主体类型为个人时：身份证号',
	`contactsUser` varchar(50) NOT NULL  COMMENT '联系人，姓名',
	`contactsMobile` varchar(50) NOT NULL  COMMENT '联系手机',
	`contactsPhone` varchar(50) NOT NULL  COMMENT '联系座机',
	`contactsEmail` varchar(50) default NULL  COMMENT '联系邮箱',
	`contactsAddress` varchar(100) default NULL  COMMENT '联系地址',
	`contactsWebsite` varchar(100) default NULL  COMMENT '网站',
	`remark` text default NULL  COMMENT '备注',
	`updateTime` datetime NOT NULL  COMMENT '变更时间',
	`updateUser` varchar(50) NOT NULL  COMMENT '变更用户loginName',
	`createTime` datetime NOT NULL  COMMENT '创建时间',
	`createUser` varchar(50) NOT NULL  COMMENT '创建用户loginName',
	PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='客户表';

DROP TABLE IF EXISTS `mortals_iot_supplier`;
CREATE TABLE `mortals_iot_supplier`(
	`id` bigint(20) NOT NULL  auto_increment  COMMENT '供应商ID，自增长',
	`name` varchar(50) NOT NULL  COMMENT '供应商名称，如个人姓名或公司名称全称',
	`code` varchar(50) NOT NULL  COMMENT '供应商代码，全局唯一，生成后不可变',
	`tags` varchar(255) NOT NULL  COMMENT '供应商标签，多个以逗号分隔;参数配置-SupplierTags',
	`nature` int(10) NOT NULL  default '10' COMMENT '供应商性质，10私企，20国企，30外企，40合资，50个体公商户，60个人，默认10',
	`trade` int(10) default NULL  COMMENT '行业类别，参看国家标准：http://www.stats.gov.cn/tjsj/tjbz/hyflbz/201905/P020190716349644060705.pdf',
	`settlementType` int(10) default NULL  COMMENT '结算方式，10现金结算，20票据转让，30转账结算',
	`creditCode` varchar(100) default NULL  COMMENT '信用代码，当供应商性质为非个人时：统一信用代码；当主体类型为个人时：身份证号',
	`contactsUser` varchar(50) NOT NULL  COMMENT '联系人，姓名',
	`contactsMobile` varchar(50) NOT NULL  COMMENT '联系手机',
	`contactsPhone` varchar(50) NOT NULL  COMMENT '联系座机',
	`contactsEmail` varchar(50) default NULL  COMMENT '联系邮箱',
	`contactsAddress` varchar(100) default NULL  COMMENT '联系地址',
	`contactsWebsite` varchar(100) default NULL  COMMENT '网站',
	`remark` text default NULL  COMMENT '备注',
	`updateTime` datetime NOT NULL  COMMENT '变更时间',
	`updateUser` varchar(50) NOT NULL  COMMENT '变更用户loginName',
	`createTime` datetime NOT NULL  COMMENT '创建时间',
	`createUser` varchar(50) NOT NULL  COMMENT '创建用户loginName',
	PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='供应商表';


-- ----------------------------
-- Table structure for mortals_iot_asset_flow_event
-- ----------------------------
DROP TABLE IF EXISTS `mortals_iot_asset_flow_event`;
CREATE TABLE `mortals_iot_asset_flow_event`(
	`id` bigint(20) NOT NULL  auto_increment  COMMENT 'ID，自增长',
	`name` varchar(50) NOT NULL  COMMENT '事件名称，全局唯一',
	`code` varchar(50) NOT NULL  COMMENT '事件编码，全局唯一',
	`enabled` int(10) NOT NULL  COMMENT '是否启用，0否，1是',
	`beforeFlowStatus` varchar(255) NOT NULL  COMMENT '事件前资产流转状态，参数配置-AssetFlowStatus，多个状态用逗号分隔',
	`afterFlowStatus` int(10) NOT NULL  COMMENT '事件后资产流转状态，参数配置-AssetFlowStatus',
	`script` varchar(200) NOT NULL  COMMENT '事件执行事务脚本，java类，实现EventHandle接口',
	`remark` varchar(50) default NULL  COMMENT '事件描述',
	`updateTime` datetime NOT NULL  COMMENT '变更时间',
	`updateUser` varchar(50) NOT NULL  COMMENT '变更用户loginName',
	`createTime` datetime NOT NULL  COMMENT '创建时间',
	`createUser` varchar(50) NOT NULL  COMMENT '创建用户loginName',
	PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='资产事件表';
    
DROP TABLE IF EXISTS `mortals_iot_asset_flow_event_field`;
CREATE TABLE `mortals_iot_asset_flow_event_field`(
	`id` bigint(20) NOT NULL  auto_increment  COMMENT 'ID，自增长',
	`eventCode` varchar(50) NOT NULL  COMMENT '事件编码',
	`fieldCode` varchar(50) NOT NULL  COMMENT '字段编码，事件下唯一',
	`fieldName` varchar(50) NOT NULL  COMMENT '字段名称',
	`fieldType` varchar(50) NOT NULL  COMMENT '数据类型，参数配置-ExtFieldType，默认varchar',
	`fieldLen` bigint(20) NOT NULL  default '50' COMMENT '数据长度，默认50',
	`fieldNull` bigint(20) NOT NULL  default '1' COMMENT '允许为空，0否，1是，默认1',
	`fieldOrderNo` bigint(20) NOT NULL  default '0' COMMENT '排序号，默认0',
	`remark` varchar(200) default NULL  COMMENT '备注',
	`enabled` int(10) NOT NULL  COMMENT '是否启用，0否，1是',
	`updateTime` datetime NOT NULL  COMMENT '变更时间',
	`updateUser` varchar(50) NOT NULL  COMMENT '变更用户loginName',
	`createTime` datetime NOT NULL  COMMENT '创建时间',
	`createUser` varchar(50) NOT NULL  COMMENT '创建用户loginName',
	PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='资产事件扩展字段配置';


-- ----------------------------
-- Table structure for mortals_iot_asset_flow_event_log
-- ----------------------------
DROP TABLE IF EXISTS `mortals_iot_asset_flow_event_log`;
CREATE TABLE `mortals_iot_asset_flow_event_log`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID，自增长',
  `eventId` bigint(20) NOT NULL COMMENT '事件ID，关联asset_flow_event表ID',
  `assetNum` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '资产码，全局唯一',
  `beforeStatus` int(10) NOT NULL COMMENT '事件前资产流转状态，参数配置-AssetFlowStatus',
  `afteStatus` int(10) NOT NULL COMMENT '事件后资产流转状态，参数配置-AssetFlowStatus',
  `eventTime` datetime(0) NOT NULL COMMENT '事件发生时间',
  `eventUser` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '事件经手人，登录名',
  `eventAfterUser` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '事件关联人，登录名,多个以逗号分隔',
  `eventAddress` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '事件发生地，自动采集到的地址',
  `eventImgUrl` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '事件关联图像，图片或视频地址，多个以逗号分隔',
  `eventExtInfo` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '事件扩展信息，json串，基于事件扩展属性产生, 参看mortals_iot_table_ext_field表',
  `remark` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '备注',
  `createTime` datetime(0) NOT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '资产事件日志' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for mortals_iot_attach
-- ----------------------------
DROP TABLE IF EXISTS `mortals_iot_attach`;
CREATE TABLE `mortals_iot_attach`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID，自增长',
  `tableCode` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '关联主表表名',
  `tableDataId` bigint(20) NOT NULL COMMENT '关联主表某一字段数据',
  `attachType` int(10) NOT NULL COMMENT '附件分类，参数配置-MateriaAttachType',
  `attachName` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '附件名称',
  `attachUrl` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '附件相对URL，/{materiaUniFullCode}/{attachType}/{attachName}',
  `remark` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '备注',
  `updateTime` datetime(0) NOT NULL COMMENT '变更时间',
  `updateUser` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '变更用户loginName',
  `createTime` datetime(0) NOT NULL COMMENT '创建时间',
  `createUser` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '创建用户loginName',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '资料附件表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for mortals_iot_config_field
-- ----------------------------
DROP TABLE IF EXISTS `mortals_iot_config_field`;
CREATE TABLE `mortals_iot_config_field`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID，自增长',
  `tableCode` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '关联主表表名',
  `fieldCode` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '字段编码，tableCode下唯一',
  `fieldName` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '字段名称',
  `fieldType` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '数据类型，参数配置-ExtFieldType，默认varchar',
  `fieldLen` bigint(20) NOT NULL DEFAULT 50 COMMENT '数据长度，默认50',
  `fieldNull` bigint(20) NOT NULL DEFAULT 1 COMMENT '允许为空，0否，1是，默认1',
  `fieldOrderNo` bigint(20) NOT NULL DEFAULT 0 COMMENT '排序号，默认0',
  `remark` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
  `enabled` int(10) NOT NULL COMMENT '是否启用，0否，1是',
  `updateTime` datetime(0) NOT NULL COMMENT '变更时间',
  `updateUser` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '变更用户loginName',
  `createTime` datetime(0) NOT NULL COMMENT '创建时间',
  `createUser` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '创建用户loginName',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '字段配置' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for mortals_iot_idgenerator
-- ----------------------------
DROP TABLE IF EXISTS `mortals_iot_idgenerator`;
CREATE TABLE `mortals_iot_idgenerator`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '序号，主键，自增长',
  `idType` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'id类型',
  `idMaxValue` bigint(20) UNSIGNED NOT NULL COMMENT 'id值',
  `remark` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '备注',
  `versionNum` bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '版本号，默认0',
  `gmtModify` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '最后修改时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '主键Id生成器' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for mortals_iot_materia
-- ----------------------------
DROP TABLE IF EXISTS `mortals_iot_materia`;
CREATE TABLE `mortals_iot_materia`(
	`id` bigint(20) NOT NULL  auto_increment  COMMENT 'ID，自增长',
	`name` varchar(50) NOT NULL  COMMENT '物料名称，同一类目下不能重名',
	`selfCode` varchar(20) NOT NULL  COMMENT '物料短代码，同一类目下唯一，生成后不可变',
	`code` varchar(50) NOT NULL  COMMENT '物料代码，包括类目代码',
	`assetsCode` varchar(50) default NULL  COMMENT '资产编码，如果有则添加，允许为空',
	`categoryId` bigint(20) NOT NULL  COMMENT '类目ID，categroy表ID',
	`specModel` varchar(50) default NULL  COMMENT '规格型号',
	`unitOfMeasure` bigint(20) NOT NULL  default '100' COMMENT '计量单位，参数配置-UnitOfMeasure,默认100',
	`useNum` bigint(20) NOT NULL  default '1' COMMENT '默认用量，默认1',
	`lossRate` int(10) NOT NULL  default '0' COMMENT '默认损耗率，0-100，百分比，默认0',
	`supplyType` int(10) NOT NULL  default '300' COMMENT '默认补给方式，参数配置-MateriaSupplyType300外购，301自产，302外协默认300',
	`costPlan` bigint(20) default NULL  COMMENT '默认计划成本，单位：厘/计量单位',
	`mainPicUrl` varchar(500) default NULL  COMMENT '主图片url，url',
	`remark` varchar(500) default NULL  COMMENT '备注',
	`enabled` int(10) NOT NULL  COMMENT '是否启用，0否，1是',
	`updateTime` datetime NOT NULL  COMMENT '变更时间',
	`updateUser` varchar(50) NOT NULL  COMMENT '变更用户loginName',
	`createTime` datetime NOT NULL  COMMENT '创建时间',
	`createUser` varchar(50) NOT NULL  COMMENT '创建用户loginName',
	`field01` bigint(20) default NULL  COMMENT '扩展字段，数据意义参看扩展字段定义表',
	`field02` bigint(20) default NULL  COMMENT '扩展字段',
	`field03` bigint(20) default NULL  COMMENT '扩展字段',
	`field04` bigint(20) default NULL  COMMENT '扩展字段',
	`field05` bigint(20) default NULL  COMMENT '扩展字段',
	`field06` bigint(20) default NULL  COMMENT '扩展字段',
	`field07` bigint(20) default NULL  COMMENT '扩展字段',
	`field08` bigint(20) default NULL  COMMENT '扩展字段',
	`field09` bigint(20) default NULL  COMMENT '扩展字段',
	`field10` bigint(20) default NULL  COMMENT '扩展字段',
	`field11` varchar(255) default NULL  COMMENT '扩展字段',
	`field12` varchar(255) default NULL  COMMENT '扩展字段',
	`field13` varchar(255) default NULL  COMMENT '扩展字段',
	`field14` varchar(255) default NULL  COMMENT '扩展字段',
	`field15` varchar(255) default NULL  COMMENT '扩展字段',
	`field16` varchar(255) default NULL  COMMENT '扩展字段',
	`field17` varchar(255) default NULL  COMMENT '扩展字段',
	`field18` varchar(255) default NULL  COMMENT '扩展字段',
	`field19` varchar(255) default NULL  COMMENT '扩展字段',
	`field20` varchar(255) default NULL  COMMENT '扩展字段',
	PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='物料主表';

-- ----------------------------
-- Table structure for mortals_iot_materia_bom_tree
-- ----------------------------
DROP TABLE IF EXISTS `mortals_iot_materia_bom_tree`;
CREATE TABLE `mortals_iot_materia_bom_tree`(
	`id` bigint(20) NOT NULL  auto_increment  COMMENT 'ID，自增长',
	`name` varchar(50) NOT NULL  COMMENT 'BOM类目名称，同父类目下不能重名',
	`code` varchar(50) NOT NULL  COMMENT 'BOM类目代码，包含父类目代码',
	`parentId` bigint(20) NOT NULL  COMMENT '父类目ID',
	`isLeaf` int(10) NOT NULL  default '1' COMMENT '是否叶子节点，0否，1是，默认1',
	`materiaId` bigint(20) default NULL  COMMENT '关联materiaId，物料Id',
	`remark` text default NULL  COMMENT '备注',
	`updateTime` datetime NOT NULL  COMMENT '变更时间',
	`updateUser` varchar(50) NOT NULL  COMMENT '变更用户loginName',
	`createTime` datetime NOT NULL  COMMENT '创建时间',
	`createUser` varchar(50) NOT NULL  COMMENT '创建用户loginName',
	PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='物料BOM类目(产品树)';

DROP TABLE IF EXISTS `mortals_iot_materia_bom`;
CREATE TABLE `mortals_iot_materia_bom`(
	`id` bigint(20) NOT NULL  auto_increment  COMMENT 'ID，自增长',
	`selfCode` varchar(200) NOT NULL  COMMENT 'bom短代码，同一产品树下唯一，生成后不可变',
	`code` varchar(50) NOT NULL  COMMENT 'bom代码，包括物料BOM类目代码',
	`bomTreeId` bigint(20) NOT NULL  COMMENT '物料BOM类目ID',
	`bomTreeCode` varchar(50) NOT NULL  COMMENT '物料BOM类目CODE，物料BOM类目代码',
	`materiaId` bigint(20) NOT NULL  COMMENT '所属物料ID，bom与物料一一对应',
	`materiaCode` varchar(50) NOT NULL  COMMENT '所属物料代码',
	`materiaName` varchar(50) NOT NULL  COMMENT '所属物料名称',
	`version` varchar(50) default NULL  COMMENT 'BOM版本，产品版本发布时生成',
	`useType` int(10) NOT NULL  COMMENT 'BOM类型，参数配置-BomUseTypeEBOM,PBOM,MBOM等',
	`status` int(10) NOT NULL  COMMENT 'bom状态，0修订中，10审核中，20已发布；审核中和已发布时不可修改；每发布一次产生一新BOM(即复制一份)，且状态为已发布，不可再修改',
	`remark` varchar(50) default NULL  COMMENT 'bom备注',
	`updateTime` datetime NOT NULL  COMMENT '变更时间',
	`updateUser` varchar(50) NOT NULL  COMMENT '变更用户loginName',
	`createTime` datetime NOT NULL  COMMENT '创建时间',
	`createUser` varchar(50) NOT NULL  COMMENT '创建用户loginName',
	PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='物料BOM单表';

DROP TABLE IF EXISTS `mortals_iot_materia_bom_item`;
CREATE TABLE `mortals_iot_materia_bom_item`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID，自增长',
  `bomId` bigint(20) NULL DEFAULT NULL,
  `materiaId` bigint(20) NOT NULL COMMENT '物料ID',
  `materiaCode` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '物料编码',
  `materiaName` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `materiaBomId` bigint(20) NULL DEFAULT NULL COMMENT '物料bom ID',
  `orderNo` bigint(20) NOT NULL DEFAULT 0 COMMENT '排序号，默认0',
  `groupName` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '分组名称，显示时相同分组名称的按排序号显示在一起，默认null',
  `useNum` bigint(20) NOT NULL DEFAULT 1 COMMENT '用量，默认1',
  `lossRate` int(10) NOT NULL DEFAULT 0 COMMENT '损耗率，0-100，百分比，默认0',
  `required` int(10) NOT NULL DEFAULT 1 COMMENT '必选料，0否，1是，默认1',
  `supplyType` int(10) NOT NULL DEFAULT 10 COMMENT '补给方式，参数配置-MateriaSupplyType10外购，20自产，30外协默认10',
  `supplierId` bigint(20) NULL DEFAULT NULL COMMENT '供应商',
  `updateTime` datetime(0) NOT NULL COMMENT '变更时间',
  `updateUser` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '变更用户loginName',
  `createTime` datetime(0) NOT NULL COMMENT '创建时间',
  `createUser` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '创建用户loginName',
  `field01` bigint(20) NULL DEFAULT NULL COMMENT '扩展字段，数据意义参看扩展字段定义表',
  `field02` bigint(20) NULL DEFAULT NULL COMMENT '扩展字段',
  `field03` bigint(20) NULL DEFAULT NULL COMMENT '扩展字段',
  `field04` bigint(20) NULL DEFAULT NULL COMMENT '扩展字段',
  `field05` bigint(20) NULL DEFAULT NULL COMMENT '扩展字段',
  `field06` bigint(20) NULL DEFAULT NULL COMMENT '扩展字段',
  `field07` bigint(20) NULL DEFAULT NULL COMMENT '扩展字段',
  `field08` bigint(20) NULL DEFAULT NULL COMMENT '扩展字段',
  `field09` bigint(20) NULL DEFAULT NULL COMMENT '扩展字段',
  `field10` bigint(20) NULL DEFAULT NULL COMMENT '扩展字段',
  `field11` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '扩展字段',
  `field12` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '扩展字段',
  `field13` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '扩展字段',
  `field14` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '扩展字段',
  `field15` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '扩展字段',
  `field16` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '扩展字段',
  `field17` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '扩展字段',
  `field18` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '扩展字段',
  `field19` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '扩展字段',
  `field20` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '扩展字段',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '物料BOM单项表' ROW_FORMAT = Dynamic;


-- ----------------------------
-- Table structure for mortals_iot_materia_bom_version
-- ----------------------------
DROP TABLE IF EXISTS `mortals_iot_materia_bom_version`;
CREATE TABLE `mortals_iot_materia_bom_version`(
	`id` bigint(20) NOT NULL  auto_increment  COMMENT 'ID，自增长',
	`bomId` bigint(20) default NULL  COMMENT 'BOM表ID，默认-1,有BOM产品选择',
	`bomCode` varchar(50) default NULL  COMMENT 'BOM代码，包含父类目代码，如WMQ.4G',
	`materiaId` bigint(20) default NULL  COMMENT '所属物料ID',
	`materiaCode` varchar(50) default NULL  COMMENT '所属物料代码',
	`companyCode` varchar(50) default NULL  COMMENT '公司代号，参数配置-VerCompanyCode格物G,智魔王Z,默认G',
	`code` varchar(50) default NULL  COMMENT '扩展编码，扩展编码，发布时会添加到产品代码后面',
	`rdCode` varchar(50) default NULL  COMMENT '研发类型，参数配置-VerRdCode硬件H，嵌入式E，软件S，产品设计P，默认P',
	`verNum01` int(9) default '1' COMMENT '主迭代号，默认1，页面选择',
	`verNum02` int(9) default '0' COMMENT '次迭代号，默认0，页面选择',
	`verNum03` int(9) default '0' COMMENT '修正迭代号，默认0，页面选择',
	`stage` varchar(50) default NULL  COMMENT '阶段标识，参数配置-VerStageCode',
	`stageNum` bigint(20) default '1' COMMENT '阶段号，默认1,向上累加',
	`verCode` varchar(50) default NULL  COMMENT '版本编码，完成版本串如:G-WMQ.ABC.SSS-H01.00.00',
	`publishDesc` text default NULL  COMMENT '发布描述',
	`remark` text default NULL  COMMENT '备注',
	`publishUser` varchar(50) default NULL  COMMENT '版本发布人，登录名loginName',
	`publishTime` datetime default NULL  COMMENT '版本发布时间',
	`sourceFilePath` text default NULL  COMMENT '源文件地址',
	`sourceFileTag` varchar(50) default NULL  COMMENT '源文件标识号',
	`publishFilePath` text default NULL  COMMENT '发布文件地址',
	`publishFileTag` varchar(50) default NULL  COMMENT '发布文件标识号',
	`publishStatus` int(10) default '0' COMMENT '发布状态，0待发布，1审核中，2审核通过，3审核不通过，默认0',
	`processInstanceId` varchar(100) default NULL  COMMENT '实例id，钉钉审批实例id',
	`updateTime` datetime NOT NULL  COMMENT '变更时间',
	`updateUser` varchar(50) NOT NULL  COMMENT '变更用户loginName',
	`createTime` datetime NOT NULL  COMMENT '创建时间',
	`createUser` varchar(50) NOT NULL  COMMENT '创建用户loginName',
	PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='物料BOM版本表';

DROP TABLE IF EXISTS `mortals_iot_materia_category`;
CREATE TABLE `mortals_iot_materia_category`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID，自增长',
  `name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '类目名称，同父类目下不能重名',
  `selfCode` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '类目短代码，同父类目下唯一，生成后不可变',
  `code` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '类目代码，包含父类目代码',
  `startNum` int(9) NOT NULL  default 1 COMMENT '当前物料类目下物料启始数，默认1',
  `parentId` bigint(20) NOT NULL COMMENT '父类目ID',
  `isLeaf` int(10) NOT NULL DEFAULT 1 COMMENT '是否叶子节点，0否，1是，默认1',
  `enabled` int(10) NOT NULL COMMENT '是否启用，0否，1是',
  `remark` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '备注',
  `updateTime` datetime(0) NOT NULL COMMENT '变更时间',
  `updateUser` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '变更用户loginName',
  `createTime` datetime(0) NOT NULL COMMENT '创建时间',
  `createUser` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '创建用户loginName',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '物料类目表' ROW_FORMAT = Dynamic;

-- 添加菜单sql
INSERT INTO `mortals_iot_menu` VALUES (1, '生产', '', 0, 30, 1, 0, 0, '0', 'black-icons cog_4', '', '', 0, 0, 3, NULL, 1, '');
INSERT INTO `mortals_iot_menu` VALUES (2, '附件', '', 0, 50, 1, 0, 0, '0', 'black-icons cog_4', '', '', 0, 0, 3, NULL, 1, '');
INSERT INTO `mortals_iot_menu` VALUES (4, '产品', '', 0, 10, 1, 0, 0, '0', 'black-icons cog_4', '', '', 0, 0, 3, NULL, 1, '');
INSERT INTO `mortals_iot_menu` VALUES (5, '往来方', '', 0, 40, 1, 0, 0, '0', 'black-icons cog_4', '', '', 0, 0, 3, NULL, 1, '');
INSERT INTO `mortals_iot_menu` VALUES (6, '配置', '', 0, 60, 1, 0, 0, '0', 'black-icons cog_4', '', '', 0, 0, 3, NULL, 1, '');
INSERT INTO `mortals_iot_menu` VALUES (101, '资产管理', '/asset/list', 1, 1, 1, 0, 0, '0', NULL, NULL, NULL, 0, 0, 3, NULL, NULL, NULL);
INSERT INTO `mortals_iot_menu` VALUES (103, '资产事件', '/asset/flow/event/list', 1, 3, 1, 0, 0, '0', NULL, NULL, NULL, 0, 0, 3, NULL, NULL, NULL);
INSERT INTO `mortals_iot_menu` VALUES (104, '资产事件日志', '/asset/flow/eventlog/list', 1, 4, 1, 0, 0, '0', NULL, NULL, NULL, 0, 0, 3, NULL, NULL, NULL);
INSERT INTO `mortals_iot_menu` VALUES (105, '资产事件扩展字段', '/asset/flow/eventfield/list', 1, 4, 1, 0, 0, '0', NULL, NULL, NULL, 0, 0, 3, NULL, NULL, NULL);
INSERT INTO `mortals_iot_menu` VALUES (201, '附件', '/attach/list', 2, 1, 1, 0, 0, '0', NULL, NULL, NULL, 0, 0, 3, NULL, NULL, NULL);
INSERT INTO `mortals_iot_menu` VALUES (401, '物料', '/materia/list', 4, 20, 1, 0, 0, '0', NULL, NULL, NULL, 0, 0, 3, NULL, NULL, NULL);
INSERT INTO `mortals_iot_menu` VALUES (404, '物料供应商', '/materia/supplier/list', 4, 90, 1, 0, 0, '0', NULL, NULL, NULL, 0, 0, 3, NULL, NULL, NULL);
INSERT INTO `mortals_iot_menu` VALUES (405, '产品版本', '/materia/bom/version/list', 4, 50, 1, 0, 0, '0', NULL, NULL, NULL, 0, 0, 3, NULL, NULL, NULL);
INSERT INTO `mortals_iot_menu` VALUES (501, '客户', '/partner/list', 5, 1, 1, 0, 0, '0', NULL, NULL, NULL, 0, 0, 3, NULL, NULL, NULL);
INSERT INTO `mortals_iot_menu` VALUES (502, '供应商', '/supplier/list', 5, 1, 1, 0, 0, '0', NULL, NULL, NULL, 0, 0, 3, NULL, NULL, NULL);
INSERT INTO `mortals_iot_menu` VALUES (601, '字段配置', '/config/field/list', 6, 1, 1, 0, 0, '0', NULL, NULL, NULL, 0, 0, 3, NULL, NULL, NULL);
INSERT INTO `mortals_iot_menu` VALUES (9108, '产品BOM', '/materia/bom/list', 4, 45, 1, 0, 1, '0', NULL, NULL, NULL, 0, 0, 3, '2021-01-11 10:19:26', 1, '系统管理员');

-- 添加资源sql
INSERT INTO `mortals_iot_resource` VALUES (301001, '演示管理-演示模块-查看', '/demo/list,/demo/view', 3, 0, '2019-08-07 17:34:57', 1, '系统管理员', NULL);
INSERT INTO `mortals_iot_resource` VALUES (301002, '演示管理-演示模块-维护', '/demo/add,/demo/edit,/demo/delete,/demo/save', 3, 0, '2019-08-22 17:13:04', 1, '系统管理员', NULL);
-- 参数sql
INSERT INTO `mortals_iot_param` VALUES (100, '计量单位', 'MatriaUnitOfMeasure', NULL, '100', '个', 1, 4, 0, NULL, NULL, NULL, NULL);
INSERT INTO `mortals_iot_param` VALUES (101, '计量单位', 'MatriaUnitOfMeasure', NULL, '101', '只', 1, 4, 0, NULL, NULL, NULL, NULL);
INSERT INTO `mortals_iot_param` VALUES (102, '计量单位', 'MatriaUnitOfMeasure', NULL, '102', '件', 1, 4, 0, NULL, NULL, NULL, NULL);
INSERT INTO `mortals_iot_param` VALUES (103, '计量单位', 'MatriaUnitOfMeasure', NULL, '103', '套', 1, 4, 0, NULL, NULL, NULL, NULL);
INSERT INTO `mortals_iot_param` VALUES (104, '计量单位', 'MatriaUnitOfMeasure', NULL, '104', '张', 1, 4, 0, NULL, NULL, NULL, NULL);
INSERT INTO `mortals_iot_param` VALUES (105, '计量单位', 'MatriaUnitOfMeasure', NULL, '105', '块', 1, 4, 0, NULL, NULL, NULL, NULL);
INSERT INTO `mortals_iot_param` VALUES (106, '计量单位', 'MatriaUnitOfMeasure', NULL, '106', '米', 1, 4, 0, NULL, NULL, NULL, NULL);
INSERT INTO `mortals_iot_param` VALUES (200, '补给方式', 'MatriaSupplyType', NULL, '200', '外购', 1, 4, 0, '本企业产品及其组成部分中企业自己加工的零部件', NULL, NULL, NULL);
INSERT INTO `mortals_iot_param` VALUES (201, '补给方式', 'MatriaSupplyType', NULL, '201', '自产', 1, 4, 0, '本企业产品及其组成部分中采购其它企业的产品或零部件。标准件一般作为一种特殊的外购件处理', NULL, NULL, NULL);
INSERT INTO `mortals_iot_param` VALUES (202, '补给方式', 'MatriaSupplyType', NULL, '202', '外协', 1, 4, 0, '本企业产品及其组成部分中采购其它企业或分厂的产品或零部件，但由本企业负责图纸和工艺设计', NULL, NULL, NULL);
INSERT INTO `mortals_iot_param` VALUES (300, 'BOM用途', 'BomUseType', NULL, '300', '设计BOM', 1, 4, 0, '主要是设计部门产生的数据，产品设计人员根据客户订单或者设计要求进行产品设计，生成包括产品名称、产品结构、明细表、汇总表、产品使用说明书、装箱清单等信息，这些信息大部分包括在EBOM中。EBOM是工艺、制造等后续部门的其它应用系统所需产品数据的基础', NULL, NULL, NULL);
INSERT INTO `mortals_iot_param` VALUES (301, 'BOM用途', 'BomUseType', NULL, '301', '生产BOM', 1, 4, 0, '', NULL, NULL, NULL);
INSERT INTO `mortals_iot_param` VALUES (302, 'BOM用途', 'BomUseType', NULL, '302', '包装BOM', 1, 4, 0, '', NULL, NULL, NULL);
INSERT INTO `mortals_iot_param` VALUES (303, 'BOM用途', 'BomUseType', NULL, '303', '维修BOM', 1, 4, 0, '', NULL, NULL, NULL);
INSERT INTO `mortals_iot_param` VALUES (349, 'BOM用途', 'BomUseType', NULL, '349', '其它BOM', 1, 4, 0, '', NULL, NULL, NULL);
INSERT INTO `mortals_iot_param` VALUES (401, 'BOM状态', 'BomStatus', NULL, '401', '修订中', 1, 4, 0, NULL, NULL, NULL, NULL);
INSERT INTO `mortals_iot_param` VALUES (402, 'BOM状态', 'BomStatus', NULL, '402', '审核中', 1, 4, 0, NULL, NULL, NULL, NULL);
INSERT INTO `mortals_iot_param` VALUES (403, 'BOM状态', 'BomStatus', NULL, '403', '已发布', 1, 4, 0, NULL, NULL, NULL, NULL);
INSERT INTO `mortals_iot_param` VALUES (601, '公司代码', 'VerCompanyCode', NULL, 'G', '格物-G', 1, 4, 0, NULL, NULL, NULL, NULL);
INSERT INTO `mortals_iot_param` VALUES (602, '公司代码', 'VerCompanyCode', NULL, 'Z', '智魔王-Z', 1, 4, 0, NULL, NULL, NULL, NULL);
INSERT INTO `mortals_iot_param` VALUES (701, '研发类型', 'VerRdCode', NULL, 'H', '硬件研发(H)', 1, 4, 0, NULL, NULL, NULL, NULL);
INSERT INTO `mortals_iot_param` VALUES (702, '研发类型', 'VerRdCode', NULL, 'E', '软件研发-嵌入式类(E)', 1, 4, 0, NULL, NULL, NULL, NULL);
INSERT INTO `mortals_iot_param` VALUES (703, '研发类型', 'VerRdCode', NULL, 'S', '软件研发-业务应用类(S)', 1, 4, 0, NULL, NULL, NULL, NULL);
INSERT INTO `mortals_iot_param` VALUES (704, '研发类型', 'VerRdCode', NULL, 'P', '产品设计类(P)', 1, 4, 0, NULL, NULL, NULL, NULL);
INSERT INTO `mortals_iot_param` VALUES (801, '阶段标识', 'VerStageCode', NULL, 'A', 'alpha', 1, 4, 0, NULL, NULL, NULL, NULL);
INSERT INTO `mortals_iot_param` VALUES (802, '阶段标识', 'VerStageCode', NULL, 'B', 'beta', 1, 4, 0, NULL, NULL, NULL, NULL);
INSERT INTO `mortals_iot_param` VALUES (803, '阶段标识', 'VerStageCode', NULL, 'PV', 'preview', 1, 4, 0, NULL, NULL, NULL, NULL);
INSERT INTO `mortals_iot_param` VALUES (804, '阶段标识', 'VerStageCode', NULL, 'R', 'release', 1, 4, 0, NULL, NULL, NULL, NULL);
INSERT INTO `mortals_iot_param` VALUES (805, '附件分类', 'MateriaAttachType', NULL, '1', '设计图纸', 1, 4, 0, NULL, '2021-01-14 18:20:51', 1, '系统管理员');

-- 扩展字段定义添加sql
INSERT INTO `mortals_iot_config_field` VALUES (1, 'mortals_iot_materia', 'field01', '扩展字段01', 'bigint', 20, 0, 0, NULL, 0, '2021-01-04 11:46:48', 'admin', '2021-01-04 11:46:50', 'admin');
INSERT INTO `mortals_iot_config_field` VALUES (2, 'mortals_iot_materia', 'field02', '扩展字段02', 'bigint', 20, 0, 0, NULL, 0, '2021-01-04 11:46:48', 'admin', '2021-01-04 11:46:50', 'admin');
INSERT INTO `mortals_iot_config_field` VALUES (3, 'mortals_iot_materia', 'field03', '扩展字段03', 'bigint', 20, 0, 0, NULL, 0, '2021-01-04 11:46:48', 'admin', '2021-01-04 11:46:50', 'admin');
INSERT INTO `mortals_iot_config_field` VALUES (4, 'mortals_iot_materia', 'field04', '扩展字段04', 'bigint', 20, 0, 0, NULL, 0, '2021-01-04 11:46:48', 'admin', '2021-01-04 11:46:50', 'admin');
INSERT INTO `mortals_iot_config_field` VALUES (5, 'mortals_iot_materia', 'field05', '扩展字段05', 'bigint', 20, 0, 0, NULL, 0, '2021-01-04 11:46:48', 'admin', '2021-01-04 11:46:50', 'admin');
INSERT INTO `mortals_iot_config_field` VALUES (6, 'mortals_iot_materia', 'field06', '扩展字段06', 'bigint', 20, 0, 0, NULL, 0, '2021-01-04 11:46:48', 'admin', '2021-01-04 11:46:50', 'admin');
INSERT INTO `mortals_iot_config_field` VALUES (7, 'mortals_iot_materia', 'field07', '扩展字段07', 'bigint', 20, 0, 0, NULL, 0, '2021-01-04 11:46:48', 'admin', '2021-01-04 11:46:50', 'admin');
INSERT INTO `mortals_iot_config_field` VALUES (8, 'mortals_iot_materia', 'field08', '扩展字段08', 'bigint', 20, 0, 0, NULL, 0, '2021-01-04 11:46:48', 'admin', '2021-01-04 11:46:50', 'admin');
INSERT INTO `mortals_iot_config_field` VALUES (9, 'mortals_iot_materia', 'field09', '扩展字段09', 'bigint', 20, 0, 0, NULL, 0, '2021-01-04 11:46:48', 'admin', '2021-01-04 11:46:50', 'admin');
INSERT INTO `mortals_iot_config_field` VALUES (10, 'mortals_iot_materia', 'field10', '扩展字段10', 'bigint', 20, 0, 0, NULL, 0, '2021-01-04 11:46:48', 'admin', '2021-01-04 11:46:50', 'admin');
INSERT INTO `mortals_iot_config_field` VALUES (11, 'mortals_iot_materia', 'field11', '材质', 'varchar', 20, 0, 0, NULL, 1, '2021-04-07 13:27:46', 'admin', '2021-01-04 11:46:50', 'admin');
INSERT INTO `mortals_iot_config_field` VALUES (12, 'mortals_iot_materia', 'field12', '厚度', 'varchar', 20, 0, 0, NULL, 1, '2021-04-07 13:34:19', 'admin', '2021-01-04 11:46:50', 'admin');
INSERT INTO `mortals_iot_config_field` VALUES (13, 'mortals_iot_materia', 'field13', '封装', 'varchar', 20, 0, 0, NULL, 1, '2021-01-04 11:46:48', 'admin', '2021-01-04 11:46:50', 'admin');
INSERT INTO `mortals_iot_config_field` VALUES (14, 'mortals_iot_materia', 'field14', '位号', 'varchar', 20, 0, 0, NULL, 1, '2021-01-04 11:46:48', 'admin', '2021-01-04 11:46:50', 'admin');
INSERT INTO `mortals_iot_config_field` VALUES (15, 'mortals_iot_materia', 'field15', '扩展字段15', 'varchar', 20, 0, 0, NULL, 0, '2021-01-04 11:46:48', 'admin', '2021-01-04 11:46:50', 'admin');
INSERT INTO `mortals_iot_config_field` VALUES (16, 'mortals_iot_materia', 'field16', '扩展字段16', 'varchar', 20, 0, 0, NULL, 0, '2021-01-04 11:46:48', 'admin', '2021-01-04 11:46:50', 'admin');
INSERT INTO `mortals_iot_config_field` VALUES (17, 'mortals_iot_materia', 'field17', '扩展字段17', 'varchar', 20, 0, 0, NULL, 0, '2021-01-04 11:46:48', 'admin', '2021-01-04 11:46:50', 'admin');
INSERT INTO `mortals_iot_config_field` VALUES (18, 'mortals_iot_materia', 'field18', '扩展字段18', 'varchar', 20, 0, 0, NULL, 0, '2021-01-04 11:46:48', 'admin', '2021-01-04 11:46:50', 'admin');
INSERT INTO `mortals_iot_config_field` VALUES (19, 'mortals_iot_materia', 'field19', '扩展字段19', 'varchar', 20, 0, 0, NULL, 0, '2021-01-04 11:46:48', 'admin', '2021-01-04 11:46:50', 'admin');
INSERT INTO `mortals_iot_config_field` VALUES (20, 'mortals_iot_materia', 'field20', '扩展字段20', 'varchar', 20, 0, 0, NULL, 0, '2021-01-04 11:46:48', 'admin', '2021-01-04 11:46:50', 'admin');
INSERT INTO `mortals_iot_config_field` VALUES (21, 'mortals_iot_materia_bom_item', 'field01', '扩展字段01', 'bigint', 20, 0, 0, NULL, 0, '2021-04-06 18:07:30', 'admin', '2021-01-04 11:46:50', 'admin');
INSERT INTO `mortals_iot_config_field` VALUES (22, 'mortals_iot_materia_bom_item', 'field02', '扩展字段02', 'bigint', 20, 0, 0, NULL, 0, '2021-04-06 18:07:40', 'admin', '2021-01-04 11:46:50', 'admin');
INSERT INTO `mortals_iot_config_field` VALUES (23, 'mortals_iot_materia_bom_item', 'field03', '扩展字段03', 'bigint', 20, 0, 0, NULL, 0, '2021-01-04 11:46:48', 'admin', '2021-01-04 11:46:50', 'admin');
INSERT INTO `mortals_iot_config_field` VALUES (24, 'mortals_iot_materia_bom_item', 'field04', '扩展字段04', 'bigint', 20, 0, 0, NULL, 0, '2021-01-04 11:46:48', 'admin', '2021-01-04 11:46:50', 'admin');
INSERT INTO `mortals_iot_config_field` VALUES (25, 'mortals_iot_materia_bom_item', 'field05', '扩展字段05', 'bigint', 20, 0, 0, NULL, 0, '2021-01-04 11:46:48', 'admin', '2021-01-04 11:46:50', 'admin');
INSERT INTO `mortals_iot_config_field` VALUES (26, 'mortals_iot_materia_bom_item', 'field06', '扩展字段06', 'bigint', 20, 0, 0, NULL, 0, '2021-01-04 11:46:48', 'admin', '2021-01-04 11:46:50', 'admin');
INSERT INTO `mortals_iot_config_field` VALUES (27, 'mortals_iot_materia_bom_item', 'field07', '扩展字段07', 'bigint', 20, 0, 0, NULL, 0, '2021-01-04 11:46:48', 'admin', '2021-01-04 11:46:50', 'admin');
INSERT INTO `mortals_iot_config_field` VALUES (28, 'mortals_iot_materia_bom_item', 'field08', '扩展字段08', 'bigint', 20, 0, 0, NULL, 0, '2021-01-04 11:46:48', 'admin', '2021-01-04 11:46:50', 'admin');
INSERT INTO `mortals_iot_config_field` VALUES (29, 'mortals_iot_materia_bom_item', 'field09', '扩展字段09', 'bigint', 20, 0, 0, NULL, 0, '2021-01-04 11:46:48', 'admin', '2021-01-04 11:46:50', 'admin');
INSERT INTO `mortals_iot_config_field` VALUES (30, 'mortals_iot_materia_bom_item', 'field10', '扩展字段10', 'bigint', 20, 0, 0, NULL, 0, '2021-01-04 11:46:48', 'admin', '2021-01-04 11:46:50', 'admin');
INSERT INTO `mortals_iot_config_field` VALUES (31, 'mortals_iot_materia_bom_item', 'field11', '材质', 'varchar', 20, 0, 0, NULL, 1, '2021-04-06 18:13:04', 'admin', '2021-01-04 11:46:50', 'admin');
INSERT INTO `mortals_iot_config_field` VALUES (32, 'mortals_iot_materia_bom_item', 'field12', '厚度', 'varchar', 20, 0, 0, NULL, 1, '2021-04-06 18:13:10', 'admin', '2021-01-04 11:46:50', 'admin');
INSERT INTO `mortals_iot_config_field` VALUES (33, 'mortals_iot_materia_bom_item', 'field13', '封装', 'varchar', 20, 0, 0, NULL, 1, '2021-04-07 13:17:36', 'admin', '2021-01-04 11:46:50', 'admin');
INSERT INTO `mortals_iot_config_field` VALUES (34, 'mortals_iot_materia_bom_item', 'field14', '位号', 'varchar', 20, 0, 0, NULL, 1, '2021-04-07 13:17:54', 'admin', '2021-01-04 11:46:50', 'admin');
INSERT INTO `mortals_iot_config_field` VALUES (35, 'mortals_iot_materia_bom_item', 'field15', '扩展字段15', 'varchar', 20, 0, 0, NULL, 0, '2021-04-06 18:13:28', 'admin', '2021-01-04 11:46:50', 'admin');
INSERT INTO `mortals_iot_config_field` VALUES (36, 'mortals_iot_materia_bom_item', 'field16', '扩展字段16', 'varchar', 20, 0, 0, NULL, 0, '2021-04-06 18:13:42', 'admin', '2021-01-04 11:46:50', 'admin');
INSERT INTO `mortals_iot_config_field` VALUES (37, 'mortals_iot_materia_bom_item', 'field17', '扩展字段17', 'varchar', 20, 0, 0, NULL, 0, '2021-04-06 18:13:48', 'admin', '2021-01-04 11:46:50', 'admin');
INSERT INTO `mortals_iot_config_field` VALUES (38, 'mortals_iot_materia_bom_item', 'field18', '扩展字段18', 'varchar', 20, 0, 0, NULL, 0, '2021-04-06 18:13:54', 'admin', '2021-01-04 11:46:50', 'admin');
INSERT INTO `mortals_iot_config_field` VALUES (39, 'mortals_iot_materia_bom_item', 'field19', '扩展字段19', 'varchar', 20, 0, 0, NULL, 0, '2021-04-06 18:14:01', 'admin', '2021-01-04 11:46:50', 'admin');
INSERT INTO `mortals_iot_config_field` VALUES (40, 'mortals_iot_materia_bom_item', 'field20', '扩展字段20', 'varchar', 20, 0, 0, NULL, 0, '2021-04-06 18:14:07', 'admin', '2021-01-04 11:46:50', 'admin');


-- 添加数据sql(测试等)
-- ----------------------------
-- Records of mortals_iot_idgenerator
-- ----------------------------
INSERT INTO `mortals_iot_idgenerator` VALUES (1, 'INFO_VERSION_KEY', 1, '基础信息版本号生成因子', 0, '2019-04-18 18:00:00');
INSERT INTO `mortals_iot_idgenerator` VALUES (2, 'MATERIA_CODE_KEY', 10150, '物料编码生成因子', 3, '2020-12-30 16:17:33');
-- ----------------------------
-- Records of mortals_iot_materia
-- ----------------------------


-- 插入提前定义的事件状态
INSERT INTO `mortals_iot_param` VALUES (500, '资产流转状态', 'AssetFlowStatus', NULL, '500', '待生产', 1, 4, 0, NULL, NULL, NULL, NULL);
INSERT INTO `mortals_iot_param` VALUES (501, '资产流转状态', 'AssetFlowStatus', NULL, '501', '生产中', 1, 4, 0, NULL, NULL, NULL, NULL);
INSERT INTO `mortals_iot_param` VALUES (502, '资产流转状态', 'AssetFlowStatus', NULL, '502', '待验收', 1, 4, 0, NULL, NULL, NULL, NULL);
INSERT INTO `mortals_iot_param` VALUES (504, '资产流转状态', 'AssetFlowStatus', NULL, '504', '待出厂', 1, 4, 0, NULL, NULL, NULL, NULL);
INSERT INTO `mortals_iot_param` VALUES (505, '资产流转状态', 'AssetFlowStatus', NULL, '505', '待入库', 1, 4, 0, NULL, NULL, NULL, NULL);
INSERT INTO `mortals_iot_param` VALUES (506, '资产流转状态', 'AssetFlowStatus', NULL, '506', '已入库', 1, 4, 0, NULL, NULL, NULL, NULL);
INSERT INTO `mortals_iot_param` VALUES (507, '资产流转状态', 'AssetFlowStatus', NULL, '507', '技改中', 1, 4, 0, NULL, NULL, NULL, NULL);
INSERT INTO `mortals_iot_param` VALUES (508, '资产流转状态', 'AssetFlowStatus', NULL, '508', '调拨待入库', 1, 4, 0, NULL, NULL, NULL, NULL);
INSERT INTO `mortals_iot_param` VALUES (509, '资产流转状态', 'AssetFlowStatus', NULL, '509', '已售出', 1, 4, 0, NULL, NULL, NULL, NULL);
INSERT INTO `mortals_iot_param` VALUES (510, '资产流转状态', 'AssetFlowStatus', NULL, '510', '已出库待投放', 1, 4, 0, NULL, NULL, NULL, NULL);
INSERT INTO `mortals_iot_param` VALUES (511, '资产流转状态', 'AssetFlowStatus', NULL, '511', '已投放', 1, 4, 0, NULL, NULL, NULL, NULL);
INSERT INTO `mortals_iot_param` VALUES (512, '资产流转状态', 'AssetFlowStatus', NULL, '512', '撤离待回库', 1, 4, 0, NULL, NULL, NULL, NULL);
INSERT INTO `mortals_iot_param` VALUES (513, '资产流转状态', 'AssetFlowStatus', NULL, '513', '撤离待重投', 1, 4, 0, NULL, NULL, NULL, NULL);
INSERT INTO `mortals_iot_param` VALUES (514, '资产流转状态', 'AssetFlowStatus', NULL, '514', '维修中', 1, 4, 0, NULL, NULL, NULL, NULL);
INSERT INTO `mortals_iot_param` VALUES (515, '资产流转状态', 'AssetFlowStatus', NULL, '515', '已报废', 1, 4, 0, NULL, NULL, NULL, NULL);
INSERT INTO `mortals_iot_param` VALUES (516, '资产流转状态', 'AssetFlowStatus', NULL, '516', '运输中', 1, 4, 0, NULL, NULL, NULL, NULL);
INSERT INTO `mortals_iot_param` VALUES (597, '资产流转状态', 'AssetFlowStatus', NULL, '597', '任意状态(流入时可用)', 1, 4, 0, NULL, NULL, NULL, NULL);
INSERT INTO `mortals_iot_param` VALUES (598, '资产流转状态', 'AssetFlowStatus', NULL, '598', '回前状态(流出时可用)', 1, 4, 0, NULL, NULL, NULL, NULL);
INSERT INTO `mortals_iot_param` VALUES (599, '资产流转状态', 'AssetFlowStatus', NULL, '599', '不变状态(流出时可用)', 1, 4, 0, NULL, NULL, NULL, NULL);

-- 事件表新增排序号字段
ALTER TABLE `mortals_iot_asset_flow_event`
    ADD COLUMN `orderNo` int(10) NOT NULL DEFAULT 0 COMMENT '排序号，查询时列表按照此字段排序； 默认0' AFTER `script`;

-- 插入提前定义的事件
INSERT INTO `mortals_iot_asset_flow_event`(`id`, `name`, `code`, `enabled`, `beforeFlowStatus`, `afterFlowStatus`, `script`, `orderNo`, `remark`, `updateTime`, `updateUser`, `createTime`, `createUser`) VALUES (1, '生成资产码事件', '101', 1, '500', 500, 'DefaultAssetFlowEventHandler', 1, NULL, '2021-03-03 10:18:15', 'admin', '2021-01-11 15:27:17', 'admin');
INSERT INTO `mortals_iot_asset_flow_event`(`id`, `name`, `code`, `enabled`, `beforeFlowStatus`, `afterFlowStatus`, `script`, `orderNo`, `remark`, `updateTime`, `updateUser`, `createTime`, `createUser`) VALUES (2, '下单生产事件', '102', 1, '500', 501, 'DefaultAssetFlowEventHandler', 2, NULL, '2021-03-03 10:18:25', 'admin', '2021-01-11 11:09:25', 'admin');
INSERT INTO `mortals_iot_asset_flow_event`(`id`, `name`, `code`, `enabled`, `beforeFlowStatus`, `afterFlowStatus`, `script`, `orderNo`, `remark`, `updateTime`, `updateUser`, `createTime`, `createUser`) VALUES (3, '资码绑定事件', '103', 1, '501', 502, 'DefaultAssetFlowEventHandler', 3, NULL, '2021-03-03 10:40:55', 'admin', '2021-01-11 11:24:48', 'admin');
INSERT INTO `mortals_iot_asset_flow_event`(`id`, `name`, `code`, `enabled`, `beforeFlowStatus`, `afterFlowStatus`, `script`, `orderNo`, `remark`, `updateTime`, `updateUser`, `createTime`, `createUser`) VALUES (4, '验收事件', '104', 1, '502', 504, 'DefaultAssetFlowEventHandler', 4, NULL, '2021-03-03 10:41:01', 'admin', '2021-01-11 13:30:23', 'admin');
INSERT INTO `mortals_iot_asset_flow_event`(`id`, `name`, `code`, `enabled`, `beforeFlowStatus`, `afterFlowStatus`, `script`, `orderNo`, `remark`, `updateTime`, `updateUser`, `createTime`, `createUser`) VALUES (5, '出厂事件', '105', 1, '504', 505, 'DefaultAssetFlowEventHandler', 5, NULL, '2021-03-03 10:23:22', 'admin', '2021-01-11 14:56:43', 'admin');
INSERT INTO `mortals_iot_asset_flow_event`(`id`, `name`, `code`, `enabled`, `beforeFlowStatus`, `afterFlowStatus`, `script`, `orderNo`, `remark`, `updateTime`, `updateUser`, `createTime`, `createUser`) VALUES (6, '出厂入库事件', '106', 1, '505', 506, 'DefaultAssetFlowEventHandler', 6, NULL, '2021-03-03 10:23:28', 'admin', '2021-01-11 14:59:50', 'admin');
INSERT INTO `mortals_iot_asset_flow_event`(`id`, `name`, `code`, `enabled`, `beforeFlowStatus`, `afterFlowStatus`, `script`, `orderNo`, `remark`, `updateTime`, `updateUser`, `createTime`, `createUser`) VALUES (7, '业务码绑定事件', '107', 0, '597', 599, 'DeviceCodeBindEventHandler', 7, NULL, '2021-03-23 15:50:36', 'admin', '2021-01-11 15:20:45', 'admin');
INSERT INTO `mortals_iot_asset_flow_event`(`id`, `name`, `code`, `enabled`, `beforeFlowStatus`, `afterFlowStatus`, `script`, `orderNo`, `remark`, `updateTime`, `updateUser`, `createTime`, `createUser`) VALUES (8, '物流发货事件', '108', 1, '597', 599, 'DefaultAssetFlowEventHandler', 8, NULL, '2021-03-03 10:24:13', 'admin', '2021-01-11 15:27:17', 'admin');
INSERT INTO `mortals_iot_asset_flow_event`(`id`, `name`, `code`, `enabled`, `beforeFlowStatus`, `afterFlowStatus`, `script`, `orderNo`, `remark`, `updateTime`, `updateUser`, `createTime`, `createUser`) VALUES (9, '物流收货事件', '109', 1, '597', 599, 'DefaultAssetFlowEventHandler', 9, NULL, '2021-03-03 10:24:24', 'admin', '2021-01-11 15:27:17', 'admin');
INSERT INTO `mortals_iot_asset_flow_event`(`id`, `name`, `code`, `enabled`, `beforeFlowStatus`, `afterFlowStatus`, `script`, `orderNo`, `remark`, `updateTime`, `updateUser`, `createTime`, `createUser`) VALUES (10, '返厂技改(维护)事件', '110', 1, '505,506,508,510,511,513,512', 507, 'DefaultAssetFlowEventHandler', 10, NULL, '2021-03-03 13:40:34', 'admin', '2021-01-11 15:02:55', 'admin');
INSERT INTO `mortals_iot_asset_flow_event`(`id`, `name`, `code`, `enabled`, `beforeFlowStatus`, `afterFlowStatus`, `script`, `orderNo`, `remark`, `updateTime`, `updateUser`, `createTime`, `createUser`) VALUES (11, '技改完成(维护)事件', '111', 1, '507', 502, 'DefaultAssetFlowEventHandler', 11, NULL, '2021-03-05 10:29:15', 'admin', '2021-03-02 11:29:29', 'admin');
INSERT INTO `mortals_iot_asset_flow_event`(`id`, `name`, `code`, `enabled`, `beforeFlowStatus`, `afterFlowStatus`, `script`, `orderNo`, `remark`, `updateTime`, `updateUser`, `createTime`, `createUser`) VALUES (12, '调拨出库事件', '112', 1, '506', 508, 'DefaultAssetFlowEventHandler', 12, NULL, '2021-03-03 10:30:34', 'admin', '2021-03-03 10:30:34', 'admin');
INSERT INTO `mortals_iot_asset_flow_event`(`id`, `name`, `code`, `enabled`, `beforeFlowStatus`, `afterFlowStatus`, `script`, `orderNo`, `remark`, `updateTime`, `updateUser`, `createTime`, `createUser`) VALUES (13, '调拨入库事件', '113', 1, '508', 506, 'DefaultAssetFlowEventHandler', 13, NULL, '2021-03-03 10:31:12', 'admin', '2021-03-03 10:31:12', 'admin');
INSERT INTO `mortals_iot_asset_flow_event`(`id`, `name`, `code`, `enabled`, `beforeFlowStatus`, `afterFlowStatus`, `script`, `orderNo`, `remark`, `updateTime`, `updateUser`, `createTime`, `createUser`) VALUES (14, '回收入库事件', '114', 1, '509', 506, 'DefaultAssetFlowEventHandler', 14, NULL, '2021-03-03 10:32:22', 'admin', '2021-03-03 10:32:22', 'admin');
INSERT INTO `mortals_iot_asset_flow_event`(`id`, `name`, `code`, `enabled`, `beforeFlowStatus`, `afterFlowStatus`, `script`, `orderNo`, `remark`, `updateTime`, `updateUser`, `createTime`, `createUser`) VALUES (15, '售出出库事件', '115', 1, '506', 509, 'DefaultAssetFlowEventHandler', 15, NULL, '2021-03-03 10:44:41', 'admin', '2021-01-11 15:00:54', 'admin');
INSERT INTO `mortals_iot_asset_flow_event`(`id`, `name`, `code`, `enabled`, `beforeFlowStatus`, `afterFlowStatus`, `script`, `orderNo`, `remark`, `updateTime`, `updateUser`, `createTime`, `createUser`) VALUES (16, '投放出库事件', '116', 1, '506', 510, 'DefaultAssetFlowEventHandler', 16, NULL, '2021-03-03 10:33:29', 'admin', '2021-01-11 15:01:58', 'admin');
INSERT INTO `mortals_iot_asset_flow_event`(`id`, `name`, `code`, `enabled`, `beforeFlowStatus`, `afterFlowStatus`, `script`, `orderNo`, `remark`, `updateTime`, `updateUser`, `createTime`, `createUser`) VALUES (17, '投放确认事件', '117', 1, '510,513', 511, 'DeviceInstallEventHandler', 17, NULL, '2021-03-18 17:17:47', 'admin', '2021-01-11 15:04:25', 'admin');
INSERT INTO `mortals_iot_asset_flow_event`(`id`, `name`, `code`, `enabled`, `beforeFlowStatus`, `afterFlowStatus`, `script`, `orderNo`, `remark`, `updateTime`, `updateUser`, `createTime`, `createUser`) VALUES (18, '撤离回库事件', '118', 1, '511', 512, 'DeviceRemoveEventHandler', 18, NULL, '2021-03-18 17:18:22', 'admin', '2021-01-11 15:05:12', 'admin');
INSERT INTO `mortals_iot_asset_flow_event`(`id`, `name`, `code`, `enabled`, `beforeFlowStatus`, `afterFlowStatus`, `script`, `orderNo`, `remark`, `updateTime`, `updateUser`, `createTime`, `createUser`) VALUES (19, '撤离回库入库事件', '119', 1, '512', 506, 'DefaultAssetFlowEventHandler', 19, NULL, '2021-03-03 10:36:37', 'admin', '2021-03-03 10:36:13', 'admin');
INSERT INTO `mortals_iot_asset_flow_event`(`id`, `name`, `code`, `enabled`, `beforeFlowStatus`, `afterFlowStatus`, `script`, `orderNo`, `remark`, `updateTime`, `updateUser`, `createTime`, `createUser`) VALUES (20, '撤离重投事件', '120', 1, '511', 513, 'DeviceRemoveEventHandler', 20, NULL, '2021-03-18 17:18:06', 'admin', '2021-01-11 15:06:12', 'admin');
INSERT INTO `mortals_iot_asset_flow_event`(`id`, `name`, `code`, `enabled`, `beforeFlowStatus`, `afterFlowStatus`, `script`, `orderNo`, `remark`, `updateTime`, `updateUser`, `createTime`, `createUser`) VALUES (21, '维修事件', '121', 1, '505,506,508,510,511,512,513', 514, 'DefaultAssetFlowEventHandler', 21, NULL, '2021-03-03 10:37:02', 'admin', '2021-01-11 15:22:15', 'admin');
INSERT INTO `mortals_iot_asset_flow_event`(`id`, `name`, `code`, `enabled`, `beforeFlowStatus`, `afterFlowStatus`, `script`, `orderNo`, `remark`, `updateTime`, `updateUser`, `createTime`, `createUser`) VALUES (22, '维修完成事件', '122', 1, '514', 598, 'DeviceMaintainEventHandler', 22, NULL, '2021-03-19 13:55:23', 'admin', '2021-01-11 15:27:17', 'admin');
INSERT INTO `mortals_iot_asset_flow_event`(`id`, `name`, `code`, `enabled`, `beforeFlowStatus`, `afterFlowStatus`, `script`, `orderNo`, `remark`, `updateTime`, `updateUser`, `createTime`, `createUser`) VALUES (23, '巡检事件', '123', 1, '597', 599, 'DevicePollingEventHandler', 23, NULL, '2021-03-19 13:51:42', 'admin', '2021-01-11 15:27:17', 'admin');
INSERT INTO `mortals_iot_asset_flow_event`(`id`, `name`, `code`, `enabled`, `beforeFlowStatus`, `afterFlowStatus`, `script`, `orderNo`, `remark`, `updateTime`, `updateUser`, `createTime`, `createUser`) VALUES (24, '报废事件', '124', 1, '502,514', 515, 'DefaultAssetFlowEventHandler', 24, NULL, '2021-03-03 10:37:36', 'admin', '2021-01-11 15:08:04', 'admin');
INSERT INTO `mortals_iot_asset_flow_event`(`id`, `name`, `code`, `enabled`, `beforeFlowStatus`, `afterFlowStatus`, `script`, `orderNo`, `remark`, `updateTime`, `updateUser`, `createTime`, `createUser`) VALUES (25, '零售补货事件', '125', 1, '511', 599, 'ReplenishmentEventHandler', 25, NULL, '2021-03-25 10:11:55', 'admin', '2021-03-09 14:17:44', 'admin');

-- 往来方标签
INSERT INTO `mortals_iot_param` VALUES (901, '客户标签', 'PartnerTags', NULL, '100001', '普通客户', 1, 4, 0, NULL, '2021-01-14 18:20:51', 1, '系统管理员');
INSERT INTO `mortals_iot_param` VALUES (902, '客户标签', 'PartnerTags', NULL, '100002', '代理商', 1, 4, 0, NULL, '2021-01-14 18:20:51', 1, '系统管理员'); 
INSERT INTO `mortals_iot_param` VALUES (951, '供应商标签', 'SupplierTags', NULL, '200001', '普通供应商', 1, 4, 0, NULL, '2021-01-14 18:20:51', 1, '系统管理员');
INSERT INTO `mortals_iot_param` VALUES (952, '供应商标签', 'SupplierTags', NULL, '200002', '物流公司', 1, 4, 0, NULL, '2021-01-14 18:20:51', 1, '系统管理员');

-- 往来方性质
INSERT INTO `mortals_iot_param` VALUES (1001, '往来方性质', 'PartnerNature', NULL, '10', '私企', 1, 4, 0, NULL, '2021-01-14 18:20:51', 1, '系统管理员');
INSERT INTO `mortals_iot_param` VALUES (1002, '往来方性质', 'PartnerNature', NULL, '20', '国企', 1, 4, 0, NULL, '2021-01-14 18:20:51', 1, '系统管理员');
INSERT INTO `mortals_iot_param` VALUES (1003, '往来方性质', 'PartnerNature', NULL, '30', '外企', 1, 4, 0, NULL, '2021-01-14 18:20:51', 1, '系统管理员');
INSERT INTO `mortals_iot_param` VALUES (1004, '往来方性质', 'PartnerNature', NULL, '40', '合资', 1, 4, 0, NULL, '2021-01-14 18:20:51', 1, '系统管理员');
INSERT INTO `mortals_iot_param` VALUES (1005, '往来方性质', 'PartnerNature', NULL, '50', '个体工商户', 1, 4, 0, NULL, '2021-01-14 18:20:51', 1, '系统管理员');
INSERT INTO `mortals_iot_param` VALUES (1006, '往来方性质', 'PartnerNature', NULL, '60', '个人', 1, 4, 0, NULL, '2021-01-14 18:20:51', 1, '系统管理员');
INSERT INTO `mortals_iot_param` VALUES (1099, '往来方性质', 'PartnerNature', NULL, '99', '其他', 1, 4, 0, NULL, '2021-01-14 18:20:51', 1, '系统管理员');

-- 结算方式
INSERT INTO `mortals_iot_param` VALUES (1101, '结算方式', 'PartnerSettlementType', NULL, '10', '现金结算', 1, 4, 0, NULL, '2021-01-14 18:20:51', 1, '系统管理员');
INSERT INTO `mortals_iot_param` VALUES (1102, '结算方式', 'PartnerSettlementType', NULL, '20', '票据转让', 1, 4, 0, NULL, '2021-01-14 18:20:51', 1, '系统管理员');
INSERT INTO `mortals_iot_param` VALUES (1103, '结算方式', 'PartnerSettlementType', NULL, '30', '转账结算', 1, 4, 0, NULL, '2021-01-14 18:20:51', 1, '系统管理员');
INSERT INTO `mortals_iot_param` VALUES (1199, '结算方式', 'PartnerSettlementType', NULL, '99', '其他', 1, 4, 0, NULL, '2021-01-14 18:20:51', 1, '系统管理员');

-- 交期单位
INSERT INTO `mortals_iot_param` VALUES (1201, '交期单位', 'DeliveryPeriodUnit', NULL, '10', '小时', 1, 4, 0, NULL, '2021-01-14 18:20:51', 1, '系统管理员');
INSERT INTO `mortals_iot_param` VALUES (1202, '交期单位', 'DeliveryPeriodUnit', NULL, '20', '工作日', 1, 4, 0, NULL, '2021-01-14 18:20:51', 1, '系统管理员');
INSERT INTO `mortals_iot_param` VALUES (1203, '交期单位', 'DeliveryPeriodUnit', NULL, '30', '自然日', 1, 4, 0, NULL, '2021-01-14 18:20:51', 1, '系统管理员');
INSERT INTO `mortals_iot_param` VALUES (1204, '交期单位', 'DeliveryPeriodUnit', NULL, '40', '周', 1, 4, 0, NULL, '2021-01-14 18:20:51', 1, '系统管理员');
INSERT INTO `mortals_iot_param` VALUES (1205, '交期单位', 'DeliveryPeriodUnit', NULL, '50', '月', 1, 4, 0, NULL, '2021-01-14 18:20:51', 1, '系统管理员');

-- 仓库表
DROP TABLE IF EXISTS `mortals_iot_warehouse`;
CREATE TABLE `mortals_iot_warehouse`(
    `id` bigint(20) NOT NULL  auto_increment  COMMENT 'ID，自增长',
    `name` varchar(50) NOT NULL  COMMENT '仓库名称',
    `code` varchar(50) default NULL  COMMENT '仓库编码',
    `address` varchar(100) NOT NULL  COMMENT '仓库地址',
    `contactsUser` varchar(50) NOT NULL  COMMENT '仓库联系人，姓名',
    `contactsPhone` varchar(50) NOT NULL  COMMENT '仓库联系电话',
    `status` tinyint(4) NOT NULL  default '1' COMMENT '启用停用，0停用 1启用，默认1',
    `remark` text default NULL  COMMENT '备注',
    `updateTime` datetime NOT NULL  COMMENT '变更时间',
    `updateUser` varchar(50) NOT NULL  COMMENT '变更用户loginName',
    `createTime` datetime NOT NULL  COMMENT '创建时间',
    `createUser` varchar(50) NOT NULL  COMMENT '创建用户loginName',
PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='仓库表';

-- 仓库菜单
INSERT INTO `mortals_iot_menu` VALUES (9109, '仓库', '/warehouse/list', 6, 2, 1, 0, 1, '0', NULL, NULL, NULL, 0, 0, 3, '2021-03-01 14:30:56', 1, '系统管理员');

-- 事件扩展字段表新增输入方式和数据来源字段
ALTER TABLE `mortals_iot_asset_flow_event_field`
    ADD COLUMN  `inputType` int(10) NOT NULL  default '1' COMMENT '输入方式，1输入框输入 2扫码输入 3下拉选择；支持多种方式，已逗号分隔；默认1',
 ADD COLUMN   `dataSource` varchar(50) default NULL  COMMENT '数据来源，下拉时选项数据来源，配置对应接口地址';


-- 事件扩展字段初始化数据
truncate table `mortals_iot_asset_flow_event_field`;
INSERT INTO `mortals_iot_asset_flow_event_field`(`id`, `eventCode`, `fieldCode`, `fieldName`, `fieldType`, `fieldLen`, `fieldNull`, `fieldOrderNo`, `remark`, `enabled`, `updateTime`, `updateUser`, `createTime`, `createUser`, `inputType`, `dataSource`) VALUES (3, '102', 'supplierCode', '厂家编码', 'String', 50, 0, 2, '从供应商接口获取', 1, '2021-03-09 18:20:29', 'admin', '2021-03-03 10:59:06', 'admin', 3, '/plm/supplier/list');
INSERT INTO `mortals_iot_asset_flow_event_field`(`id`, `eventCode`, `fieldCode`, `fieldName`, `fieldType`, `fieldLen`, `fieldNull`, `fieldOrderNo`, `remark`, `enabled`, `updateTime`, `updateUser`, `createTime`, `createUser`, `inputType`, `dataSource`) VALUES (4, '104', 'result', '验证结果', 'String', 50, 0, 0, '取值：通过，不通过', 1, '2021-03-03 11:00:29', 'admin', '2021-03-03 11:00:29', 'admin', 1, NULL);
INSERT INTO `mortals_iot_asset_flow_event_field`(`id`, `eventCode`, `fieldCode`, `fieldName`, `fieldType`, `fieldLen`, `fieldNull`, `fieldOrderNo`, `remark`, `enabled`, `updateTime`, `updateUser`, `createTime`, `createUser`, `inputType`, `dataSource`) VALUES (5, '104', 'exRemark', '验证结果描述', 'String', 200, 0, 1, '不通过原因', 1, '2021-03-03 11:01:20', 'admin', '2021-03-03 11:01:20', 'admin', 1, NULL);
INSERT INTO `mortals_iot_asset_flow_event_field`(`id`, `eventCode`, `fieldCode`, `fieldName`, `fieldType`, `fieldLen`, `fieldNull`, `fieldOrderNo`, `remark`, `enabled`, `updateTime`, `updateUser`, `createTime`, `createUser`, `inputType`, `dataSource`) VALUES (6, '105', 'wareHouseCode', '待入库仓库编码', 'String', 50, 0, 0, '从仓库查询接口获取', 1, '2021-03-09 18:20:57', 'admin', '2021-03-03 11:02:25', 'admin', 3, '/plm/warehouse/list');
INSERT INTO `mortals_iot_asset_flow_event_field`(`id`, `eventCode`, `fieldCode`, `fieldName`, `fieldType`, `fieldLen`, `fieldNull`, `fieldOrderNo`, `remark`, `enabled`, `updateTime`, `updateUser`, `createTime`, `createUser`, `inputType`, `dataSource`) VALUES (7, '106', 'wareHouseCode', '接收仓库编码', 'String', 50, 0, 0, '从仓库查询接口获取', 1, '2021-03-09 18:22:23', 'admin', '2021-03-03 11:02:59', 'admin', 3, '/plm/warehouse/list');
INSERT INTO `mortals_iot_asset_flow_event_field`(`id`, `eventCode`, `fieldCode`, `fieldName`, `fieldType`, `fieldLen`, `fieldNull`, `fieldOrderNo`, `remark`, `enabled`, `updateTime`, `updateUser`, `createTime`, `createUser`, `inputType`, `dataSource`) VALUES (8, '107', 'deviceNum', '业务码', 'String', 50, 0, 0, NULL, 1, '2021-03-09 18:22:15', 'admin', '2021-03-03 11:03:45', 'admin', 2, NULL);
INSERT INTO `mortals_iot_asset_flow_event_field`(`id`, `eventCode`, `fieldCode`, `fieldName`, `fieldType`, `fieldLen`, `fieldNull`, `fieldOrderNo`, `remark`, `enabled`, `updateTime`, `updateUser`, `createTime`, `createUser`, `inputType`, `dataSource`) VALUES (9, '108', 'deliverCode', '物流单号', 'String', 50, 0, 0, NULL, 1, '2021-03-09 18:22:48', 'admin', '2021-03-03 11:04:26', 'admin', 2, NULL);
INSERT INTO `mortals_iot_asset_flow_event_field`(`id`, `eventCode`, `fieldCode`, `fieldName`, `fieldType`, `fieldLen`, `fieldNull`, `fieldOrderNo`, `remark`, `enabled`, `updateTime`, `updateUser`, `createTime`, `createUser`, `inputType`, `dataSource`) VALUES (10, '108', 'supplierCode', '物流公司编码', 'String', 50, 0, 1, '从供应商接口获取', 1, '2021-03-22 14:12:30', 'admin', '2021-03-03 11:05:04', 'admin', 3, '/plm/supplier/deliver/list');
INSERT INTO `mortals_iot_asset_flow_event_field`(`id`, `eventCode`, `fieldCode`, `fieldName`, `fieldType`, `fieldLen`, `fieldNull`, `fieldOrderNo`, `remark`, `enabled`, `updateTime`, `updateUser`, `createTime`, `createUser`, `inputType`, `dataSource`) VALUES (11, '109', 'deliverCode', '物流单号', 'String', 50, 0, 0, NULL, 1, '2021-03-09 18:23:02', 'admin', '2021-03-03 11:04:26', 'admin', 2, NULL);
INSERT INTO `mortals_iot_asset_flow_event_field`(`id`, `eventCode`, `fieldCode`, `fieldName`, `fieldType`, `fieldLen`, `fieldNull`, `fieldOrderNo`, `remark`, `enabled`, `updateTime`, `updateUser`, `createTime`, `createUser`, `inputType`, `dataSource`) VALUES (12, '109', 'supplierCode', '物流公司编码', 'String', 50, 0, 1, '从供应商接口获取', 1, '2021-03-22 14:12:45', 'admin', '2021-03-03 11:05:04', 'admin', 3, '/plm/supplier/deliver/list');
INSERT INTO `mortals_iot_asset_flow_event_field`(`id`, `eventCode`, `fieldCode`, `fieldName`, `fieldType`, `fieldLen`, `fieldNull`, `fieldOrderNo`, `remark`, `enabled`, `updateTime`, `updateUser`, `createTime`, `createUser`, `inputType`, `dataSource`) VALUES (13, '110', 'exRemark', '技改原因', 'String', 200, 0, 0, NULL, 1, '2021-03-03 11:06:38', 'admin', '2021-03-03 11:06:38', 'admin', 1, NULL);
INSERT INTO `mortals_iot_asset_flow_event_field`(`id`, `eventCode`, `fieldCode`, `fieldName`, `fieldType`, `fieldLen`, `fieldNull`, `fieldOrderNo`, `remark`, `enabled`, `updateTime`, `updateUser`, `createTime`, `createUser`, `inputType`, `dataSource`) VALUES (14, '111', 'exRemark', '技改结果说明', 'String', 200, 0, 0, NULL, 1, '2021-03-03 11:06:38', 'admin', '2021-03-03 11:06:38', 'admin', 1, NULL);
INSERT INTO `mortals_iot_asset_flow_event_field`(`id`, `eventCode`, `fieldCode`, `fieldName`, `fieldType`, `fieldLen`, `fieldNull`, `fieldOrderNo`, `remark`, `enabled`, `updateTime`, `updateUser`, `createTime`, `createUser`, `inputType`, `dataSource`) VALUES (15, '112', 'outWareHouseCode', '出库仓库编码', 'String', 50, 0, 0, '从仓库查询接口获取', 1, '2021-03-09 18:23:22', 'admin', '2021-03-03 11:08:15', 'admin', 3, '/plm/warehouse/list');
INSERT INTO `mortals_iot_asset_flow_event_field`(`id`, `eventCode`, `fieldCode`, `fieldName`, `fieldType`, `fieldLen`, `fieldNull`, `fieldOrderNo`, `remark`, `enabled`, `updateTime`, `updateUser`, `createTime`, `createUser`, `inputType`, `dataSource`) VALUES (16, '112', 'inWareHouseCode', '待入库仓库编码', 'String', 50, 0, 1, '从仓库查询接口获取', 1, '2021-03-09 18:23:32', 'admin', '2021-03-03 11:08:54', 'admin', 3, '/plm/warehouse/list');
INSERT INTO `mortals_iot_asset_flow_event_field`(`id`, `eventCode`, `fieldCode`, `fieldName`, `fieldType`, `fieldLen`, `fieldNull`, `fieldOrderNo`, `remark`, `enabled`, `updateTime`, `updateUser`, `createTime`, `createUser`, `inputType`, `dataSource`) VALUES (17, '112', 'exRemark', '出库原因', 'String', 200, 0, 0, NULL, 1, '2021-03-03 11:09:34', 'admin', '2021-03-03 11:09:34', 'admin', 1, NULL);
INSERT INTO `mortals_iot_asset_flow_event_field`(`id`, `eventCode`, `fieldCode`, `fieldName`, `fieldType`, `fieldLen`, `fieldNull`, `fieldOrderNo`, `remark`, `enabled`, `updateTime`, `updateUser`, `createTime`, `createUser`, `inputType`, `dataSource`) VALUES (18, '113', 'inWareHouseCode', '入库仓库编码', 'String', 50, 0, 0, '从仓库查询接口获取', 1, '2021-03-09 18:23:46', 'admin', '2021-03-03 11:10:16', 'admin', 3, '/plm/warehouse/list');
INSERT INTO `mortals_iot_asset_flow_event_field`(`id`, `eventCode`, `fieldCode`, `fieldName`, `fieldType`, `fieldLen`, `fieldNull`, `fieldOrderNo`, `remark`, `enabled`, `updateTime`, `updateUser`, `createTime`, `createUser`, `inputType`, `dataSource`) VALUES (19, '114', 'partnerCode', '代理商编码', 'String', 50, 0, 0, '从客户接口获取', 1, '2021-03-09 18:23:53', 'admin', '2021-03-03 11:10:53', 'admin', 3, '/plm/partner/list');
INSERT INTO `mortals_iot_asset_flow_event_field`(`id`, `eventCode`, `fieldCode`, `fieldName`, `fieldType`, `fieldLen`, `fieldNull`, `fieldOrderNo`, `remark`, `enabled`, `updateTime`, `updateUser`, `createTime`, `createUser`, `inputType`, `dataSource`) VALUES (20, '114', 'inWareHouseCode', '入库仓库编码', 'String', 50, 0, 0, '从仓库查询接口获取', 1, '2021-03-09 18:24:09', 'admin', '2021-03-03 11:10:16', 'admin', 3, '/plm/warehouse/list');
INSERT INTO `mortals_iot_asset_flow_event_field`(`id`, `eventCode`, `fieldCode`, `fieldName`, `fieldType`, `fieldLen`, `fieldNull`, `fieldOrderNo`, `remark`, `enabled`, `updateTime`, `updateUser`, `createTime`, `createUser`, `inputType`, `dataSource`) VALUES (21, '114', 'exRemark', '回收原因', 'String', 200, 0, 0, NULL, 1, '2021-03-03 11:09:34', 'admin', '2021-03-03 11:09:34', 'admin', 1, NULL);
INSERT INTO `mortals_iot_asset_flow_event_field`(`id`, `eventCode`, `fieldCode`, `fieldName`, `fieldType`, `fieldLen`, `fieldNull`, `fieldOrderNo`, `remark`, `enabled`, `updateTime`, `updateUser`, `createTime`, `createUser`, `inputType`, `dataSource`) VALUES (22, '115', 'partnerCode', '代理商编码', 'String', 50, 0, 0, '从客户接口获取', 1, '2021-03-09 18:24:15', 'admin', '2021-03-03 11:10:53', 'admin', 3, '/plm/partner/list');
INSERT INTO `mortals_iot_asset_flow_event_field`(`id`, `eventCode`, `fieldCode`, `fieldName`, `fieldType`, `fieldLen`, `fieldNull`, `fieldOrderNo`, `remark`, `enabled`, `updateTime`, `updateUser`, `createTime`, `createUser`, `inputType`, `dataSource`) VALUES (23, '115', 'outWareHouseCode', '出库仓库编码', 'String', 50, 0, 0, '从仓库查询接口获取', 1, '2021-03-09 18:24:21', 'admin', '2021-03-03 11:10:16', 'admin', 3, '/plm/warehouse/list');
INSERT INTO `mortals_iot_asset_flow_event_field`(`id`, `eventCode`, `fieldCode`, `fieldName`, `fieldType`, `fieldLen`, `fieldNull`, `fieldOrderNo`, `remark`, `enabled`, `updateTime`, `updateUser`, `createTime`, `createUser`, `inputType`, `dataSource`) VALUES (24, '116', 'pointId', '点位', 'Long', 50, 0, 0, NULL, 1, '2021-03-09 18:24:28', 'admin', '2021-03-03 11:15:11', 'admin', 3, '/plm/point/list');
INSERT INTO `mortals_iot_asset_flow_event_field`(`id`, `eventCode`, `fieldCode`, `fieldName`, `fieldType`, `fieldLen`, `fieldNull`, `fieldOrderNo`, `remark`, `enabled`, `updateTime`, `updateUser`, `createTime`, `createUser`, `inputType`, `dataSource`) VALUES (25, '116', 'pointName', '点位名称', 'String', 50, 0, 1, NULL, 0, '2021-03-09 18:24:32', 'admin', '2021-03-03 11:15:33', 'admin', 3, '/plm/point/list');
INSERT INTO `mortals_iot_asset_flow_event_field`(`id`, `eventCode`, `fieldCode`, `fieldName`, `fieldType`, `fieldLen`, `fieldNull`, `fieldOrderNo`, `remark`, `enabled`, `updateTime`, `updateUser`, `createTime`, `createUser`, `inputType`, `dataSource`) VALUES (26, '116', 'outWareHouseCode', '出库仓库编码', 'String', 50, 0, 2, '从仓库查询接口获取', 1, '2021-03-09 18:24:39', 'admin', '2021-03-03 11:16:21', 'admin', 3, '/plm/warehouse/list');
INSERT INTO `mortals_iot_asset_flow_event_field`(`id`, `eventCode`, `fieldCode`, `fieldName`, `fieldType`, `fieldLen`, `fieldNull`, `fieldOrderNo`, `remark`, `enabled`, `updateTime`, `updateUser`, `createTime`, `createUser`, `inputType`, `dataSource`) VALUES (27, '117', 'pointId', '点位', 'Long', 50, 0, 0, NULL, 1, '2021-03-09 18:24:46', 'admin', '2021-03-03 11:15:11', 'admin', 3, '/plm/point/list');
INSERT INTO `mortals_iot_asset_flow_event_field`(`id`, `eventCode`, `fieldCode`, `fieldName`, `fieldType`, `fieldLen`, `fieldNull`, `fieldOrderNo`, `remark`, `enabled`, `updateTime`, `updateUser`, `createTime`, `createUser`, `inputType`, `dataSource`) VALUES (28, '117', 'pointName', '点位名称', 'String', 50, 0, 1, NULL, 0, '2021-03-09 18:24:52', 'admin', '2021-03-03 11:15:33', 'admin', 3, '/plm/point/list');
INSERT INTO `mortals_iot_asset_flow_event_field`(`id`, `eventCode`, `fieldCode`, `fieldName`, `fieldType`, `fieldLen`, `fieldNull`, `fieldOrderNo`, `remark`, `enabled`, `updateTime`, `updateUser`, `createTime`, `createUser`, `inputType`, `dataSource`) VALUES (29, '118', 'pointId', '点位', 'Long', 50, 0, 0, NULL, 1, '2021-03-03 11:15:11', 'admin', '2021-03-03 11:15:11', 'admin', 3, '/plm/point/list');
INSERT INTO `mortals_iot_asset_flow_event_field`(`id`, `eventCode`, `fieldCode`, `fieldName`, `fieldType`, `fieldLen`, `fieldNull`, `fieldOrderNo`, `remark`, `enabled`, `updateTime`, `updateUser`, `createTime`, `createUser`, `inputType`, `dataSource`) VALUES (30, '118', 'pointName', '点位名称', 'String', 50, 0, 1, NULL, 0, '2021-03-03 11:15:40', 'admin', '2021-03-03 11:15:33', 'admin', 3, '/plm/point/list');
INSERT INTO `mortals_iot_asset_flow_event_field`(`id`, `eventCode`, `fieldCode`, `fieldName`, `fieldType`, `fieldLen`, `fieldNull`, `fieldOrderNo`, `remark`, `enabled`, `updateTime`, `updateUser`, `createTime`, `createUser`, `inputType`, `dataSource`) VALUES (31, '118', 'inWareHouseCode', '入库仓库编码', 'String', 50, 0, 2, '从仓库查询接口获取', 1, '2021-03-03 11:16:21', 'admin', '2021-03-03 11:16:21', 'admin', 3, '/plm/warehouse/list');
INSERT INTO `mortals_iot_asset_flow_event_field`(`id`, `eventCode`, `fieldCode`, `fieldName`, `fieldType`, `fieldLen`, `fieldNull`, `fieldOrderNo`, `remark`, `enabled`, `updateTime`, `updateUser`, `createTime`, `createUser`, `inputType`, `dataSource`) VALUES (32, '119', 'inWareHouseCode', '入库仓库编码', 'String', 50, 0, 2, '从仓库查询接口获取', 1, '2021-03-03 11:16:21', 'admin', '2021-03-03 11:16:21', 'admin', 3, '/plm/warehouse/list');
INSERT INTO `mortals_iot_asset_flow_event_field`(`id`, `eventCode`, `fieldCode`, `fieldName`, `fieldType`, `fieldLen`, `fieldNull`, `fieldOrderNo`, `remark`, `enabled`, `updateTime`, `updateUser`, `createTime`, `createUser`, `inputType`, `dataSource`) VALUES (33, '120', 'pointId', '原点位', 'Long', 50, 0, 0, NULL, 1, '2021-03-03 11:15:11', 'admin', '2021-03-03 11:15:11', 'admin', 3, '/plm/point/list');
INSERT INTO `mortals_iot_asset_flow_event_field`(`id`, `eventCode`, `fieldCode`, `fieldName`, `fieldType`, `fieldLen`, `fieldNull`, `fieldOrderNo`, `remark`, `enabled`, `updateTime`, `updateUser`, `createTime`, `createUser`, `inputType`, `dataSource`) VALUES (34, '120', 'pointName', '点位名称', 'String', 50, 0, 1, NULL, 0, '2021-03-03 11:15:40', 'admin', '2021-03-03 11:15:33', 'admin', 3, '/plm/point/list');
INSERT INTO `mortals_iot_asset_flow_event_field`(`id`, `eventCode`, `fieldCode`, `fieldName`, `fieldType`, `fieldLen`, `fieldNull`, `fieldOrderNo`, `remark`, `enabled`, `updateTime`, `updateUser`, `createTime`, `createUser`, `inputType`, `dataSource`) VALUES (35, '121', 'exRemark', '维修原因', 'String', 200, 0, 0, NULL, 1, '2021-03-03 11:09:34', 'admin', '2021-03-03 11:09:34', 'admin', 1, NULL);
INSERT INTO `mortals_iot_asset_flow_event_field`(`id`, `eventCode`, `fieldCode`, `fieldName`, `fieldType`, `fieldLen`, `fieldNull`, `fieldOrderNo`, `remark`, `enabled`, `updateTime`, `updateUser`, `createTime`, `createUser`, `inputType`, `dataSource`) VALUES (36, '122', 'exRemark', '维修说明', 'String', 200, 0, 0, NULL, 1, '2021-03-03 11:09:34', 'admin', '2021-03-03 11:09:34', 'admin', 1, NULL);
INSERT INTO `mortals_iot_asset_flow_event_field`(`id`, `eventCode`, `fieldCode`, `fieldName`, `fieldType`, `fieldLen`, `fieldNull`, `fieldOrderNo`, `remark`, `enabled`, `updateTime`, `updateUser`, `createTime`, `createUser`, `inputType`, `dataSource`) VALUES (37, '124', 'exRemark', '报废说明', 'String', 200, 0, 0, NULL, 1, '2021-03-03 11:09:34', 'admin', '2021-03-03 11:09:34', 'admin', 1, NULL);
INSERT INTO `mortals_iot_asset_flow_event_field`(`id`, `eventCode`, `fieldCode`, `fieldName`, `fieldType`, `fieldLen`, `fieldNull`, `fieldOrderNo`, `remark`, `enabled`, `updateTime`, `updateUser`, `createTime`, `createUser`, `inputType`, `dataSource`) VALUES (38, '105', 'supplierCode', '厂家编码', 'String', 50, 0, 0, '从供应商接口获取', 1, '2021-03-03 15:05:51', 'admin', '2021-03-03 15:05:51', 'admin', 3, '/plm/supplier/list');
INSERT INTO `mortals_iot_asset_flow_event_field`(`id`, `eventCode`, `fieldCode`, `fieldName`, `fieldType`, `fieldLen`, `fieldNull`, `fieldOrderNo`, `remark`, `enabled`, `updateTime`, `updateUser`, `createTime`, `createUser`, `inputType`, `dataSource`) VALUES (39, '117', 'deviceNum', '设备编码（业务码）', 'String', 50, 1, 2, NULL, 1, '2021-03-09 18:28:16', 'admin', '2021-03-09 18:27:45', 'admin', 2, NULL);
INSERT INTO `mortals_iot_asset_flow_event_field`(`id`, `eventCode`, `fieldCode`, `fieldName`, `fieldType`, `fieldLen`, `fieldNull`, `fieldOrderNo`, `remark`, `enabled`, `updateTime`, `updateUser`, `createTime`, `createUser`, `inputType`, `dataSource`) VALUES (40, '116', 'shopId', '门店', 'Long', 50, 0, 0, NULL, 1, '2021-03-09 18:24:28', 'admin', '2021-03-03 11:15:11', 'admin', 3, '/plm/shop/list');
INSERT INTO `mortals_iot_asset_flow_event_field`(`id`, `eventCode`, `fieldCode`, `fieldName`, `fieldType`, `fieldLen`, `fieldNull`, `fieldOrderNo`, `remark`, `enabled`, `updateTime`, `updateUser`, `createTime`, `createUser`, `inputType`, `dataSource`) VALUES (41, '117', 'shopId', '门店', 'Long', 50, 0, 0, NULL, 1, '2021-03-09 18:24:46', 'admin', '2021-03-03 11:15:11', 'admin', 3, '/plm/shop/list');
INSERT INTO `mortals_iot_asset_flow_event_field`(`id`, `eventCode`, `fieldCode`, `fieldName`, `fieldType`, `fieldLen`, `fieldNull`, `fieldOrderNo`, `remark`, `enabled`, `updateTime`, `updateUser`, `createTime`, `createUser`, `inputType`, `dataSource`) VALUES (42, '118', 'shopId', '门店', 'Long', 50, 0, 0, NULL, 1, '2021-03-03 11:15:11', 'admin', '2021-03-03 11:15:11', 'admin', 3, '/plm/shop/list');
INSERT INTO `mortals_iot_asset_flow_event_field`(`id`, `eventCode`, `fieldCode`, `fieldName`, `fieldType`, `fieldLen`, `fieldNull`, `fieldOrderNo`, `remark`, `enabled`, `updateTime`, `updateUser`, `createTime`, `createUser`, `inputType`, `dataSource`) VALUES (43, '120', 'shopId', '门店', 'Long', 50, 0, 0, NULL, 1, '2021-03-03 11:15:11', 'admin', '2021-03-03 11:15:11', 'admin', 3, '/plm/shop/list');
INSERT INTO `mortals_iot_asset_flow_event_field`(`id`, `eventCode`, `fieldCode`, `fieldName`, `fieldType`, `fieldLen`, `fieldNull`, `fieldOrderNo`, `remark`, `enabled`, `updateTime`, `updateUser`, `createTime`, `createUser`, `inputType`, `dataSource`) VALUES (44, '122', 'pointId', '点位', 'Long', 50, 0, 0, NULL, 1, '2021-03-09 18:24:28', 'admin', '2021-03-03 11:15:11', 'admin', 3, '/plm/point/list');
INSERT INTO `mortals_iot_asset_flow_event_field`(`id`, `eventCode`, `fieldCode`, `fieldName`, `fieldType`, `fieldLen`, `fieldNull`, `fieldOrderNo`, `remark`, `enabled`, `updateTime`, `updateUser`, `createTime`, `createUser`, `inputType`, `dataSource`) VALUES (45, '122', 'pointName', '点位名称', 'String', 50, 0, 1, NULL, 0, '2021-03-09 18:24:32', 'admin', '2021-03-03 11:15:33', 'admin', 3, '/plm/point/list');
INSERT INTO `mortals_iot_asset_flow_event_field`(`id`, `eventCode`, `fieldCode`, `fieldName`, `fieldType`, `fieldLen`, `fieldNull`, `fieldOrderNo`, `remark`, `enabled`, `updateTime`, `updateUser`, `createTime`, `createUser`, `inputType`, `dataSource`) VALUES (46, '122', 'shopId', '门店', 'Long', 50, 0, 0, NULL, 1, '2021-03-09 18:24:28', 'admin', '2021-03-03 11:15:11', 'admin', 3, '/plm/shop/list');
INSERT INTO `mortals_iot_asset_flow_event_field`(`id`, `eventCode`, `fieldCode`, `fieldName`, `fieldType`, `fieldLen`, `fieldNull`, `fieldOrderNo`, `remark`, `enabled`, `updateTime`, `updateUser`, `createTime`, `createUser`, `inputType`, `dataSource`) VALUES (50, '123', 'exRemark', '维修说明', 'String', 200, 0, 0, NULL, 1, '2021-03-03 11:09:34', 'admin', '2021-03-03 11:09:34', 'admin', 1, NULL);
INSERT INTO `mortals_iot_asset_flow_event_field`(`id`, `eventCode`, `fieldCode`, `fieldName`, `fieldType`, `fieldLen`, `fieldNull`, `fieldOrderNo`, `remark`, `enabled`, `updateTime`, `updateUser`, `createTime`, `createUser`, `inputType`, `dataSource`) VALUES (51, '123', 'pointId', '点位', 'Long', 50, 0, 0, NULL, 1, '2021-03-09 18:24:28', 'admin', '2021-03-03 11:15:11', 'admin', 3, '/plm/point/list');
INSERT INTO `mortals_iot_asset_flow_event_field`(`id`, `eventCode`, `fieldCode`, `fieldName`, `fieldType`, `fieldLen`, `fieldNull`, `fieldOrderNo`, `remark`, `enabled`, `updateTime`, `updateUser`, `createTime`, `createUser`, `inputType`, `dataSource`) VALUES (52, '123', 'pointName', '点位名称', 'String', 50, 0, 1, NULL, 0, '2021-03-09 18:24:32', 'admin', '2021-03-03 11:15:33', 'admin', 3, '/plm/point/list');
INSERT INTO `mortals_iot_asset_flow_event_field`(`id`, `eventCode`, `fieldCode`, `fieldName`, `fieldType`, `fieldLen`, `fieldNull`, `fieldOrderNo`, `remark`, `enabled`, `updateTime`, `updateUser`, `createTime`, `createUser`, `inputType`, `dataSource`) VALUES (53, '123', 'shopId', '门店', 'Long', 50, 0, 0, NULL, 1, '2021-03-09 18:24:28', 'admin', '2021-03-03 11:15:11', 'admin', 3, '/plm/shop/list');
INSERT INTO `mortals_iot_asset_flow_event_field`(`id`, `eventCode`, `fieldCode`, `fieldName`, `fieldType`, `fieldLen`, `fieldNull`, `fieldOrderNo`, `remark`, `enabled`, `updateTime`, `updateUser`, `createTime`, `createUser`, `inputType`, `dataSource`) VALUES (54, '125', 'exRemark', '补货说明', 'String', 200, 0, 0, NULL, 1, '2021-03-03 11:09:34', 'admin', '2021-03-03 11:09:34', 'admin', 1, NULL);
INSERT INTO `mortals_iot_asset_flow_event_field`(`id`, `eventCode`, `fieldCode`, `fieldName`, `fieldType`, `fieldLen`, `fieldNull`, `fieldOrderNo`, `remark`, `enabled`, `updateTime`, `updateUser`, `createTime`, `createUser`, `inputType`, `dataSource`) VALUES (55, '125', 'pointId', '点位', 'Long', 50, 0, 0, NULL, 1, '2021-03-09 18:24:28', 'admin', '2021-03-03 11:15:11', 'admin', 3, '/plm/point/list');
INSERT INTO `mortals_iot_asset_flow_event_field`(`id`, `eventCode`, `fieldCode`, `fieldName`, `fieldType`, `fieldLen`, `fieldNull`, `fieldOrderNo`, `remark`, `enabled`, `updateTime`, `updateUser`, `createTime`, `createUser`, `inputType`, `dataSource`) VALUES (56, '125', 'pointName', '点位名称', 'String', 50, 0, 1, NULL, 0, '2021-03-09 18:24:32', 'admin', '2021-03-03 11:15:33', 'admin', 3, '/plm/point/list');
INSERT INTO `mortals_iot_asset_flow_event_field`(`id`, `eventCode`, `fieldCode`, `fieldName`, `fieldType`, `fieldLen`, `fieldNull`, `fieldOrderNo`, `remark`, `enabled`, `updateTime`, `updateUser`, `createTime`, `createUser`, `inputType`, `dataSource`) VALUES (57, '125', 'shopId', '门店', 'Long', 50, 0, 0, NULL, 1, '2021-03-09 18:24:28', 'admin', '2021-03-03 11:15:11', 'admin', 3, '/plm/shop/list');


-- 事件日志表ID改为Code
ALTER TABLE `mortals_iot_asset_flow_event_log`
    CHANGE COLUMN `eventId` `eventCode` varchar(50) NOT NULL COMMENT '事件Code，关联asset_flow_event表Code' AFTER `id`;

-- 事件日志表新增事件开始时间和showInfo
ALTER TABLE `iot-plm`.`mortals_iot_asset_flow_event_log`
    ADD COLUMN `eventStartTime` datetime(0)  NULL  COMMENT '事件发生开始时间' AFTER `afteStatus` ,
    ADD COLUMN `showInfo` varchar(1000) default NULL  COMMENT '数据展示信息，运维助手回显时通过这个字段来回显(临时）' AFTER `createTime`;

-- 添加资源控制
INSERT INTO `iot-plm`.`mortals_iot_resource`(`id`, `name`, `url`, `authType`, `sourceType`, `createTime`, `createUserId`, `createUserName`, `userType`) VALUES (301003, '产品管理-物料管理-查看', '/materia/list,/materia/view,/materia/category/getListByParentId,/materia/category/getDirListByParentId,/materia/category/getLevel,/materia/category/view,/materia/category/list,/materia/edit,/materia/category/edit', 3, 0, '2021-03-25 09:31:01', 1, '系统管理员', NULL);
INSERT INTO `iot-plm`.`mortals_iot_resource`(`id`, `name`, `url`, `authType`, `sourceType`, `createTime`, `createUserId`, `createUserName`, `userType`) VALUES (301004, '产品管理-物料管理-维护', '/materia/save,/materia/category/save,/materia/supplier/save,/materia/doImportExcel,/materia/discard,/materia/updateAsset,/materia/add,/file/upload', 3, 0, '2021-03-25 09:31:37', 1, '系统管理员', NULL);
INSERT INTO `iot-plm`.`mortals_iot_resource`(`id`, `name`, `url`, `authType`, `sourceType`, `createTime`, `createUserId`, `createUserName`, `userType`) VALUES (301005, '产品管理-产品BOM管理-查看', '/materia/bom/list,/materia/bom/view,/materia/bom/tree/list,/materia/bom/tree/view,/materia/bom/tree/queryBomById,/materia/bom/tree/queryBoms,/materia/bom/tree/getListByParentId,/materia/bom/item/list,/materia/bom/item/view', 3, 0, '2021-03-25 09:42:10', 1, '系统管理员', NULL);
INSERT INTO `iot-plm`.`mortals_iot_resource`(`id`, `name`, `url`, `authType`, `sourceType`, `createTime`, `createUserId`, `createUserName`, `userType`) VALUES (301006, '产品管理-产品BOM管理-维护', '/materia/bom/edit,/materia/bom/add,/materia/bom/save,/materia/bom/tree/add,/materia/bom/tree/edit,/materia/bom/tree/save,/materia/bom/tree/item/add,/materia/bom/tree/item/edit,/materia/bom/tree/item/save,/materia/bom/copyBom,/materia/bom/doExport,/materia/bom/doImport,/materia/bom/item/materiaSupply,/materia/bom/item/save,/materia/bom/item/edit,/materia/bom/item/view', 3, 0, '2021-03-25 09:46:14', 1, '系统管理员', NULL);
INSERT INTO `iot-plm`.`mortals_iot_resource`(`id`, `name`, `url`, `authType`, `sourceType`, `createTime`, `createUserId`, `createUserName`, `userType`) VALUES (301007, '产品管理-产品版本管理-查看', '/materia/bom/version/list,/materia/bom/version/view,/materia/bom/view,/materia/view,/materia/bom/tree/getListByParentId', 3, 0, '2021-03-25 09:56:33', 1, '系统管理员', NULL);
INSERT INTO `iot-plm`.`mortals_iot_resource`(`id`, `name`, `url`, `authType`, `sourceType`, `createTime`, `createUserId`, `createUserName`, `userType`) VALUES (301008, '产品管理-产品版本管理-维护', '/materia/bom/version/add,/materia/bom/version/edit,/materia/bom/version/save,/materia/bom/version/submitVersion,/materia/bom/tree/checkBom,/materia/bom/version/delete,/materia/bom/version/updateBom', 3, 0, '2021-03-25 09:59:15', 1, '系统管理员', NULL);
INSERT INTO `iot-plm`.`mortals_iot_resource`(`id`, `name`, `url`, `authType`, `sourceType`, `createTime`, `createUserId`, `createUserName`, `userType`) VALUES (301009, '产品管理-物料供应管理-查看', '/materia/supplier/list,/materia/supplier/view', 3, 0, '2021-03-25 10:01:22', 1, '系统管理员', NULL);
INSERT INTO `iot-plm`.`mortals_iot_resource`(`id`, `name`, `url`, `authType`, `sourceType`, `createTime`, `createUserId`, `createUserName`, `userType`) VALUES (301010, '产品管理-物料供应管理-维护', '/materia/supplier/edit,/materia/supplier/save,/materia/supplier/add,/materia/supplier/delete', 3, 0, '2021-03-25 10:02:25', 1, '系统管理员', NULL);
INSERT INTO `iot-plm`.`mortals_iot_resource`(`id`, `name`, `url`, `authType`, `sourceType`, `createTime`, `createUserId`, `createUserName`, `userType`) VALUES (301011, '生产管理-资产管理-查看', '/asset/list,/asset/view,/materia/bom/tree/getBomVersionListByParentId,/materia/list,/supplier/list', 3, 0, '2021-03-26 10:14:31', 1, '系统管理员', NULL);
INSERT INTO `iot-plm`.`mortals_iot_resource`(`id`, `name`, `url`, `authType`, `sourceType`, `createTime`, `createUserId`, `createUserName`, `userType`) VALUES (301013, '生产管理-资产管理-维护', '/asset/edit,/asset/operEnabled,/asset/add,/asset/save,/materia/bom/tree/getBomVersionListByParentId,/supplier/list,/materia/list', 3, 0, '2021-03-26 10:20:32', 1, '系统管理员', NULL);
INSERT INTO `iot-plm`.`mortals_iot_resource`(`id`, `name`, `url`, `authType`, `sourceType`, `createTime`, `createUserId`, `createUserName`, `userType`) VALUES (301014, '生产管理-资产管理-导出二维码', '/asset/exportQRcode', 3, 0, '2021-03-26 10:21:16', 1, '系统管理员', NULL);
INSERT INTO `iot-plm`.`mortals_iot_resource`(`id`, `name`, `url`, `authType`, `sourceType`, `createTime`, `createUserId`, `createUserName`, `userType`) VALUES (301015, '生产管理-资产管理-批量导入', '/asset/saveImport', 3, 0, '2021-03-26 10:22:11', 1, '系统管理员', NULL);
INSERT INTO `iot-plm`.`mortals_iot_resource`(`id`, `name`, `url`, `authType`, `sourceType`, `createTime`, `createUserId`, `createUserName`, `userType`) VALUES (301016, '生产管理-资产事件-维护', '/asset/flow/event/add,/asset/flow/event/edit,/asset/flow/event/save', 3, 0, '2021-03-26 10:23:01', 1, '系统管理员', NULL);
INSERT INTO `iot-plm`.`mortals_iot_resource`(`id`, `name`, `url`, `authType`, `sourceType`, `createTime`, `createUserId`, `createUserName`, `userType`) VALUES (301017, '生产管理-资产事件-查看', '/asset/flow/event/list,/asset/flow/event/view', 3, 0, '2021-03-26 10:23:59', 1, '系统管理员', NULL);
INSERT INTO `iot-plm`.`mortals_iot_resource`(`id`, `name`, `url`, `authType`, `sourceType`, `createTime`, `createUserId`, `createUserName`, `userType`) VALUES (301018, '生产管理-资产事件日志-查看', '/asset/flow/eventlog/list,/asset/flow/eventlog/view', 3, 0, '2021-03-26 10:25:25', 1, '系统管理员', NULL);
INSERT INTO `iot-plm`.`mortals_iot_resource`(`id`, `name`, `url`, `authType`, `sourceType`, `createTime`, `createUserId`, `createUserName`, `userType`) VALUES (301020, '生产管理-资产事件扩展字段-查看', '/asset/flow/eventfield/list,/asset/flow/eventfield/view', 3, 0, '2021-03-26 10:26:55', 1, '系统管理员', NULL);
INSERT INTO `iot-plm`.`mortals_iot_resource`(`id`, `name`, `url`, `authType`, `sourceType`, `createTime`, `createUserId`, `createUserName`, `userType`) VALUES (301021, '生产管理-资产事件扩展字段-维护', '/asset/flow/eventfield/edit,/asset/flow/eventfield/save,/asset/flow/eventfield/add', 3, 0, '2021-03-26 10:27:56', 1, '系统管理员', NULL);
INSERT INTO `iot-plm`.`mortals_iot_resource`(`id`, `name`, `url`, `authType`, `sourceType`, `createTime`, `createUserId`, `createUserName`, `userType`) VALUES (301022, '往来方-客户-查看', '/partner/list,/partner/view', 3, 0, '2021-03-26 10:31:03', 1, '系统管理员', NULL);
INSERT INTO `iot-plm`.`mortals_iot_resource`(`id`, `name`, `url`, `authType`, `sourceType`, `createTime`, `createUserId`, `createUserName`, `userType`) VALUES (301023, '往来方-客户-维护', '/partner/add,/partner/edit,/partner/save', 3, 0, '2021-03-26 10:31:50', 1, '系统管理员', NULL);
INSERT INTO `iot-plm`.`mortals_iot_resource`(`id`, `name`, `url`, `authType`, `sourceType`, `createTime`, `createUserId`, `createUserName`, `userType`) VALUES (301024, '往来方-供应商-查看', '/supplier/list,/supplier/view', 3, 0, '2021-03-26 10:32:46', 1, '系统管理员', NULL);
INSERT INTO `iot-plm`.`mortals_iot_resource`(`id`, `name`, `url`, `authType`, `sourceType`, `createTime`, `createUserId`, `createUserName`, `userType`) VALUES (301025, '往来方-供应商-维护', '/supplier/add,/supplier/edit,/supplier/save', 3, 0, '2021-03-26 10:33:42', 1, '系统管理员', NULL);
INSERT INTO `iot-plm`.`mortals_iot_resource`(`id`, `name`, `url`, `authType`, `sourceType`, `createTime`, `createUserId`, `createUserName`, `userType`) VALUES (301026, '配置-字段配置-查看', '/config/field/list,/config/field/view', 3, 0, '2021-03-26 10:34:54', 1, '系统管理员', NULL);
INSERT INTO `iot-plm`.`mortals_iot_resource`(`id`, `name`, `url`, `authType`, `sourceType`, `createTime`, `createUserId`, `createUserName`, `userType`) VALUES (301027, '配置-字段配置-维护', '/config/field/add,/config/field/edit,/config/field/save', 3, 0, '2021-03-26 10:35:43', 1, '系统管理员', NULL);
INSERT INTO `iot-plm`.`mortals_iot_resource`(`id`, `name`, `url`, `authType`, `sourceType`, `createTime`, `createUserId`, `createUserName`, `userType`) VALUES (301028, '配置-仓库配置-查看', '/warehouse/list,/warehouse/view', 3, 0, '2021-03-26 10:37:23', 1, '系统管理员', NULL);
INSERT INTO `iot-plm`.`mortals_iot_resource`(`id`, `name`, `url`, `authType`, `sourceType`, `createTime`, `createUserId`, `createUserName`, `userType`) VALUES (301029, '配置-仓库配置-维护', '/warehouse/save,/warehouse/add,/warehouse/edit', 3, 0, '2021-03-26 10:38:08', 1, '系统管理员', NULL);
INSERT INTO `iot-plm`.`mortals_iot_resource`(`id`, `name`, `url`, `authType`, `sourceType`, `createTime`, `createUserId`, `createUserName`, `userType`) VALUES (301030, '生产管理-资产管理-删除', '/asset/delete', 3, 0, '2021-03-26 10:39:44', 1, '系统管理员', NULL);
INSERT INTO `iot-plm`.`mortals_iot_resource`(`id`, `name`, `url`, `authType`, `sourceType`, `createTime`, `createUserId`, `createUserName`, `userType`) VALUES (301031, '生产管理-资产事件-删除', '/asset/flow/event/delete', 3, 0, '2021-03-26 10:40:22', 1, '系统管理员', NULL);
INSERT INTO `iot-plm`.`mortals_iot_resource`(`id`, `name`, `url`, `authType`, `sourceType`, `createTime`, `createUserId`, `createUserName`, `userType`) VALUES (301032, '生产管理-资产事件扩展字段-删除', '/asset/flow/eventfield/delete', 3, 0, '2021-03-26 10:42:19', 1, '系统管理员', NULL);
INSERT INTO `iot-plm`.`mortals_iot_resource`(`id`, `name`, `url`, `authType`, `sourceType`, `createTime`, `createUserId`, `createUserName`, `userType`) VALUES (301033, '往来方-客户-删除', '/partner/delete', 3, 0, '2021-03-26 10:43:22', 1, '系统管理员', NULL);
INSERT INTO `iot-plm`.`mortals_iot_resource`(`id`, `name`, `url`, `authType`, `sourceType`, `createTime`, `createUserId`, `createUserName`, `userType`) VALUES (301034, '往来方-供应商-删除', '/supplier/delete', 3, 0, '2021-03-26 10:43:58', 1, '系统管理员', NULL);
INSERT INTO `iot-plm`.`mortals_iot_resource`(`id`, `name`, `url`, `authType`, `sourceType`, `createTime`, `createUserId`, `createUserName`, `userType`) VALUES (301035, '配置-字段配置-删除', '/config/field/delete', 3, 0, '2021-03-26 10:44:28', 1, '系统管理员', NULL);
INSERT INTO `iot-plm`.`mortals_iot_resource`(`id`, `name`, `url`, `authType`, `sourceType`, `createTime`, `createUserId`, `createUserName`, `userType`) VALUES (301036, '配置-仓库配置-删除', '/warehouse/delete', 3, 0, '2021-03-26 10:45:03', 1, '系统管理员', NULL);
INSERT INTO `iot-plm`.`mortals_iot_resource`(`id`, `name`, `url`, `authType`, `sourceType`, `createTime`, `createUserId`, `createUserName`, `userType`) VALUES (301037, '附件管理-附件-查看', '/attach/list,/attach/view', 3, 0, '2021-03-26 10:46:54', 1, '系统管理员', NULL);
INSERT INTO `iot-plm`.`mortals_iot_resource`(`id`, `name`, `url`, `authType`, `sourceType`, `createTime`, `createUserId`, `createUserName`, `userType`) VALUES (301038, '附件管理-附件-维护', '/attach/add,/attach/edit,/attach/save', 3, 0, '2021-03-26 10:47:33', 1, '系统管理员', NULL);
INSERT INTO `iot-plm`.`mortals_iot_resource`(`id`, `name`, `url`, `authType`, `sourceType`, `createTime`, `createUserId`, `createUserName`, `userType`) VALUES (301039, '附件管理-附件-删除', '/attach/delete', 3, 0, '2021-03-26 10:48:00', 1, '系统管理员', NULL);
