-- ----------------------------
-- Table structure for blade_common_address
-- ----------------------------
DROP TABLE IF EXISTS `blade_common_address`;
CREATE TABLE `blade_common_address` (
  `id` bigint(20) NOT NULL COMMENT '主键',
  `tenant_id` varchar(12) DEFAULT '000000' COMMENT '租户ID',
  `address_code` varchar(20) NOT NULL COMMENT '地址编号',
  `address_name` varchar(100) NOT NULL COMMENT '地址名称',
  `address_type` varchar(20) NOT NULL COMMENT '地址类型：常规地址、港口/码头、铁路车站、空港机场',
  `source_id` bigint(20) DEFAULT NULL COMMENT '来源主数据ID',
  `site_code` varchar(30) DEFAULT NULL COMMENT '站点编码',
  `detail_address` varchar(255) NOT NULL COMMENT '详细地址',
  `region_code` varchar(32) DEFAULT NULL COMMENT '行政区划编码',
  `region_name` varchar(100) NOT NULL COMMENT '行政区划',
  `longitude` decimal(12,6) NOT NULL COMMENT '经度',
  `latitude` decimal(12,6) NOT NULL COMMENT '纬度',
  `dept_id` bigint(20) NOT NULL COMMENT '所属组织ID',
  `dept_name` varchar(100) NOT NULL COMMENT '所属组织',
  `contact_name` varchar(50) DEFAULT NULL COMMENT '联系人',
  `contact_phone` varchar(30) DEFAULT NULL COMMENT '联系方式',
  `remark` varchar(200) DEFAULT NULL COMMENT '备注',
  `create_user` bigint(20) DEFAULT NULL COMMENT '创建人',
  `create_dept` bigint(20) DEFAULT NULL COMMENT '创建部门',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `update_user` bigint(20) DEFAULT NULL COMMENT '修改人',
  `update_time` datetime DEFAULT NULL COMMENT '修改时间',
  `status` int(11) DEFAULT '1' COMMENT '状态',
  `is_deleted` int(11) DEFAULT '0' COMMENT '是否已删除',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `uk_common_address_code` (`address_code`) USING BTREE,
  KEY `idx_common_address_type` (`address_type`) USING BTREE,
  KEY `idx_common_address_site` (`site_code`) USING BTREE,
  KEY `idx_common_address_dept` (`dept_id`) USING BTREE,
  KEY `idx_common_address_update` (`update_time`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='常用地址';

-- ----------------------------
-- Menu data for common address
-- ----------------------------
INSERT IGNORE INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES
(2080000000000000001, 0, 'base_data', '基础数据', 'base_data', '/base', 'iconfont icon-caidan', 30, 1, 0, 1, NULL, '', 0),
(2080000000000000010, 2080000000000000001, 'common_address', '常用地址', 'common_address', '/base/common-address', 'iconfont icon-dizhi', 10, 1, 0, 1, NULL, '', 0),
(2080000000000000011, 2080000000000000010, 'common_address_view', '查看', 'common_address_view', '', '', 1, 2, 0, 1, NULL, '', 0),
(2080000000000000012, 2080000000000000010, 'common_address_add', '新增', 'common_address_add', '', '', 2, 2, 0, 1, NULL, '', 0),
(2080000000000000013, 2080000000000000010, 'common_address_edit', '编辑', 'common_address_edit', '', '', 3, 2, 0, 1, NULL, '', 0),
(2080000000000000014, 2080000000000000010, 'common_address_delete', '删除', 'common_address_delete', '', '', 4, 2, 0, 1, NULL, '', 0),
(2080000000000000015, 2080000000000000010, 'common_address_export', '批量导出', 'common_address_export', '', '', 5, 2, 0, 1, NULL, '', 0);
