DROP TABLE IF EXISTS `admin_yifan_shipping_method`;
CREATE TABLE IF NOT EXISTS `admin_yifan_shipping_method` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增ID',
  `shop_id` bigint(20) NOT NULL COMMENT '店铺ID',
  `wms_id` bigint(20) NOT NULL COMMENT '仓库编码ID',
  `warehouse_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '仓库名',
  `warehouse_code` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '仓库代码',
  `code` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '渠道代码',
  `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '渠道名称',
  `carrier_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '渠道的签名类型',
  `signature_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '物流商中文名称',
  `insurance_flag` int(11) DEFAULT '0' COMMENT '是否支持保险 0不支持 1支持',
  `channel_type` int(11) DEFAULT '0' COMMENT '渠道类型：1-需获取面单（打单系统）；2-无需面单；3-上传物流面单（用户上传）',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `q` (`shop_id`,`wms_id`,`warehouse_name`(191),`warehouse_code`) USING BTREE,
  KEY `s` (`code`,`name`(191)) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=138 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPACT;

INSERT INTO `admin_yifan_shipping_method` (`id`, `shop_id`, `wms_id`, `warehouse_name`, `warehouse_code`, `code`, `name`, `carrier_name`, `signature_type`, `insurance_flag`, `channel_type`, `created_at`, `updated_at`) VALUES
(111, 1, 1, '琦玉仓', 'qiyu', 'GREEN_BOX_YUANTONG', '圆通', '系统默认渠道', '[\"DIRECT\",\"INDIRECT\",\"ADULT\"]', 1, 1, '2026-01-05 21:00:16', '2026-01-08 06:01:11'),
(112, 1, 1, '琦玉仓', 'qiyu', 'SAGAWA_K5', '青岛仓-佐川小包', '系统默认渠道', '[\"DIRECT\",\"INDIRECT\",\"ADULT\"]', 1, 1, '2026-01-05 21:00:16', '2026-01-08 06:01:13'),
(113, 1, 1, '琦玉仓', 'qiyu', 'SAGAWA_K5_ZCTK_K5', '青岛仓-特快小包', '系统默认渠道', '[\"DIRECT\",\"INDIRECT\",\"ADULT\"]', 1, 1, '2026-01-05 21:00:16', '2026-01-08 06:01:04'),
(114, 1, 1, '琦玉仓', 'qiyu', 'SAGAWA_MIDDLE', '佐川急便(middle)', '系统默认渠道', '[\"DIRECT\",\"INDIRECT\",\"ADULT\"]', 1, 1, '2026-01-05 21:00:16', '2026-01-08 06:01:03'),
(115, 1, 1, '琦玉仓', 'qiyu', 'SAGAWA_YF', 'D青岛仓-一番（海运）', '系统默认渠道', '[\"DIRECT\",\"INDIRECT\",\"ADULT\"]', 1, 1, '2026-01-05 21:00:16', '2026-01-08 06:01:03'),
(116, 1, 1, '琦玉仓', 'qiyu', 'SEINO', '西濃', '系统默认渠道', '[\"DIRECT\",\"INDIRECT\",\"ADULT\"]', 0, 1, '2026-01-05 21:00:16', '2026-01-08 06:01:01'),
(117, 1, 1, '琦玉仓', 'qiyu', 'YAMATO', '黑猫', '系统默认渠道', '[\"DIRECT\",\"INDIRECT\",\"ADULT\"]', 1, 1, '2026-01-05 21:00:16', '2026-01-08 06:01:16'),
(118, 1, 1, '琦玉仓', 'qiyu', 'YAMATO_PACKAGEBL_K5', '青岛仓-NKPS小包', '系统默认渠道', '[\"DIRECT\",\"INDIRECT\",\"ADULT\"]', 1, 1, '2026-01-05 21:00:16', '2026-01-08 06:01:19'),
(119, 1, 1, '琦玉仓', 'qiyu', 'YAMATO_ZJBTD', '黑猫宅急便', '系统默认渠道', '[\"DIRECT\",\"INDIRECT\",\"ADULT\"]', 1, 1, '2026-01-05 21:00:16', '2026-01-08 06:01:00'),
(120, 1, 1, '大阪仓', 'daban', 'GREEN_BOX_YUANTONG', '圆通', '系统默认渠道', '[\"DIRECT\",\"INDIRECT\",\"ADULT\"]', 1, 1, '2026-01-05 21:00:16', '2026-01-08 06:06:14'),
(121, 1, 1, '大阪仓', 'daban', 'SAGAWA_K5', '青岛仓-佐川小包', '系统默认渠道', '[\"DIRECT\",\"INDIRECT\",\"ADULT\"]', 1, 1, '2026-01-05 21:00:16', '2026-01-08 06:06:15'),
(122, 1, 1, '大阪仓', 'daban', 'SAGAWA_K5_ZCTK_K5', '青岛仓-特快小包', '系统默认渠道', '[\"DIRECT\",\"INDIRECT\",\"ADULT\"]', 1, 1, '2026-01-05 21:00:16', '2026-01-08 06:06:16'),
(123, 1, 1, '大阪仓', 'daban', 'SAGAWA_MIDDLE', '佐川急便(middle)', '系统默认渠道', '[\"DIRECT\",\"INDIRECT\",\"ADULT\"]', 1, 1, '2026-01-05 21:00:16', '2026-01-08 06:06:16'),
(124, 1, 1, '大阪仓', 'daban', 'SAGAWA_YF', 'D青岛仓-一番（海运）', '系统默认渠道', '[\"DIRECT\",\"INDIRECT\",\"ADULT\"]', 1, 1, '2026-01-05 21:00:16', '2026-01-08 06:06:17'),
(125, 1, 1, '大阪仓', 'daban', 'SEINO', '西濃', '系统默认渠道', '[\"DIRECT\",\"INDIRECT\",\"ADULT\"]', 0, 1, '2026-01-05 21:00:16', '2026-01-08 06:06:18'),
(126, 1, 1, '大阪仓', 'daban', 'YAMATO', '黑猫', '系统默认渠道', '[\"DIRECT\",\"INDIRECT\",\"ADULT\"]', 1, 1, '2026-01-05 21:00:16', '2026-01-08 06:06:19'),
(127, 1, 1, '大阪仓', 'daban', 'YAMATO_PACKAGEBL_K5', '青岛仓-NKPS小包', '系统默认渠道', '[\"DIRECT\",\"INDIRECT\",\"ADULT\"]', 1, 1, '2026-01-05 21:00:16', '2026-01-08 06:06:20'),
(128, 1, 1, '大阪仓', 'daban', 'YAMATO_ZJBTD', '黑猫宅急便', '系统默认渠道', '[\"DIRECT\",\"INDIRECT\",\"ADULT\"]', 1, 1, '2026-01-05 21:00:16', '2026-01-08 06:06:21'),
(129, 1, 1, '茨城仓', 'cicheng', 'GREEN_BOX_YUANTONG', '圆通', '系统默认渠道', '[\"DIRECT\",\"INDIRECT\",\"ADULT\"]', 1, 1, '2026-01-05 21:00:16', '2026-01-08 06:08:12'),
(130, 1, 1, '茨城仓', 'cicheng', 'SAGAWA_K5', '青岛仓-佐川小包', '系统默认渠道', '[\"DIRECT\",\"INDIRECT\",\"ADULT\"]', 1, 1, '2026-01-05 21:00:16', '2026-01-08 06:08:12'),
(131, 1, 1, '茨城仓', 'cicheng', 'SAGAWA_K5_ZCTK_K5', '青岛仓-特快小包', '系统默认渠道', '[\"DIRECT\",\"INDIRECT\",\"ADULT\"]', 1, 1, '2026-01-05 21:00:16', '2026-01-08 06:08:12'),
(132, 1, 1, '茨城仓', 'cicheng', 'SAGAWA_MIDDLE', '佐川急便(middle)', '系统默认渠道', '[\"DIRECT\",\"INDIRECT\",\"ADULT\"]', 1, 1, '2026-01-05 21:00:16', '2026-01-08 06:08:12'),
(133, 1, 1, '茨城仓', 'cicheng', 'SAGAWA_YF', 'D青岛仓-一番（海运）', '系统默认渠道', '[\"DIRECT\",\"INDIRECT\",\"ADULT\"]', 1, 1, '2026-01-05 21:00:16', '2026-01-08 06:08:12'),
(134, 1, 1, '茨城仓', 'cicheng', 'SEINO', '西濃', '系统默认渠道', '[\"DIRECT\",\"INDIRECT\",\"ADULT\"]', 1, 1, '2026-01-05 21:00:16', '2026-01-08 06:08:12'),
(135, 1, 1, '茨城仓', 'cicheng', 'YAMATO', '黑猫', '系统默认渠道', '[\"DIRECT\",\"INDIRECT\",\"ADULT\"]', 1, 1, '2026-01-05 21:00:16', '2026-01-08 06:08:12'),
(136, 1, 1, '茨城仓', 'cicheng', 'YAMATO_PACKAGEBL_K5', '青岛仓-NKPS小包', '系统默认渠道', '[\"DIRECT\",\"INDIRECT\",\"ADULT\"]', 1, 1, '2026-01-05 21:00:16', '2026-01-08 06:08:12'),
(137, 1, 1, '茨城仓', 'cicheng', 'YAMATO_ZJBTD', '黑猫宅急便', '系统默认渠道', '[\"DIRECT\",\"INDIRECT\",\"ADULT\"]', 1, 1, '2026-01-05 21:00:16', '2026-01-08 06:07:11');

DROP TABLE IF EXISTS `admin_yifan_warehouse`;
CREATE TABLE IF NOT EXISTS `admin_yifan_warehouse` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增ID',
  `shop_id` bigint(20) NOT NULL COMMENT '店铺ID',
  `wms_id` bigint(20) NOT NULL,
  `warehouse_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '仓库名称',
  `warehouse_code` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '仓库编码',
  `warehouse_country_code` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending' COMMENT '仓库国家',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `q` (`shop_id`,`wms_id`) USING BTREE,
  KEY `s` (`shop_id`,`wms_id`,`warehouse_name`(191),`warehouse_code`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPACT;

INSERT INTO `admin_yifan_warehouse` (`id`, `shop_id`, `wms_id`, `warehouse_name`, `warehouse_code`, `warehouse_country_code`, `created_at`, `updated_at`) VALUES
(6, 1, 1, '琦玉仓', 'qiyu', 'JP', '2026-01-05 21:00:16', '2026-01-08 05:50:27'),
(7, 1, 1, '大阪仓', 'daban', 'JP', '2026-01-05 21:00:16', '2026-01-08 05:50:29'),
(8, 1, 1, '茨城仓', 'cicheng', 'JP', '2026-01-05 21:00:16', '2026-01-08 05:50:31');