-- ----------------------------
-- Table structure for blade_insurance_record
-- ----------------------------
DROP TABLE IF EXISTS `blade_insurance_record`;
CREATE TABLE `blade_insurance_record` (
  `id` bigint(20) NOT NULL COMMENT '主键',
  `tenant_id` varchar(12) DEFAULT '000000' COMMENT '租户ID',
  `vehicle_type` varchar(20) NOT NULL COMMENT '车船类型',
  `vehicle_no` varchar(50) NOT NULL COMMENT '车牌号/船号',
  `insurance_type` varchar(50) NOT NULL COMMENT '保险类型',
  `policy_no` varchar(80) NOT NULL COMMENT '保单号',
  `start_date` date NOT NULL COMMENT '开始日期',
  `end_date` date NOT NULL COMMENT '结束日期',
  `insured_amount` decimal(18,2) DEFAULT NULL COMMENT '保额',
  `premium` decimal(18,2) NOT NULL DEFAULT '0.00' COMMENT '保费',
  `invoice_no` varchar(80) DEFAULT NULL COMMENT '发票号',
  `invoice_date` date DEFAULT NULL COMMENT '开票日期',
  `ocr_template` varchar(100) DEFAULT NULL COMMENT 'OCR识别模板',
  `policy_file` varchar(1000) 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_insurance_record_policy` (`vehicle_type`,`insurance_type`,`policy_no`) USING BTREE,
  KEY `idx_insurance_record_vehicle` (`vehicle_type`,`vehicle_no`) USING BTREE,
  KEY `idx_insurance_record_type` (`insurance_type`) USING BTREE,
  KEY `idx_insurance_record_end_date` (`end_date`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='保险记录';

-- ----------------------------
-- Records of blade_menu for insurance record
-- parent_id 默认挂载至 transport.sql 中的“车/船务管理”：2075436235826896898
-- ----------------------------
INSERT INTO `blade_menu` (`id`, `parent_id`, `code`, `name`, `alias`, `path`, `source`, `sort`, `category`, `action`, `is_open`, `component`, `remark`, `is_deleted`) VALUES
(2077610000000000001, 2075436235826896898, 'insurance_record', '保险记录(OCR)', 'insurance_record', '/vehicle/insurance-record', 'iconfont iconicon_doc', 60, 1, 0, 1, '', '', 0),
(2077610000000000002, 2077610000000000001, 'insurance_record_add', '新增', 'insurance_record_add', '', '', 1, 2, 0, 1, NULL, '', 0),
(2077610000000000003, 2077610000000000001, 'insurance_record_edit', '编辑', 'insurance_record_edit', '', '', 2, 2, 0, 1, NULL, '', 0),
(2077610000000000004, 2077610000000000001, 'insurance_record_delete', '批量删除', 'insurance_record_delete', '', '', 3, 2, 0, 1, NULL, '', 0),
(2077610000000000005, 2077610000000000001, 'insurance_record_view', '查看', 'insurance_record_view', '', '', 4, 2, 0, 1, NULL, '', 0),
(2077610000000000006, 2077610000000000001, 'insurance_record_import', '批量导入', 'insurance_record_import', '', '', 5, 2, 0, 1, NULL, '', 0),
(2077610000000000007, 2077610000000000001, 'insurance_record_template', '下载模板', 'insurance_record_template', '', '', 6, 2, 0, 1, NULL, '', 0),
(2077610000000000008, 2077610000000000001, 'insurance_record_export', '批量导出', 'insurance_record_export', '', '', 7, 2, 0, 1, NULL, '', 0),
(2077610000000000009, 2077610000000000001, 'insurance_record_list', '列表', 'insurance_record_list', '/blade-transport/insurance-record/list', '', 8, 2, 0, 1, NULL, '', 0),
(2077610000000000010, 2077610000000000001, 'insurance_record_ocr', 'OCR识别', 'insurance_record_ocr', '', '', 9, 2, 0, 1, NULL, '', 0);
