<?xml version="1.0" encoding="utf-8"?>

<databaseChangeLog
        xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
        http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.4.xsd">
   
   
	<changeSet author="guowubin" id="1629430730658-1">
    	<comment>alter table jc_controller</comment>
    	<sql>
		    DROP TABLE IF EXISTS `jc_controller`;
			CREATE TABLE `jc_controller`  (
				  `sequence_nbr` bigint(22) NOT NULL COMMENT 'id',
				  `station` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '控制站',
				  `c_ip` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'ip',
				  `c_port` int(11) NULL DEFAULT NULL COMMENT '端口',
				  `c_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '控制器名称',
				  `type` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '控制器类别',
				  `c_state` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '状态',
				  `rec_date` datetime(0) NULL DEFAULT NULL,
				  `rec_user_id` int(11) NULL DEFAULT NULL,
				  `rec_user_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
				  `is_delete` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
				  PRIMARY KEY (`sequence_nbr`) USING BTREE
			) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
    	</sql>
	</changeSet>
	
	<changeSet author="guowubin" id="1629430730658-2">
	 	<preConditions onFail="MARK_RAN">
			<tableExists tableName="jc_controller" />
    	</preConditions>
    	<comment>add data table jc_controller</comment>
    	<sql>
		    INSERT INTO `jc_controller` VALUES (1245230062463119361, '2', NULL, NULL, '南站广播', '2', '1', '2021-08-20 09:46:02', 3111584, 'admin_jcs', '0');
			INSERT INTO `jc_controller` VALUES (1308575795966443521, '1', NULL, NULL, '主站警铃', '1', '1', '2021-08-20 09:46:02', 3111584, 'admin_jcs', '0');
			INSERT INTO `jc_controller` VALUES (1428303671921250305, '3', NULL, NULL, '北站广播', '2', '1', '2021-08-20 09:46:02', 3111584, 'admin_jcs', '0');
			INSERT INTO `jc_controller` VALUES (1428306948020801538, '3', NULL, NULL, '北站警铃', '1', '1', '2021-08-20 09:46:02', 3111584, 'admin_jcs', '0');
			INSERT INTO `jc_controller` VALUES (1428323093599784962, '2', '172.19.111.163', 502, '南站电门控制', '3', '1', '2021-08-20 09:46:02', 3111584, 'admin_jcs', '0');
			INSERT INTO `jc_controller` VALUES (1428325245344845826, '2', NULL, NULL, '南站警铃', '1', '1', '2021-08-20 09:46:02', 3111584, 'admin_jcs', '0');
			INSERT INTO `jc_controller` VALUES (1428325285853433857, '3', '172.19.111.153', 502, '北站电门控制', '3', '1', '2021-08-20 09:46:02', 3111584, 'admin_jcs', '0');
			INSERT INTO `jc_controller` VALUES (1428325336898113537, '1', NULL, NULL, '主站广播', '2', '1', '2021-08-20 09:46:02', 3111584, 'admin_jcs', '0');
    	</sql>
	</changeSet>
	
	<changeSet author="guowubin" id="1629430730658-3">
    	<comment>alter table jc_controller_equip</comment>
    	<sql>
		    DROP TABLE IF EXISTS `jc_controller_equip`;
			CREATE TABLE `jc_controller_equip`  (
				  `sequence_nbr` bigint(20) NOT NULL COMMENT 'id',
				  `controller_seq` bigint(20) NULL DEFAULT NULL COMMENT '控制站',
				  `e_num` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'ip',
				  `e_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '端口',
				  `e_state` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '状态',
				  `rec_date` datetime(0) NULL DEFAULT NULL,
				  `rec_user_id` int(11) NULL DEFAULT NULL,
				  `rec_user_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
				  `is_delete` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
				  PRIMARY KEY (`sequence_nbr`) USING BTREE
			) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
    	</sql>
	</changeSet>
	
	<changeSet author="guowubin" id="1629430730658-4">
		<preConditions onFail="MARK_RAN">
			<tableExists tableName="jc_controller_equip" />
    	</preConditions>
    	<comment>add data table jc_controller_equip</comment>
    	<sql>
		    INSERT INTO `jc_controller_equip` VALUES (1192346783527378946, 1428325245344845826, '206', '警铃终端', '1', '2021-08-20 09:46:02', 3111584, 'admin_jcs', '0');
			INSERT INTO `jc_controller_equip` VALUES (1245230052539396097, 1245230062463119361, '202', '广播终端', '1', '2021-08-20 09:46:02', 3111584, 'admin_jcs', '0');
			INSERT INTO `jc_controller_equip` VALUES (1272442241152421890, 1428325285853433857, '100', '1号门', '1', '2021-08-20 09:46:02', 3111584, 'admin_jcs', '0');
			INSERT INTO `jc_controller_equip` VALUES (1274947632054542338, 1428325285853433857, '101', '2号门', '1', '2021-08-20 09:46:02', 3111584, 'admin_jcs', '0');
			INSERT INTO `jc_controller_equip` VALUES (1302793235940249602, 1428306948020801538, '205', '警铃终端', '1', '2021-08-20 09:46:02', 3111584, 'admin_jcs', '0');
			INSERT INTO `jc_controller_equip` VALUES (1315854437968797697, 1428323093599784962, '100', '4个电门', '1', '2021-08-20 09:46:02', 3111584, 'admin_jcs', '0');
			INSERT INTO `jc_controller_equip` VALUES (1320637765980856322, 1428325285853433857, '102', '3号门', '1', '2021-08-20 09:46:02', 3111584, 'admin_jcs', '0');
			INSERT INTO `jc_controller_equip` VALUES (1332610043605946369, 1308575795966443521, '204', '警铃终端', '1', '2021-08-20 09:46:02', 3111584, 'admin_jcs', '0');
			INSERT INTO `jc_controller_equip` VALUES (1343765647514955778, 1428325336898113537, '201', '广播终端', '1', '2021-08-20 09:46:02', 3111584, 'admin_jcs', '0');
			INSERT INTO `jc_controller_equip` VALUES (1397143491787747330, 1428303671921250305, '203', '广播终端', '1', '2021-08-20 09:46:02', 3111584, 'admin_jcs', '0');
			INSERT INTO `jc_controller_equip` VALUES (1397145718640209921, 1428325285853433857, '103', '4号门', '1', '2021-08-20 09:46:02', 3111584, 'admin_jcs', '0');
    	</sql>
	</changeSet>
	<changeSet author="tb" id="2021-08-23-tb-1">
		<preConditions onFail="MARK_RAN">
			<tableExists tableName="cb_water_resource"/>
		</preConditions>
		<comment>modify table cb_water_resource add several columns</comment>
		<sql>
			ALTER TABLE `cb_water_resource` ADD equip_id BIGINT ( 20 ) COMMENT '设施定义',
			ADD COLUMN equip_name VARCHAR ( 50 ) COMMENT '设施定义名称',
			ADD COLUMN equip_category_id BIGINT ( 20 ) COMMENT '设施分类',
			ADD COLUMN equip_category_name VARCHAR ( 50 ) COMMENT '设施分类名称',
			ADD COLUMN equip_code VARCHAR ( 20 ) COMMENT '设施编码',
			ADD COLUMN maintenance_period VARCHAR ( 10 ) COMMENT '维保周期';
		</sql>
	</changeSet>

	<changeSet author="chenhao" id="2021-08-26-chenhao-1">
		<preConditions onFail="MARK_RAN">
			<not>
				<columnExists tableName="cb_firefighters_contract" columnName="start_time"/>
			</not>
	</preConditions>
		<comment>modify table cb_firefighters_contract add one columns</comment>
		<sql>
			ALTER TABLE `cb_firefighters_contract` ADD start_time date COMMENT '起始时间';
		</sql>
	</changeSet>

	<changeSet author="tb" id="2021-08-27-tb-1">
		<preConditions onFail="MARK_RAN">
			<not>
				<tableExists tableName="jc_rally_point"/>
			</not>
		</preConditions>
		<comment>create table jc_rally_point</comment>
		<sql>
			CREATE TABLE `jc_rally_point` (
			`sequence_nbr` bigint(30) NOT NULL COMMENT '主键',
			`name` varchar(100) DEFAULT NULL COMMENT '名称',
			`address` varchar(255) DEFAULT NULL COMMENT '地址',
			`alert_id` bigint(30) NOT NULL COMMENT '警情id',
			`longitude` varchar(20) NOT NULL COMMENT '经度',
			`latitude` varchar(20) NOT NULL COMMENT '纬度',
			`rec_user_id` bigint(30) NOT NULL COMMENT '更新用户id',
			`rec_user_name` varchar(30) NOT NULL COMMENT '更新用户名称',
			`rec_date` datetime NOT NULL COMMENT '更新日期',
			`is_delete` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除(1:删除,0:未删除)',
			PRIMARY KEY (`sequence_nbr`)
			) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='集结点';
		</sql>
	</changeSet>
	<changeSet author="tb" id="2021-08-27-tb-2">
		<preConditions onFail="MARK_RAN">
			<not>
				<tableExists tableName="jc_alert_location_log"/>
			</not>
		</preConditions>
		<comment>create table jc_alert_location_log</comment>
		<sql>
			CREATE TABLE `jc_alert_location_log` (
			`sequence_nbr` bigint(30) NOT NULL COMMENT '主键',
			`alert_id` bigint(30) NOT NULL COMMENT '警情id',
			`longitude` varchar(30) NOT NULL COMMENT '经度',
			`latitude` varchar(30) NOT NULL COMMENT '纬度',
			`rec_user_id` bigint(30) NOT NULL COMMENT '更新人员id',
			`rec_user_name` varchar(50) NOT NULL COMMENT '更新人员名称',
			`rec_date` datetime NOT NULL COMMENT '更新时间',
			`is_delete` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除(1: 已删除，0:未删除)',
			PRIMARY KEY (`sequence_nbr`)
			) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
		</sql>
	</changeSet>
	<changeSet author="chenhao" id="2021-08-31-chenhao-1">
		
		<comment>modify table cb_firefighters_thought add one columns</comment>
		<sql>
			ALTER TABLE `cb_firefighters_thought` modify talking_time datetime COMMENT '谈话时间';
		</sql>
	</changeSet>
	<changeSet author="litengwei" id="2021-09-01-litengwei-1">
		<preConditions onFail="MARK_RAN">
			<primaryKeyExists primaryKeyName="sequence_nbr" tableName="cb_data_dictionary"/>
		</preConditions>
		<comment>add data cb_data_dictionary</comment>
		<sql>
			INSERT INTO `cb_data_dictionary` VALUES(1152, '1152', '大面积航班延误保障', 'QTZL', NULL, NULL, NULL, NULL, NULL, 0, 1);
			INSERT INTO `cb_data_dictionary` VALUES(1153, '1153', '二类运行保障', 'QTZL', NULL, NULL, NULL, NULL, NULL, 0, 1);
			INSERT INTO `cb_data_dictionary` VALUES(1154, '1154', '施工加油保障', 'QTZL', NULL, NULL, NULL, NULL, NULL, 0, 1);
			INSERT INTO `cb_data_dictionary` VALUES(1155, '1155', '航空器失事', 'HKQJYZL', NULL, NULL, NULL, NULL, NULL, 0, 1);
			INSERT INTO `cb_data_dictionary` VALUES(1156, '1156', '空中遇险', 'HKQJYZL', NULL, NULL, NULL, NULL, NULL, 0, 1);
			INSERT INTO `cb_data_dictionary` VALUES(1157, '1157', '跑道事件', 'HKQJYZL', NULL, NULL, NULL, NULL, NULL, 0, 1);
			INSERT INTO `cb_data_dictionary` VALUES(1158, '1158', '地面遇险', 'HKQJYZL', NULL, NULL, NULL, NULL, NULL, 0, 1);
			INSERT INTO `cb_data_dictionary` VALUES(1159, '1159', '劫机', 'HKQJYZL', NULL, NULL, NULL, NULL, NULL, 0, 1);
			INSERT INTO `cb_data_dictionary` VALUES(1160, '1160', '发现爆炸物', 'HKQJYZL', NULL, NULL, NULL, NULL, NULL, 0, 1);
			INSERT INTO `cb_data_dictionary` VALUES(1161, '1161', '爆炸物威胁', 'HKQJYZL', NULL, NULL, NULL, NULL, NULL, 0, 1);
			INSERT INTO `cb_data_dictionary` VALUES(1162, '1162', '其他非法干扰', 'HKQJYZL', NULL, NULL, NULL, NULL, NULL, 0, 1);
			INSERT INTO `cb_data_dictionary` VALUES(1163, '1163', '残损航空器搬移', 'HKQJYZL', NULL, NULL, NULL, NULL, NULL, 0, 1);
			INSERT INTO `cb_data_dictionary` VALUES(1164, '1164', '紧急出动', 'XYJB', NULL, NULL, NULL, NULL, NULL, 0, 1);
			INSERT INTO `cb_data_dictionary` VALUES(1165, '1165', '紧急集结', 'XYJB', NULL, NULL, NULL, NULL, NULL, 0, 1);
			INSERT INTO `cb_data_dictionary` VALUES(1166, '1166', '原地待命', 'XYJB', NULL, NULL, NULL, NULL, NULL, 0, 1);
		</sql>
	</changeSet>
	<changeSet author="litengwei" id="2021-09-01-litengwei-2">
		<preConditions onFail="MARK_RAN">
			<primaryKeyExists primaryKeyName="sequence_nbr" tableName="cb_data_dictionary"/>
		</preConditions>
		<comment>add data jc_alert_form</comment>
		<sql>
			INSERT INTO `jc_alert_form` VALUES(127, '230', 'HKQJYZL', '航空器救援子类', 'aircraftRescueSub', 'radio', NULL, NULL, NULL, 0, 1, 1, NULL);
			INSERT INTO `jc_alert_form` VALUES(128, '242', 'QTZL', '子类', 'sub', 'radio', NULL, NULL, NULL, 0, 1, 1, NULL);
			INSERT INTO `jc_alert_form` VALUES(129, '230', NULL, '机位', 'mechinePosition', 'select', NULL, NULL, NULL, 0, 0, 5, NULL);
			INSERT INTO `jc_alert_form` VALUES(130, '230', NULL, '响应级别', 'responseLevel', 'select', NULL, NULL, NULL, 0, 0, 8, NULL);
		</sql>
	</changeSet>
	<changeSet author="litengwei" id="2021-09-01-litengwei-3">
		<preConditions onFail="MARK_RAN">
			<primaryKeyExists primaryKeyName="sequence_nbr" tableName="cb_data_dictionary"/>
		</preConditions>
		<comment>update data jc_alert_form</comment>
		<sql>
			UPDATE `jc_alert_form` SET alert_type_code='230', field_value_code=NULL, field_name='航班号', field_code='flightNumber', field_type='selectDelay', rec_user_name=NULL, rec_user_id=NULL, rec_date=NULL, is_delete=0, block=0, sort_num=2, url='aircraft/getAircraftNum' WHERE sequence_nbr=103;
			UPDATE `jc_alert_form` SET alert_type_code='230', field_value_code=NULL, field_name='航空器型号', field_code='aircraftModel', field_type='input', rec_user_name=NULL, rec_user_id=NULL, rec_date=NULL, is_delete=0, block=0, sort_num=3, url='aircraft/getAircraft' WHERE sequence_nbr=104;
			UPDATE `jc_alert_form` SET alert_type_code='230', field_value_code=NULL, field_name='落地时间', field_code='landingTime', field_type='datetime', rec_user_name=NULL, rec_user_id=NULL, rec_date=NULL, is_delete=0, block=0, sort_num=4, url=NULL WHERE sequence_nbr=105;
			UPDATE `jc_alert_form` SET alert_type_code='230', field_value_code=NULL, field_name='航空器故障部位', field_code='damageLocation', field_type='selectDelay', rec_user_name=NULL, rec_user_id=NULL, rec_date=NULL, is_delete=0, block=0, sort_num=7, url='data-dictionary/gwmcDataDictionary/FJSSWZ' WHERE sequence_nbr=106;
			UPDATE `jc_alert_form` SET alert_type_code='230', field_value_code=NULL, field_name='燃油量(吨)', field_code='fuelQuantity', field_type='inputNumber', rec_user_name=NULL, rec_user_id=NULL, rec_date=NULL, is_delete=0, block=0, sort_num=10, url=NULL WHERE sequence_nbr=107;
			UPDATE `jc_alert_form` SET alert_type_code='230', field_value_code=NULL, field_name='载客量', field_code='passengerCapacity', field_type='inputNumber', rec_user_name=NULL, rec_user_id=NULL, rec_date=NULL, is_delete=0, block=0, sort_num=9, url=NULL WHERE sequence_nbr=108;
			UPDATE `jc_alert_form` SET alert_type_code='230', field_value_code='PJPD', field_name='迫降跑道', field_code='forcedLandingTrack ', field_type='select', rec_user_name=NULL, rec_user_id=NULL, rec_date=NULL, is_delete=0, block=0, sort_num=6, url='' WHERE sequence_nbr=109;
			UPDATE `jc_alert_form` SET alert_type_code='230', field_value_code=NULL, field_name='灾害事故情况', field_code='accidentSituation', field_type='textarea', rec_user_name=NULL, rec_user_id=NULL, rec_date=NULL, is_delete=0, block=1, sort_num=11, url=NULL WHERE sequence_nbr=110;
			UPDATE `jc_alert_form` SET alert_type_code='230', field_value_code=NULL, field_name='发展态势', field_code='developmentTrend', field_type='textarea', rec_user_name=NULL, rec_user_id=NULL, rec_date=NULL, is_delete=0, block=1, sort_num=12, url=NULL WHERE sequence_nbr=111;
			UPDATE `jc_alert_form` SET alert_type_code='230', field_value_code=NULL, field_name='备注', field_code='remarks', field_type='textarea', rec_user_name=NULL, rec_user_id=NULL, rec_date=NULL, is_delete=0, block=1, sort_num=13, url=NULL WHERE sequence_nbr=112;
			UPDATE `jc_alert_form` SET alert_type_code='242', field_value_code=NULL, field_name='保障类别', field_code='securityCategory', field_type='selectDelay', rec_user_name=NULL, rec_user_id=NULL, rec_date=NULL, is_delete=0, block=0, sort_num=2, url='data-dictionary/gwmcDataDictionary/YGCJ' WHERE sequence_nbr=124;
			UPDATE `jc_alert_form` SET alert_type_code='242', field_value_code=NULL, field_name='事件概述', field_code='eventOverview', field_type='textarea', rec_user_name=NULL, rec_user_id=NULL, rec_date=NULL, is_delete=0, block=1, sort_num=3, url=NULL WHERE sequence_nbr=125;
			UPDATE `jc_alert_form` SET alert_type_code='242', field_value_code=NULL, field_name='备注', field_code='remarks', field_type='textarea', rec_user_name=NULL, rec_user_id=NULL, rec_date=NULL, is_delete=0, block=1, sort_num=4, url=NULL WHERE sequence_nbr=126;
		</sql>
	</changeSet>
	<changeSet author="chenhao" id="2021-09-02-chenhao-1">
		<comment>update data cb_data_dictionary</comment>
		<sql>
			update  cb_data_dictionary set name ='无固定期合同' where name ='无固定器合同' and type='HTLB';
		</sql>
	</changeSet>
	<changeSet author="chenhao" id="2021-09-02-chenhao-2">
		<comment>update data jc_alert_form</comment>
		<sql>
			update  jc_alert_form set field_name ='燃油量(吨)' where alert_type_code ='230' and field_code='fuelQuantity';
			update  jc_alert_form set field_name ='载客量(人)' where alert_type_code ='230' and field_code='passengerCapacity';
		</sql>
	</changeSet>
	<changeSet author="chenhao" id="2021-09-02-chenhao-3">
		<comment>update data cb_fire_team</comment>
		<sql>
				ALTER TABLE `cb_fire_team` modify longitude double(18,14) COMMENT '经度';
				ALTER TABLE `cb_fire_team` modify latitude double(18,14) COMMENT '纬度';
		</sql>
	</changeSet>
	<changeSet author="chenhao" id="2021-09-02-chenhao-4">
		<comment>update data cb_fire_station</comment>
		<sql>
				ALTER TABLE `cb_fire_station` modify longitude double(18,14) COMMENT '经度';
				ALTER TABLE `cb_fire_station` modify latitude double(18,14) COMMENT '纬度';
		</sql>
	</changeSet>
	<changeSet author="chenhao" id="2021-09-02-chenhao-5">
		<comment>update data cb_linkage_unit</comment>
		<sql>
				ALTER TABLE `cb_linkage_unit` modify longitude double(18,14) COMMENT '经度';
				ALTER TABLE `cb_linkage_unit` modify latitude double(18,14) COMMENT '纬度';
		</sql>
	</changeSet>
	<changeSet author="chenhao" id="2021-09-02-chenhao-6">
		<comment>update data cb_water_resource</comment>
		<sql>
				ALTER TABLE `cb_water_resource` modify longitude double(18,14) COMMENT '经度';
				ALTER TABLE `cb_water_resource` modify latitude double(18,14) COMMENT '纬度';
		</sql>
	</changeSet>
</databaseChangeLog>
