ALTER TABLE tb_accident_info ADD accident_scene_video varchar(5000) NULL;
COMMENT ON COLUMN tb_accident_info.accident_scene_video IS '事故现场视频';


ALTER TABLE public.tb_vehicle ADD battery_brand_and_model varchar(32) NULL;
COMMENT ON COLUMN public.tb_vehicle.battery_brand_and_model IS '电池品牌及型号';
ALTER TABLE public.tb_vehicle ADD electronic_control_brand_and_model varchar(32) NULL;
COMMENT ON COLUMN public.tb_vehicle.electronic_control_brand_and_model IS '电控品牌及型号';
ALTER TABLE public.tb_vehicle ADD curb_weight numeric(12, 2) NULL;
COMMENT ON COLUMN public.tb_vehicle.curb_weight IS '整备质量';


ALTER TABLE public.tb_vehicle_check_detail ADD curb_weight numeric(12, 2) NULL;
COMMENT ON COLUMN public.tb_vehicle_check_detail.curb_weight IS '整备质量';

ALTER TABLE public.tb_contract_vehicle ADD curb_weight numeric(12, 2) NULL;
COMMENT ON COLUMN public.tb_contract_vehicle.curb_weight IS '整备质量';

-- public.tb_gis_stopping_alarm definition

-- Drop table

-- DROP TABLE tb_gis_stopping_alarm;

CREATE TABLE tb_gis_stopping_alarm (
                                       id varchar(32) NOT NULL, -- id
                                       plate_number varchar(32) NOT NULL, -- 车牌号
                                       start_time timestamp NOT NULL, -- 告警开始时间
                                       end_time timestamp NULL, -- 告警结束时间
                                       project_id varchar(32) NOT NULL, -- 所属项目id
                                       start_lon numeric(12, 6) NULL, -- 开始经度(高德)
                                       start_lat numeric(12, 6) NULL, -- 开始纬度(高德)
                                       end_lon numeric(12, 6) NULL, -- 结束经度(高德)
                                       end_lat numeric(12, 6) NULL, -- 结束纬度(高德)
                                       stop_time int4 NULL, -- 停车时长（秒）
                                       sys_org_code varchar(32) NULL, -- 所属机构
                                       create_time timestamp NULL, -- 创建时间
                                       update_time timestamp NULL, -- 更新时间
                                       project_name varchar(64) NULL, -- 项目名称
                                       CONSTRAINT tb_gis_speeding_alarm_pk PRIMARY KEY (id)
);
COMMENT ON TABLE public.tb_gis_stopping_alarm IS '停车超时记录';

-- Column comments

COMMENT ON COLUMN public.tb_gis_stopping_alarm.id IS 'id';
COMMENT ON COLUMN public.tb_gis_stopping_alarm.plate_number IS '车牌号';
COMMENT ON COLUMN public.tb_gis_stopping_alarm.start_time IS '告警开始时间';
COMMENT ON COLUMN public.tb_gis_stopping_alarm.end_time IS '告警结束时间';
COMMENT ON COLUMN public.tb_gis_stopping_alarm.project_id IS '所属项目id';
COMMENT ON COLUMN public.tb_gis_stopping_alarm.start_lon IS '开始经度(高德)';
COMMENT ON COLUMN public.tb_gis_stopping_alarm.start_lat IS '开始纬度(高德)';
COMMENT ON COLUMN public.tb_gis_stopping_alarm.end_lon IS '结束经度(高德)';
COMMENT ON COLUMN public.tb_gis_stopping_alarm.end_lat IS '结束纬度(高德)';
COMMENT ON COLUMN public.tb_gis_stopping_alarm.stop_time IS '停车时长（秒）';
COMMENT ON COLUMN public.tb_gis_stopping_alarm.sys_org_code IS '所属机构';
COMMENT ON COLUMN public.tb_gis_stopping_alarm.create_time IS '创建时间';
COMMENT ON COLUMN public.tb_gis_stopping_alarm.update_time IS '更新时间';
COMMENT ON COLUMN public.tb_gis_stopping_alarm.project_name IS '项目名称';



