CREATE TABLE `tb_virt_food` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `food_type` tinyint(3) DEFAULT '1' COMMENT '饭卡类型 1-通用 2-企业',
  `food_name` varchar(50) DEFAULT NULL COMMENT '饭卡组名称',
  `account_number` varchar(20) DEFAULT NULL COMMENT '账户',
  `account_password` varchar(20) DEFAULT NULL COMMENT '账户密码',
  `org_id` bigint(20) DEFAULT NULL COMMENT '主项目ID',
  `virt_id` bigint(20) DEFAULT NULL COMMENT '企业ID-企业类型时必填',
  `card_no` varchar(50) DEFAULT NULL COMMENT '饭卡号',
  `approval_status` tinyint(2) DEFAULT NULL COMMENT '1-待审核 2-审核通过 3-审核不通过',
  `approval_remarks` varchar(100) DEFAULT NULL,
  `enabled` tinyint(2) DEFAULT NULL COMMENT '启动1 禁用2',
  `created_by` bigint(20) DEFAULT NULL COMMENT '创建者',
  `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  `updated_by` bigint(20) DEFAULT NULL COMMENT '修改者',
  `updated_at` datetime DEFAULT NULL COMMENT '修改时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `card_no` (`card_no`),
  UNIQUE KEY `food_name` (`food_name`),
  KEY `org_id` (`org_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=utf8;

CREATE TABLE `tb_virt_food_config` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `food_id` bigint(20) DEFAULT NULL,
  `merchant_name1` varchar(100) DEFAULT NULL,
  `merchant_name2` varchar(100) DEFAULT NULL,
  `merchant_name3` varchar(100) DEFAULT NULL,
  `merchant_name4` varchar(100) DEFAULT NULL,
  `discount1` varchar(10) DEFAULT NULL,
  `discount2` varchar(10) DEFAULT NULL,
  `discount3` varchar(10) DEFAULT NULL,
  `discount4` varchar(10) DEFAULT NULL,
  `logo1` varchar(200) DEFAULT NULL,
  `logo2` varchar(200) DEFAULT NULL,
  `logo3` varchar(200) DEFAULT NULL,
  `logo4` varchar(200) DEFAULT NULL,
  `out_url` varchar(100) DEFAULT NULL,
  `created_by` bigint(20) DEFAULT NULL COMMENT '创建者',
  `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  `updated_by` bigint(20) DEFAULT NULL COMMENT '修改者',
  `updated_at` datetime DEFAULT NULL COMMENT '修改时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `food_id` (`food_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;

CREATE TABLE `tb_virt_food_org` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `food_id` bigint(20) DEFAULT NULL,
  `org_id` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8;

CREATE TABLE `tb_virt_food_outconfig` (
  `id` bigint(20) NOT NULL,
  `remarks` varchar(50) DEFAULT NULL,
  `interface_url` varchar(100) DEFAULT NULL,
  `encodekey` varchar(100) DEFAULT NULL,
  `qudaohao` varchar(50) DEFAULT NULL,
  `param1` varchar(50) DEFAULT NULL,
  `param2` varchar(50) DEFAULT NULL,
  `param3` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `tb_virt_food_person` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `food_id` bigint(20) DEFAULT NULL COMMENT '饭卡组ID',
  `openid` varchar(40) DEFAULT NULL,
  `org_id` bigint(20) DEFAULT NULL COMMENT '项目ID',
  `virt_id` bigint(20) DEFAULT NULL,
  `mobile` varchar(20) DEFAULT NULL,
  `created_by` bigint(20) DEFAULT NULL COMMENT '创建者',
  `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;

INSERT INTO `tb_virt_food_outconfig` (`id`, `remarks`, `interface_url`, `encodekey`, `qudaohao`, `param1`, `param2`, `param3`) VALUES ('1', '威富通企业注册接口', 'https://wxacard.hstydev.com/localserver2/welfare-openapi-web/channel/gateway', '56d55ef6d5de41ba84df5883e0e90039', '8888888888', NULL, NULL, NULL);
