CREATE TABLE `t_equipment_charge_order` ( `id` bigint(20) NOT NULL auto_increment, `user_id` bigint(20) NOT NULL COMMENT '用户id', `company_id` bigint(20) COMMENT '企业id', `station_id` bigint(20) COMMENT '充电站id', `equipment_id` bigint(20) NOT NULL COMMENT '充电桩id', `connector_id` bigint(20) NOT NULL COMMENT '充电枪id', `user_card_no` varchar(32) COMMENT '用户充电卡号', `state` tinyint(4) COMMENT '订单状态 0 创建中 1准备充电中 2 充电中 3完成 4 取消 5挂起 6需要手动补单 7结算中', `operate_state` tinyint(4) DEFAULT '0' COMMENT '订单操作状态 0无 1启动充电 2结束充电 ', `order_no` varchar(20) NOT NULL COMMENT '订单号', `platform_order_no` varchar(50) COMMENT '平台订单号【互通互联】', `platform_sale_type` tinyint(4) DEFAULT '1' COMMENT '平台转售模式【互通互联】1:转售模式(该模式下由用户运营商向用户开票,由设备运营商给用户运营商开票)2:代收代付模式(该模式下,由设备运营商直接给用户开票)', `platform_driver_id` varchar(50) COMMENT '平台用户ID【互通互联】', `platform_phone` varchar(50) COMMENT '平台用户手机号【互通互联】', `charging_amt` decimal(20,2) DEFAULT '0.00' COMMENT '预充金额,电量充到该金额自动停止充电', `order_type` tinyint(4) COMMENT '订单类型 1普通用户订单 3 企业用户订单 4第三方平台订单', `order_time` datetime COMMENT '订单时间', `charge_begin_time` datetime COMMENT '充电开始时间', `charge_end_time` datetime COMMENT '充电结束时间', `charge_begin_degree` double(10,2) DEFAULT '0.00' COMMENT '充电开始度数', `charge_end_degree` double(10,2) DEFAULT '0.00' COMMENT '充电结束度数', `charge_degree` double(10,3) DEFAULT '0.000' COMMENT '充电度数', `charge_ah` double(50,2) DEFAULT '0.00' COMMENT '充电电量', `charge_times_degree` varchar(1000) COMMENT '充电分时度数', `charge_begin_soc` int(20) DEFAULT '0' COMMENT '充电开始soc', `charge_end_soc` int(20) DEFAULT '0' COMMENT '充电结束soc', `charge_cur_soc` int(20) DEFAULT '0' COMMENT '充电当前soc', `charge_duration` int(20) DEFAULT '0' COMMENT '充电时长', `charge_settle_type` tinyint(4), `charge_unit_price` decimal(10,7) COMMENT '电费单价', `charge_unit_cost` decimal(10,7) COMMENT '电费成本单价', `charge_unit_service_fee` decimal(20,7) COMMENT '服务费单价', `receivable_electric_fee` decimal(20,7) DEFAULT '0.0000000' COMMENT '应收电费', `receivable_service_fee` decimal(20,7) DEFAULT '0.0000000' COMMENT '应收服务费', `receivable_total_fee` decimal(20,7) DEFAULT '0.0000000' COMMENT '应收总金额', `charge_elecfee_amount` decimal(20,7) DEFAULT '0.0000000' COMMENT '电费(实收电费)', `charge_elecfee_cost_amount` decimal(20,7) DEFAULT '0.0000000' COMMENT '电费成本', `charge_service_amount` decimal(20,7) DEFAULT '0.0000000' COMMENT '服务费(实收服务费)', `actual_pay_amount` decimal(20,2) DEFAULT '0.00' COMMENT '实际支付金额', `pay_order_no` varchar(30) COMMENT '支付订单号', `pay_amount` decimal(20,2) DEFAULT '0.00' COMMENT '本次订单付款金额', `pay_method` tinyint(4) COMMENT '支付方式 0 余额支付 1 支付宝 2微信小程序 3微信app支付', `pay_status` tinyint(4) DEFAULT '0' COMMENT '支付状态 0未支付 1待支付 2已支付 3支付失败', `pay_time` datetime COMMENT '支付时间', `user_coupon_id` bigint(20) COMMENT '用户 优惠劵id', `coupon_name` varchar(30) COMMENT '优惠券名称', `coupon_type` tinyint(4) COMMENT '优惠券类型', `coupon_amount` decimal(20,2) DEFAULT '0.00' COMMENT '优惠券总金额', `elecfee_coupon_amount` decimal(20,2) DEFAULT '0.00' COMMENT '电费优惠券金额', `servicefee_coupon_amount` decimal(20,2) DEFAULT '0.00' COMMENT '服务费优惠券金额', `invoice_id` bigint(20) COMMENT '发票id', `invoice_fee` decimal(20,2) DEFAULT '0.00' COMMENT '可以开票金额', `ticket_status` tinyint(4) DEFAULT '0' COMMENT '0未开票 1代开票 2已开票', `activity_electric_fee` decimal(20,7) DEFAULT '0.0000000' COMMENT '活动时优惠了的电费 [降价活动]', `activity_service_fee` decimal(20,2) DEFAULT '0.00' COMMENT '活动时优惠了的服务费[降价活动]', `charge_plate_no` varchar(20) COMMENT '车牌号', `charge_vin` varchar(100) COMMENT '车辆vin码', `charge_strategy` varchar(20) COMMENT '充电策略', `charge_strategy_param` varchar(30) COMMENT '充电策略参数', `operator_id` bigint(20) COMMENT '运营商id', `operator_income` decimal(20,2) DEFAULT '0.00' COMMENT '运营商收入金额', `plat_service_fee` decimal(20,2) DEFAULT '0.00' COMMENT '平台服务费', `charge_discount_type` tinyint(4) DEFAULT '0' COMMENT '充电优惠类型 0 服务费折扣(0%) 1 固定服务费(元/度)2整体折扣 (0%)3固定价格在进行折扣 4固定电费服务费价格', `settle_electric_fee` decimal(20,2) DEFAULT '0.00' COMMENT '算结电费', `settle_service_fee` decimal(20,2) DEFAULT '0.00' COMMENT '算结服务费', `settle_fee` decimal(20,2) DEFAULT '0.00' COMMENT '结算总费用', `settle_method` tinyint(4) DEFAULT '2' COMMENT '0预付 1 后结 2实时', `settle_coupon_amount` decimal(20,2) DEFAULT '0.00' COMMENT '算结优惠金额', `settle_coupon_electric_fee` decimal(20,2) DEFAULT '0.00' COMMENT '结算电费金额', `settle_coupon_service_fee` decimal(20,2) DEFAULT '0.00' COMMENT '算结服务费', `settle_status` tinyint(4) DEFAULT '0' COMMENT '是否开启结算 0关闭 1开通', `cancel_type` int(4) COMMENT '取消类型 1(后台异常取消) 2(设备异常取消),3(订单挂起),4(已结束订单又被唤起)', `cancel_code` int(4) COMMENT '0 创建中订单(状态0)超过60秒自动取消, 1 创建中订单(状态1)超过60秒自动取消,2 充电中订单(状态2)超过24小时自动取消,3 充电中订单(开始时间异常)超过3分钟自动取消,4卡单,5订单挂起 6已结束订单又被唤起为充电中', `cancel_msg` varchar(100) COMMENT '取消原因', `cancel_time` datetime COMMENT '取消时间', `finish_type` int(10) COMMENT '结束类型', `finish_code` int(10) COMMENT '结束编码', `finish_msg` varchar(100) COMMENT '结束原因', `finish_time` datetime COMMENT '订单结束时间', `boot_mode` tinyint(4) DEFAULT '1' COMMENT '启动方式 0本地刷卡启动 1后台启动 2本地管理员启动', `settlement_type` tinyint(4) DEFAULT '0' COMMENT '结算类型0余额结算 1电卡结算 2电卡结算+余额结算', `is_parking_coupon` tinyint(4) DEFAULT '0' COMMENT '领取停车券状态 0未领取停车券 1领券停车券', `control_source` varchar(50) COMMENT '渠道 wx 微信, bk 后台 ,app ', `exception_flag` tinyint(4) DEFAULT '0' COMMENT '订单异常标志 0正常 1电量负数 2 vin相同,在一个有交集的时间段内出现的订单异常 3电量异常修正后订单', `exception_msg` varchar(255) COMMENT '订单异常描述', `report_time` datetime COMMENT '订单上报时间', `com_service_fee` decimal(10,2) DEFAULT '0.00' COMMENT '企业服务费', `com_electric_fee` decimal(10,2) DEFAULT '0.00' COMMENT '企业电费', `com_total_fee` decimal(10,2) DEFAULT '0.00' COMMENT '企业费用', `com_charge_discount_type` tinyint(4) COMMENT '企业结算折扣方式 充电优惠类型 0 服务费折扣(0%); 1 固定服务费(元/度);2整体折扣 (0%)3固定价格基础上服务费在进行折扣 4固定价格(电费单价+服务费单价);', `com_charge_discount` double(10,2) DEFAULT '0.00' COMMENT '优惠折扣', `has_shallow_report` tinyint(4) DEFAULT '0' COMMENT '有无浅检报告 0无 1有', `has_deep_report` tinyint(4) DEFAULT '0' COMMENT '有无深检报告 0无 1有', `is_exception` tinyint(4) DEFAULT '0' COMMENT '是否为异常订单 0否 1是', `shallow_report_is_received` tinyint(4) DEFAULT '0' COMMENT '是否已领取浅检报告 0未领取 1已领取', `create_time` datetime COMMENT '创建时间', `update_time` datetime COMMENT '更新时间', `charge_market_id` bigint(20), `coupon_total_amount` decimal(20,2) NOT NULL DEFAULT '0.00' COMMENT '总优惠金额', `coupon_service_total_amount` decimal(20,2) NOT NULL DEFAULT '0.00' COMMENT '总优惠服务费', `coupon_elecfee_total_amount` decimal(20,2) NOT NULL DEFAULT '0.00' COMMENT '总优惠服务费', `activity_name` varchar(255) NOT NULL DEFAULT '' COMMENT '活动名称', `activity_total_fee` decimal(20,2) NOT NULL DEFAULT '0.00' COMMENT '活动时优惠了的总金额[充电折扣活动]', `company_activity_id` bigint(20) COMMENT '企业活动id', `company_activity_name` varchar(1000) COMMENT '企业活动名称', `company_activity_total_fee` decimal(20,2) NOT NULL DEFAULT '0.00' COMMENT '企业优惠总金额', `company_activity_service_fee` decimal(20,2) NOT NULL DEFAULT '0.00' COMMENT '企业优惠服务费', `company_activity_electric_fee` decimal(20,7) NOT NULL DEFAULT '0.0000000' COMMENT '企业优惠电费', `subsidy_degree` decimal(20,3) NOT NULL DEFAULT '0.000' COMMENT '补贴度数', `subsidy_fee` decimal(20,2) NOT NULL DEFAULT '0.00' COMMENT '补贴金额', `special_channel_order_source` tinyint(4) COMMENT '特殊渠道订单来源 1启明', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;