ALTER TABLE public.tb_driver ADD company varchar(64) NULL;
COMMENT ON COLUMN public.tb_driver.company IS '所属公司';
ALTER TABLE public.tb_driver ALTER COLUMN customer_id TYPE varchar(32) USING customer_id::varchar;
ALTER TABLE public.tb_driver ADD employee_type varchar(64) NULL;
COMMENT ON COLUMN public.tb_driver.employee_type IS '员工类别';
ALTER TABLE public.tb_driver ADD is_position varchar(2) NULL;
COMMENT ON COLUMN public.tb_driver.is_position IS '是否定位 0-否,1-是';
ALTER TABLE public.tb_driver ADD age int2 NULL;
COMMENT ON COLUMN public.tb_driver.age IS '年龄';
ALTER TABLE public.tb_driver ADD marital_status varchar(2) NULL;
COMMENT ON COLUMN public.tb_driver.marital_status IS '婚姻状况';
ALTER TABLE public.tb_driver ADD childrens int2 NULL;
COMMENT ON COLUMN public.tb_driver.childrens IS '子女数';
ALTER TABLE public.tb_driver ADD file_number varchar(64) NULL;
COMMENT ON COLUMN public.tb_driver.file_number IS '档案号';


ALTER TABLE public.tb_vehicle ADD oil_card varchar(32) NULL;
COMMENT ON COLUMN public.tb_vehicle.oil_card IS '油卡卡号';


-- public.tb_refuel_charge_record definition

-- Drop table

-- DROP TABLE public.tb_refuel_charge_record;

CREATE TABLE public.tb_refuel_charge_record (
                                                id varchar(32) NOT NULL, -- 主键id
                                                record_date timestamp NULL, -- 日期
                                                order_no varchar(64) NULL, -- 单号
                                                start_time timestamp NULL, -- 开始时间
                                                end_time timestamp NULL, -- 结束时间
                                                project_id varchar(32) NULL, -- 所属项目
                                                vehicle_id varchar(32) NULL, -- 车辆id
                                                frame_number varchar(32) NULL, -- 车架号
                                                vehicle_model varchar(32) NULL, -- 车辆型号
                                                vehicle_type varchar(32) NULL, -- 车辆种类
                                                plate_number varchar(10) NULL, -- 车牌号
                                                fuel_type varchar(2) NULL, -- 燃料类型
                                                oil_card varchar(32) NULL, -- 油卡卡号
                                                oil_type varchar(32) NULL, -- 油品规格
                                                price numeric(11, 2) NULL, -- 单价
                                                amount numeric(11, 2) NULL, -- 数量
                                                total_price numeric(11, 2) NULL, -- 金额
                                                mileage numeric(11, 2) NULL, -- 加油充电时里程
                                                remark text NULL, -- 备注
                                                sys_org_code varchar(16) NULL, -- 所属机构
                                                create_time timestamp NULL, -- 创建时间
                                                update_time timestamp NULL, -- 更新时间
                                                create_by varchar(32) NULL, -- 创建人
                                                update_by varchar(32) NULL, -- 更新人
                                                del_flag int2 NULL DEFAULT 0, -- 删除标志
                                                refuel_type varchar(2) NULL DEFAULT 1, -- 记录类型(1加油，2充电)
                                                source_type varchar(2) NULL DEFAULT 1, -- 来源（1后台，2小程序，3后台导入）
                                                driver varchar(64) NULL, -- 驾驶员
                                                oil_station varchar(64) NULL, -- 加油站
                                                oil_card_balance numeric(11, 2) NULL, -- 油卡余额
                                                attachment_url text NULL, -- 附件url
                                                CONSTRAINT tb_refuel_charge_record_pk PRIMARY KEY (id)
);
COMMENT ON TABLE public.tb_refuel_charge_record IS '加油充电登记';

-- Column comments

COMMENT ON COLUMN public.tb_refuel_charge_record.id IS '主键id';
COMMENT ON COLUMN public.tb_refuel_charge_record.record_date IS '日期';
COMMENT ON COLUMN public.tb_refuel_charge_record.order_no IS '单号';
COMMENT ON COLUMN public.tb_refuel_charge_record.start_time IS '开始时间';
COMMENT ON COLUMN public.tb_refuel_charge_record.end_time IS '结束时间';
COMMENT ON COLUMN public.tb_refuel_charge_record.project_id IS '所属项目';
COMMENT ON COLUMN public.tb_refuel_charge_record.vehicle_id IS '车辆id';
COMMENT ON COLUMN public.tb_refuel_charge_record.frame_number IS '车架号';
COMMENT ON COLUMN public.tb_refuel_charge_record.vehicle_model IS '车辆型号';
COMMENT ON COLUMN public.tb_refuel_charge_record.vehicle_type IS '车辆种类';
COMMENT ON COLUMN public.tb_refuel_charge_record.plate_number IS '车牌号';
COMMENT ON COLUMN public.tb_refuel_charge_record.fuel_type IS '燃料类型';
COMMENT ON COLUMN public.tb_refuel_charge_record.oil_card IS '油卡卡号';
COMMENT ON COLUMN public.tb_refuel_charge_record.oil_type IS '油品规格';
COMMENT ON COLUMN public.tb_refuel_charge_record.price IS '单价';
COMMENT ON COLUMN public.tb_refuel_charge_record.amount IS '数量';
COMMENT ON COLUMN public.tb_refuel_charge_record.total_price IS '金额';
COMMENT ON COLUMN public.tb_refuel_charge_record.mileage IS '加油充电时里程';
COMMENT ON COLUMN public.tb_refuel_charge_record.remark IS '备注';
COMMENT ON COLUMN public.tb_refuel_charge_record.sys_org_code IS '所属机构';
COMMENT ON COLUMN public.tb_refuel_charge_record.create_time IS '创建时间';
COMMENT ON COLUMN public.tb_refuel_charge_record.update_time IS '更新时间';
COMMENT ON COLUMN public.tb_refuel_charge_record.create_by IS '创建人';
COMMENT ON COLUMN public.tb_refuel_charge_record.update_by IS '更新人';
COMMENT ON COLUMN public.tb_refuel_charge_record.del_flag IS '删除标志';
COMMENT ON COLUMN public.tb_refuel_charge_record.refuel_type IS '记录类型(1加油，2充电)';
COMMENT ON COLUMN public.tb_refuel_charge_record.source_type IS '来源（1后台，2小程序，3后台导入）';
COMMENT ON COLUMN public.tb_refuel_charge_record.driver IS '驾驶员';
COMMENT ON COLUMN public.tb_refuel_charge_record.oil_station IS '加油站';
COMMENT ON COLUMN public.tb_refuel_charge_record.oil_card_balance IS '油卡余额';
COMMENT ON COLUMN public.tb_refuel_charge_record.attachment_url IS '附件url';



INSERT INTO sys_permission (id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, icon, is_leaf, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external, hidden) VALUES('1764537969428758530', '1762354981077078018', '查看', '', NULL, NULL, NULL, 2, 'refuelingCharging:view', '1', 1.0, NULL, 1, NULL, '1', 0, NULL, 'yubowen', '2024-03-04 14:26:50.097', 'yubowen', '2024-03-04 14:26:50.097', 0, 0);
INSERT INTO sys_permission (id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, icon, is_leaf, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external, hidden) VALUES('1764537885496541186', '1762354981077078018', '删除', '', NULL, NULL, NULL, 2, 'refuelingCharging:del', '1', 1.0, NULL, 1, NULL, '1', 0, NULL, 'yubowen', '2024-03-04 14:26:30.087', 'yubowen', '2024-03-04 14:27:46.955', 0, 0);
INSERT INTO sys_permission (id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, icon, is_leaf, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external, hidden) VALUES('1764537715715309570', '1762354981077078018', '编辑', '', NULL, NULL, NULL, 2, 'refuelingCharging:update', '1', 1.0, NULL, 1, NULL, '1', 0, NULL, 'yubowen', '2024-03-04 14:25:49.609', 'yubowen', '2024-03-04 14:28:40.789', 0, 0);
INSERT INTO sys_permission (id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, icon, is_leaf, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external, hidden) VALUES('1764530522987266050', '1762354981077078018', '导入', '', NULL, NULL, NULL, 2, 'refuelingCharging:import', '1', 1.0, NULL, 1, NULL, '1', 0, NULL, 'yubowen', '2024-03-04 13:57:14.728', 'yubowen', '2024-03-04 13:57:14.728', 0, 0);
INSERT INTO sys_permission (id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, icon, is_leaf, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external, hidden) VALUES('1764530409388736513', '1762354981077078018', '导出', '', NULL, NULL, NULL, 2, 'refuelingCharging:export', '1', 1.0, NULL, 1, NULL, '1', 0, NULL, 'yubowen', '2024-03-04 13:56:47.644', 'yubowen', '2024-03-04 13:56:47.644', 0, 0);
INSERT INTO sys_permission (id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, icon, is_leaf, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external, hidden) VALUES('1764530109475028994', '1762354981077078018', '新增', '', NULL, NULL, NULL, 2, 'refuelingCharging:add', '1', 1.0, NULL, 1, NULL, '1', 0, NULL, 'yubowen', '2024-03-04 13:55:36.137', 'yubowen', '2024-03-04 13:55:36.137', 0, 0);
INSERT INTO sys_permission (id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, icon, is_leaf, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external, hidden) VALUES('1762354981077078018', '1697180778124619778', '加油充电登记', '/chauffeurManage/RefuelingCharging', 'chauffeurManage/RefuelingCharging/index', NULL, NULL, 1, NULL, NULL, 8.0, NULL, 0, NULL, NULL, 0, NULL, 'yubowen', '2024-02-27 13:52:25.116', 'test90', '2024-02-28 13:38:44.730', 0, 0);
INSERT INTO sys_permission (id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, icon, is_leaf, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external, hidden) VALUES('1762011654396944385', '1761924131223064577', '导出', '', NULL, NULL, NULL, 2, 'InsuranceStatement:export', '1', 1.0, NULL, 1, NULL, '1', 0, NULL, 'yubowen', '2024-02-26 15:08:09.661', 'yubowen', '2024-02-26 15:08:09.661', 0, 0);
INSERT INTO sys_permission (id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, icon, is_leaf, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external, hidden) VALUES('1761946877456502786', '1761931206124720130', '导出', '', NULL, NULL, NULL, 2, 'ParkingTimeout:export', '1', 1.0, NULL, 1, NULL, '1', 0, NULL, 'yubowen', '2024-02-26 10:50:45.624', 'yubowen', '2024-02-26 10:50:45.624', 0, 0);
INSERT INTO sys_permission (id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, icon, is_leaf, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external, hidden) VALUES('1761931206124720130', '1697455362346319874', '停车超时', '/vehicleMonitoring/ParkingTimeout', 'vehicleMonitoring/ParkingTimeout/ParkingTimeout', NULL, NULL, 1, NULL, NULL, 12.0, NULL, 0, NULL, NULL, 0, NULL, 'weibao_leader', '2024-02-26 09:48:29.295', 'weibao_leader', '2024-02-26 09:48:29.295', 0, 0);
INSERT INTO sys_permission (id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, icon, is_leaf, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external, hidden) VALUES('1761924131223064577', '1710545411476578306', '保险年度报表', '/statementCenter/InsuranceStatement', 'statementCenter/InsuranceStatement/InsuranceStatement', NULL, NULL, 1, NULL, NULL, 7.0, NULL, 0, NULL, NULL, 0, NULL, 'weibao_leader', '2024-02-26 09:20:22.506', 'yubowen', '2024-02-26 14:02:16.024', 0, 0);

INSERT INTO sys_dict (id, dict_name, dict_code, description, del_flag, create_by, create_time, update_by, update_time, "type") VALUES('1762299892803129346', '油品规格', 'oil_type', '1：0号 车用柴油(Ⅵ)，2：92号 车用汽油(ⅥB)，3：95号 车用汽油(ⅥB)，4：充电', 0, 'test90', '2024-02-27 10:13:31.048', 'test90', '2024-02-27 10:13:31.048', 0);
INSERT INTO sys_dict (id, dict_name, dict_code, description, del_flag, create_by, create_time, update_by, update_time, "type") VALUES('1761933064054591489', '婚姻状况', 'marital_status', '婚姻状况', 0, 'adminLeader', '2024-02-26 09:55:52.260', 'adminLeader', '2024-02-26 09:55:52.260', 0);


INSERT INTO sys_dict_item (id, dict_id, item_text, item_value, description, sort_order, status, create_by, create_time, update_by, update_time) VALUES('1762300145342173185', '1762299892803129346', '充电', '4', '', 4, 1, 'test90', '2024-02-27 10:14:31.259', 'test90', '2024-02-27 10:14:31.259');
INSERT INTO sys_dict_item (id, dict_id, item_text, item_value, description, sort_order, status, create_by, create_time, update_by, update_time) VALUES('1762300098156253186', '1762299892803129346', '95号 车用汽油(ⅥB)', '3', '', 3, 1, 'test90', '2024-02-27 10:14:20.009', 'test90', '2024-02-27 10:14:20.009');
INSERT INTO sys_dict_item (id, dict_id, item_text, item_value, description, sort_order, status, create_by, create_time, update_by, update_time) VALUES('1762300053604356098', '1762299892803129346', '92号 车用汽油(ⅥB)', '2', '', 2, 1, 'test90', '2024-02-27 10:14:09.387', 'test90', '2024-02-27 10:14:09.387');
INSERT INTO sys_dict_item (id, dict_id, item_text, item_value, description, sort_order, status, create_by, create_time, update_by, update_time) VALUES('1762299995764903937', '1762299892803129346', '0号 车用柴油(Ⅵ)', '1', '', 1, 1, 'test90', '2024-02-27 10:13:55.597', 'test90', '2024-02-27 10:13:55.597');
INSERT INTO sys_dict_item (id, dict_id, item_text, item_value, description, sort_order, status, create_by, create_time, update_by, update_time) VALUES('1761934714072813569', '1761933064054591489', '丧偶', '4', '', 4, 1, 'adminLeader', '2024-02-26 10:02:25.656', 'adminLeader', '2024-02-26 10:02:25.656');
INSERT INTO sys_dict_item (id, dict_id, item_text, item_value, description, sort_order, status, create_by, create_time, update_by, update_time) VALUES('1761934673845243905', '1761933064054591489', '离婚', '3', '', 3, 1, 'adminLeader', '2024-02-26 10:02:16.065', 'adminLeader', '2024-02-26 10:02:16.065');
INSERT INTO sys_dict_item (id, dict_id, item_text, item_value, description, sort_order, status, create_by, create_time, update_by, update_time) VALUES('1761934629880549377', '1761933064054591489', '已婚', '2', '', 2, 1, 'adminLeader', '2024-02-26 10:02:05.582', 'adminLeader', '2024-02-26 10:02:05.582');
INSERT INTO sys_dict_item (id, dict_id, item_text, item_value, description, sort_order, status, create_by, create_time, update_by, update_time) VALUES('1761933874528342018', '1761933064054591489', '未婚', '1', '', 1, 1, 'adminLeader', '2024-02-26 09:59:05.492', 'adminLeader', '2024-02-26 09:59:21.326');




