<?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="kongfm" id="2021-11-09">
		<preConditions onFail="MARK_RAN">
			<tableExists tableName="tz_template_export"/>
			<not>
				<primaryKeyExists primaryKeyName="sequence_nbr" tableName="tz_template_export"/>
			</not>
		</preConditions>
		<comment>insert record export temp</comment>
		<sql>
			INSERT INTO tz_template_export (
			`sequence_nbr`,
			`template_name`,
			`template_content`,
			`template_type`,
			`is_standard`,
			`rec_user_name`,
			`rec_user_id`,
			`rec_date`,
			`is_delete`
			)
			VALUES
			(
			'7',
			'标准模板',
			'[{\"key\":\"tel\",\"value\":\"电话号码\"},{\"key\":\"telStartTime\",\"value\":\"通话开始时间\"},{\"key\":\"telEndTime\",\"value\":\"通话结束时间\"},{\"key\":\"telTime\",\"value\":\"通话时长\"},{\"key\":\"fileType\",\"value\":\"通话类型\"},{\"key\":\"workNum\",\"value\":\"关联工单编号\"}]',
			'VOICE_RECORD',
			true,
			NULL,
			NULL,
			NULL,
			'\0'
			);
		</sql>
	</changeSet>

	<changeSet author="kongfm" id="2021-11-09-02">
		<preConditions onFail="MARK_RAN">
			<not>
				<tableExists tableName="tz_equipment_region_num"/>
			</not>
		</preConditions>
		<comment>create tz_equipment_region_num</comment>
		<sql>
			CREATE TABLE `tz_equipment_region_num` (
			`sequence_nbr` bigint(30) NOT NULL AUTO_INCREMENT COMMENT '自增主键',
			`province_code` varchar(30) DEFAULT NULL COMMENT '省级code',
			`city_code` varchar(30) NOT NULL COMMENT '市级code',
			`district_code` varchar(30) DEFAULT NULL COMMENT '区级code',
			`latitude` varchar(30) DEFAULT NULL COMMENT '纬度',
			`longitude` varchar(30) DEFAULT NULL COMMENT '经度',
			`num` bigint(20) DEFAULT NULL COMMENT '数量',
			`rec_user_id` bigint(30) DEFAULT NULL COMMENT '更新人id',
			`rec_user_name` varchar(100) DEFAULT NULL COMMENT '更新人名称',
			`rec_date` datetime DEFAULT NULL COMMENT '更新时间',
			`category_code` varchar(32) DEFAULT NULL COMMENT '设备类别编码',
			`is_delete` bit(1) DEFAULT b'0' COMMENT '是否删除（0：未删除，1：已删除）',
			PRIMARY KEY (`sequence_nbr`)
			) ENGINE=InnoDB AUTO_INCREMENT=1458005239746166786 DEFAULT CHARSET=utf8mb4 COMMENT='设备区域数量中间表';
		</sql>
	</changeSet>

	<changeSet author="kongfm" id="2021-11-09-03">
		<preConditions onFail="MARK_RAN">
			<not>
				<tableExists tableName="tz_voice_record_log"/>
			</not>
		</preConditions>
		<comment>create tz_voice_record_log</comment>
		<sql>
			CREATE TABLE `tz_voice_record_log` (
			`sequence_nbr` bigint(30) NOT NULL AUTO_INCREMENT COMMENT '自增主键',
			`alert_id` bigint(32) DEFAULT NULL COMMENT '警情id',
			`connect_id` varchar(255) NOT NULL COMMENT 'cti通话id',
			`is_deal` bit(1) DEFAULT NULL COMMENT '是否处理',
			`deal_times` int(11) DEFAULT NULL COMMENT '处理次数',
			`rec_user_id` bigint(30) DEFAULT NULL COMMENT '更新人id',
			`rec_user_name` varchar(100) DEFAULT NULL COMMENT '更新人名称',
			`rec_date` datetime DEFAULT NULL COMMENT '更新时间',
			`is_delete` bit(1) DEFAULT b'0' COMMENT '是否删除（0：未删除，1：已删除）',
			PRIMARY KEY (`sequence_nbr`)
			) ENGINE=InnoDB AUTO_INCREMENT=1456192938655657986 DEFAULT CHARSET=utf8mb4 COMMENT='通话记录记录表';
		</sql>
	</changeSet>

	<changeSet author="kongfm" id="2021-11-10-01">
		<preConditions onFail="MARK_RAN">
			<tableExists tableName="tz_voice_record_file"/>
		</preConditions>
		<comment>modify tz_voice_record_file field</comment>
		<sql>
			alter table tz_voice_record_file modify  rec_user_id bigint(30)  NULL COMMENT '更新人id';
			alter table tz_voice_record_file modify  rec_user_name varchar(100)   NULL COMMENT '更新人名称';
			alter table tz_voice_record_file modify  rec_date datetime   NULL COMMENT '更新时间';
		</sql>
	</changeSet>

	<changeSet author="kongfm" id="2021-11-17-01">
		<preConditions onFail="MARK_RAN">
			<sqlCheck expectedResult="0">select count(*) from cb_data_dictionary where sequence_nbr = 1043</sqlCheck>
		</preConditions>
		<comment>add data_dictionary </comment>
		<sql>
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1043, '1043', '监管单位', 'UNIT_TYPE', 'studio_normalapp_3228379,studio_normalapp_3261162', NULL, NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1044, '1044', '检验单位', 'UNIT_TYPE', 'studio_normalapp_3228379,studio_normalapp_3261162', NULL, NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1045, '1045', '检测单位', 'UNIT_TYPE', 'studio_normalapp_3228379,studio_normalapp_3261162', NULL, NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1046, '1046', '设计单位', 'UNIT_TYPE', 'studio_normalapp_3228379,studio_normalapp_3261162', NULL, NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1047, '1047', '制造单位', 'UNIT_TYPE', 'studio_normalapp_3228379,studio_normalapp_3261162', NULL, NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1048, '1048', '安装单位', 'UNIT_TYPE', 'studio_normalapp_3228379,studio_normalapp_3261162', NULL, NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1049, '1049', '改造单位', 'UNIT_TYPE', 'studio_normalapp_3228379,studio_normalapp_3261162', NULL, NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1050, '1050', '维修单位', 'UNIT_TYPE', 'studio_normalapp_3228379,studio_normalapp_3261162', NULL, NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1051, '1051', '使用单位', 'UNIT_TYPE', 'studio_normalapp_3228379,studio_normalapp_3261162', NULL, NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1052, '1052', '维保单位', 'UNIT_TYPE', 'studio_normalapp_3228379,studio_normalapp_3261162', NULL, NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1053, '1053', '物业单位', 'UNIT_TYPE', 'studio_normalapp_3228379,studio_normalapp_3261162', NULL, NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1054, '1054', '保险公司', 'UNIT_TYPE', 'studio_normalapp_3228379,studio_normalapp_3261162', NULL, NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1055, '1055', '物联网公司', 'UNIT_TYPE', 'studio_normalapp_3228379,studio_normalapp_3261162', NULL, NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1056, '1056', '气瓶充装单位', 'UNIT_TYPE', 'studio_normalapp_3228379,studio_normalapp_3261162', NULL, NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1057, '1057', '经营单位', 'UNIT_TYPE', 'studio_normalapp_3228379,studio_normalapp_3261162', NULL, NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1058, '1058', '其他', 'UNIT_TYPE', 'studio_normalapp_3228379,studio_normalapp_3261162', NULL, NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1059, '1059', '组织机构代码证', 'LICENSE_TYPE', NULL, NULL, NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1060, '1060', '营业执照', 'LICENSE_TYPE', NULL, NULL, NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1061, '1061', 'A', 'QUALIFICATION_LEVEL', NULL, NULL, NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1062, '1062', 'B', 'QUALIFICATION_LEVEL', NULL, NULL, NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1063, '1063', 'C', 'QUALIFICATION_LEVEL', NULL, NULL, NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1064, '1064', 'D', 'QUALIFICATION_LEVEL', NULL, NULL, NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1065, '1065', '行业', 'COMPTENT_DEPT', NULL, NULL, NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1066, '1066', '住建', 'COMPTENT_DEPT', NULL, NULL, NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1067, '1067', '文旅', 'COMPTENT_DEPT', NULL, NULL, NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1068, '1068', '化工', 'COMPTENT_DEPT', NULL, NULL, NULL, NULL, NULL, b'0', 1);
		</sql>
	</changeSet>

	<changeSet author="kongfm" id="2021-11-17-02">
		<preConditions onFail="MARK_RAN">
			<not>
				<tableExists tableName="tz_flc_unit_info"/>
			</not>
		</preConditions>
		<comment>add tz_flc_unit_info table</comment>
		<sql>
			CREATE TABLE `tz_flc_unit_info`  (
			`sequence_nbr` bigint(30) NOT NULL AUTO_INCREMENT COMMENT '自增主键',
			`org_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '单位名称',
			`licence_type` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '证照类型',
			`licence_type_code` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '证照类型code',
			`organization_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '组织机构编码',
			`unit_type` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '单位类型',
			`unit_type_code` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '单位类型code',
			`comptent_dept` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '主管部门',
			`comptent_dept_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '主管部门编号',
			`approve_org` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '批准成立机关',
			`registration_authority` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '登记机构',
			`region_code` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '区域编码',
			`country` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '国家',
			`province` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '省',
			`city` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '市',
			`district` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '县区',
			`stree` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '街道',
			`community` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '小区',
			`address` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '详细地址',
			`longitude` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '经度',
			`latitude` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '纬度',
			`management_unit` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '管辖单位',
			`management_unit_id` bigint(30) NULL DEFAULT NULL COMMENT '管辖单位id',
			`qualification_level` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '资质等级',
			`qualification_level_code` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '资质等级编号',
			`create_time` datetime NULL DEFAULT NULL COMMENT '成立日期',
			`legal_person` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '单位法人',
			`legal_person_tel` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '法人电话',
			`contact_person` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '单位联系人',
			`contact_person_tel` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '联系人电话',
			`unit_tel` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '单位电话',
			`admin_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '管理员姓名',
			`admin_login_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '管理员用户名',
			`admin_login_pwd` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '管理员密码',
			`admin_tel` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '管理员手机号',
			`org_user_id` bigint(32) NULL DEFAULT NULL COMMENT 'org_user_id',
			`unit_status` int(11) NULL DEFAULT NULL COMMENT '审批状态 0 审批中 1 审批结束 2 驳回',
			`rec_user_id` bigint(30) NULL DEFAULT NULL COMMENT '更新人id',
			`rec_user_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人名称',
			`rec_date` datetime NULL DEFAULT NULL COMMENT '更新时间',
			`is_delete` bit(1) NULL DEFAULT b'0' COMMENT '是否删除（0：未删除，1：已删除）',
			`is_change` bit(1) NULL DEFAULT NULL COMMENT '是否变更（0：未变更，1：变更中）',
			`approved_time` datetime NULL DEFAULT NULL COMMENT '企业入驻时间',
			`submit_time` datetime NULL DEFAULT NULL COMMENT '提交时间',
			PRIMARY KEY (`sequence_nbr`) USING BTREE
			) ENGINE = InnoDB AUTO_INCREMENT = 1460504125366816771 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '企业信息表' ROW_FORMAT = Dynamic;
		</sql>
	</changeSet>

	<changeSet author="kongfm" id="2021-11-17-03">
		<preConditions onFail="MARK_RAN">
			<not>
			<tableExists tableName="tz_flc_unit_info_approve"/>
			</not>
		</preConditions>
		<comment>add tz_flc_unit_info_approve table</comment>
		<sql>
			CREATE TABLE `tz_flc_unit_info_approve`  (
			`sequence_nbr` bigint(30) NOT NULL AUTO_INCREMENT COMMENT '自增主键',
			`unit_id` bigint(30) NULL DEFAULT NULL COMMENT 'unit_info_id',
			`source_id` bigint(30) NULL DEFAULT NULL COMMENT 'unit_info原表单id',
			`content` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '审批意见',
			`approve_status` int(11) NULL DEFAULT NULL COMMENT '审批结果 0 通过 1 驳回',
			`approve_type` int(1) NULL DEFAULT NULL COMMENT '0 注册审批 1 变更审批',
			`rec_user_id` bigint(30) NULL DEFAULT NULL COMMENT '审批人id',
			`rec_user_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '审批人',
			`rec_date` datetime NULL DEFAULT NULL COMMENT '审批日期',
			`is_delete` bit(1) NULL DEFAULT b'0' COMMENT '是否删除（0：未删除，1：已删除）',
			PRIMARY KEY (`sequence_nbr`) USING BTREE
			) ENGINE = InnoDB AUTO_INCREMENT = 1460809880397582339 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '企业信息审批意见表' ROW_FORMAT = Dynamic;
		</sql>
	</changeSet>

	<changeSet author="kongfm" id="2021-11-17-04">
		<preConditions onFail="MARK_RAN">
			<not>
			<tableExists tableName="tz_flc_unit_info_change"/>
			</not>
		</preConditions>
		<comment>add tz_flc_unit_info_change table</comment>
		<sql>
			CREATE TABLE `tz_flc_unit_info_change`  (
			`sequence_nbr` bigint(30) NOT NULL AUTO_INCREMENT COMMENT '自增主键',
			`org_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '单位名称',
			`licence_type` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '证照类型',
			`licence_type_code` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '证照类型code',
			`unit_type` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '单位类型',
			`unit_type_code` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '单位类型code',
			`comptent_dept` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '主管部门',
			`comptent_dept_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '主管部门编号',
			`approve_org` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '批准成立机关',
			`registration_authority` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '登记机构',
			`region_code` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '区域编码',
			`country` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '国家',
			`province` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '省',
			`city` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '市',
			`district` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '县区',
			`stree` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '街道',
			`community` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '小区',
			`address` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '详细地址',
			`longitude` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '经度',
			`latitude` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '纬度',
			`management_unit` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '管辖单位',
			`management_unit_id` bigint(30) NULL DEFAULT NULL COMMENT '管辖单位id',
			`qualification_level` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '资质等级',
			`qualification_level_code` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '资质等级编号',
			`create_time` datetime NULL DEFAULT NULL COMMENT '成立日期',
			`legal_person` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '单位法人',
			`legal_person_tel` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '法人电话',
			`contact_person` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '单位联系人',
			`contact_person_tel` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '联系人电话',
			`unit_tel` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '单位电话',
			`source_id` bigint(30) NULL DEFAULT NULL COMMENT '原记录id（unit_info）',
			`unit_status` int(11) NULL DEFAULT NULL COMMENT '审批状态 0 审批中 1 审批结束 2 驳回',
			`rec_user_id` bigint(30) NULL DEFAULT NULL COMMENT '更新人id',
			`rec_user_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人名称',
			`rec_date` datetime NULL DEFAULT NULL COMMENT '更新时间',
			`is_delete` bit(1) NULL DEFAULT b'0' COMMENT '是否删除（0：未删除，1：已删除）',
			`organization_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '组织机构编码',
			`approved_time` datetime NULL DEFAULT NULL COMMENT '企业入驻时间',
			`submit_time` datetime NULL DEFAULT NULL COMMENT '提交时间',
			PRIMARY KEY (`sequence_nbr`) USING BTREE
			) ENGINE = InnoDB AUTO_INCREMENT = 1458311353490657283 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '企业信息变更表' ROW_FORMAT = Dynamic;
		</sql>
	</changeSet>

    <changeSet author="kongfm" id="2021-11-17-05">
        <preConditions onFail="MARK_RAN">
			<sqlCheck expectedResult="1">select count(*) from cb_data_dictionary where sequence_nbr = 1043</sqlCheck>
        </preConditions>
        <comment>update cb_data_dictionary UNIT_TYPE</comment>
        <sql>
            UPDATE `cb_data_dictionary` SET `code` = '1043', `name` = '监管单位', `type` = 'UNIT_TYPE', `type_desc` = 'studio_normalapp_3477687,studio_normalapp_3261162', `parent` = NULL, `rec_user_name` = NULL, `rec_user_id` = NULL, `rec_date` = NULL, `is_delete` = b'0', `sort_num` = 1 WHERE `sequence_nbr` = 1043;
            UPDATE `cb_data_dictionary` SET `code` = '1044', `name` = '检验单位', `type` = 'UNIT_TYPE', `type_desc` = 'studio_normalapp_3477687,studio_normalapp_3261162', `parent` = NULL, `rec_user_name` = NULL, `rec_user_id` = NULL, `rec_date` = NULL, `is_delete` = b'0', `sort_num` = 1 WHERE `sequence_nbr` = 1044;
            UPDATE `cb_data_dictionary` SET `code` = '1045', `name` = '检测单位', `type` = 'UNIT_TYPE', `type_desc` = 'studio_normalapp_3477687,studio_normalapp_3261162', `parent` = NULL, `rec_user_name` = NULL, `rec_user_id` = NULL, `rec_date` = NULL, `is_delete` = b'0', `sort_num` = 1 WHERE `sequence_nbr` = 1045;
            UPDATE `cb_data_dictionary` SET `code` = '1046', `name` = '设计单位', `type` = 'UNIT_TYPE', `type_desc` = 'studio_normalapp_3477687,studio_normalapp_3261162', `parent` = NULL, `rec_user_name` = NULL, `rec_user_id` = NULL, `rec_date` = NULL, `is_delete` = b'0', `sort_num` = 1 WHERE `sequence_nbr` = 1046;
            UPDATE `cb_data_dictionary` SET `code` = '1047', `name` = '制造单位', `type` = 'UNIT_TYPE', `type_desc` = 'studio_normalapp_3477687,studio_normalapp_3261162', `parent` = NULL, `rec_user_name` = NULL, `rec_user_id` = NULL, `rec_date` = NULL, `is_delete` = b'0', `sort_num` = 1 WHERE `sequence_nbr` = 1047;
            UPDATE `cb_data_dictionary` SET `code` = '1048', `name` = '安装单位', `type` = 'UNIT_TYPE', `type_desc` = 'studio_normalapp_3477687,studio_normalapp_3261162', `parent` = NULL, `rec_user_name` = NULL, `rec_user_id` = NULL, `rec_date` = NULL, `is_delete` = b'0', `sort_num` = 1 WHERE `sequence_nbr` = 1048;
            UPDATE `cb_data_dictionary` SET `code` = '1049', `name` = '改造单位', `type` = 'UNIT_TYPE', `type_desc` = 'studio_normalapp_3477687,studio_normalapp_3261162', `parent` = NULL, `rec_user_name` = NULL, `rec_user_id` = NULL, `rec_date` = NULL, `is_delete` = b'0', `sort_num` = 1 WHERE `sequence_nbr` = 1049;
            UPDATE `cb_data_dictionary` SET `code` = '1050', `name` = '维修单位', `type` = 'UNIT_TYPE', `type_desc` = 'studio_normalapp_3477687,studio_normalapp_3261162', `parent` = NULL, `rec_user_name` = NULL, `rec_user_id` = NULL, `rec_date` = NULL, `is_delete` = b'0', `sort_num` = 1 WHERE `sequence_nbr` = 1050;
            UPDATE `cb_data_dictionary` SET `code` = '1051', `name` = '使用单位', `type` = 'UNIT_TYPE', `type_desc` = 'studio_normalapp_3477687,studio_normalapp_3261162', `parent` = NULL, `rec_user_name` = NULL, `rec_user_id` = NULL, `rec_date` = NULL, `is_delete` = b'0', `sort_num` = 1 WHERE `sequence_nbr` = 1051;
            UPDATE `cb_data_dictionary` SET `code` = '1052', `name` = '维保单位', `type` = 'UNIT_TYPE', `type_desc` = 'studio_normalapp_3477687,studio_normalapp_3261162', `parent` = NULL, `rec_user_name` = NULL, `rec_user_id` = NULL, `rec_date` = NULL, `is_delete` = b'0', `sort_num` = 1 WHERE `sequence_nbr` = 1052;
            UPDATE `cb_data_dictionary` SET `code` = '1053', `name` = '物业单位', `type` = 'UNIT_TYPE', `type_desc` = 'studio_normalapp_3477687,studio_normalapp_3261162', `parent` = NULL, `rec_user_name` = NULL, `rec_user_id` = NULL, `rec_date` = NULL, `is_delete` = b'0', `sort_num` = 1 WHERE `sequence_nbr` = 1053;
            UPDATE `cb_data_dictionary` SET `code` = '1054', `name` = '保险公司', `type` = 'UNIT_TYPE', `type_desc` = 'studio_normalapp_3477687,studio_normalapp_3261162', `parent` = NULL, `rec_user_name` = NULL, `rec_user_id` = NULL, `rec_date` = NULL, `is_delete` = b'0', `sort_num` = 1 WHERE `sequence_nbr` = 1054;
            UPDATE `cb_data_dictionary` SET `code` = '1055', `name` = '物联网公司', `type` = 'UNIT_TYPE', `type_desc` = 'studio_normalapp_3477687,studio_normalapp_3261162', `parent` = NULL, `rec_user_name` = NULL, `rec_user_id` = NULL, `rec_date` = NULL, `is_delete` = b'0', `sort_num` = 1 WHERE `sequence_nbr` = 1055;
            UPDATE `cb_data_dictionary` SET `code` = '1056', `name` = '气瓶充装单位', `type` = 'UNIT_TYPE', `type_desc` = 'studio_normalapp_3477687,studio_normalapp_3261162', `parent` = NULL, `rec_user_name` = NULL, `rec_user_id` = NULL, `rec_date` = NULL, `is_delete` = b'0', `sort_num` = 1 WHERE `sequence_nbr` = 1056;
            UPDATE `cb_data_dictionary` SET `code` = '1057', `name` = '经营单位', `type` = 'UNIT_TYPE', `type_desc` = 'studio_normalapp_3477687,studio_normalapp_3261162', `parent` = NULL, `rec_user_name` = NULL, `rec_user_id` = NULL, `rec_date` = NULL, `is_delete` = b'0', `sort_num` = 1 WHERE `sequence_nbr` = 1057;
            UPDATE `cb_data_dictionary` SET `code` = '1058', `name` = '其他', `type` = 'UNIT_TYPE', `type_desc` = 'studio_normalapp_3477687,studio_normalapp_3261162', `parent` = NULL, `rec_user_name` = NULL, `rec_user_id` = NULL, `rec_date` = NULL, `is_delete` = b'0', `sort_num` = 1 WHERE `sequence_nbr` = 1058;

        </sql>
    </changeSet>

	<changeSet author="kongfm" id="2021-11-22-01">
		<preConditions onFail="MARK_RAN">
			<sqlCheck expectedResult="0">select count(*) from cb_data_dictionary where sequence_nbr = 1069</sqlCheck>
		</preConditions>
		<comment>add data_dictionary unitpersonInfo </comment>
		<sql>
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1069, '1069', '普通员工', 'PERSON_TYPE', NULL, NULL, NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1070, '1070', '特种设备从业人员', 'PERSON_TYPE', NULL, NULL, NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1071, '1071', '特种设备检验检测人员', 'PERSON_TYPE', NULL, NULL, NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1072, '1072', '居民身份证', 'PERSON_LICENCE_TYPE', NULL, NULL, NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1073, '1073', '军官证', 'PERSON_LICENCE_TYPE', NULL, NULL, NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1074, '1074', '护照', 'PERSON_LICENCE_TYPE', NULL, NULL, NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1075, '1075', '特种设备安全管理', 'PERSON_QUALITY_TYPE', NULL, NULL, NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1076, '1076', '锅炉作业', 'PERSON_QUALITY_TYPE', NULL, NULL, NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1077, '1077', '压力容器作业', 'PERSON_QUALITY_TYPE', NULL, NULL, NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1078, '1078', '气瓶作业', 'PERSON_QUALITY_TYPE', NULL, NULL, NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1079, '1079', '电梯作业', 'PERSON_QUALITY_TYPE', NULL, NULL, NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1080, '1080', '起重机作业', 'PERSON_QUALITY_TYPE', NULL, NULL, NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1081, '1081', '客运索道作业', 'PERSON_QUALITY_TYPE', NULL, NULL, NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1082, '1082', '大型游乐设施作业', 'PERSON_QUALITY_TYPE', NULL, NULL, NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1083, '1083', '场（厂）内专用机动车辆作业', 'PERSON_QUALITY_TYPE', NULL, NULL, NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1084, '1084', '安全附件维修作业', 'PERSON_QUALITY_TYPE', NULL, NULL, NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1085, '1085', '特种设备焊接作业', 'PERSON_QUALITY_TYPE', NULL, NULL, NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1086, '1086', '特种设备安全管理', 'PERSON_QUALITY_TYPE', 'A', '1075', NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1087, '1087', '工业锅炉司炉', 'PERSON_QUALITY_TYPE', 'G1', '1076', NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1088, '1088', '电站锅炉司炉', 'PERSON_QUALITY_TYPE', 'G2', '1076', NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1089, '1089', '锅炉水处理', 'PERSON_QUALITY_TYPE', 'G3', '1076', NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1090, '1090', '快开门式压力容器操作', 'PERSON_QUALITY_TYPE', 'R1', '1077', NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1091, '1091', '移动式压力容器充装', 'PERSON_QUALITY_TYPE', 'R2', '1077', NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1092, '1092', '氧舱维护保养', 'PERSON_QUALITY_TYPE', 'R3', '1077', NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1093, '1093', '气瓶充装', 'PERSON_QUALITY_TYPE', 'P', '1078', NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1094, '1094', '电梯修理', 'PERSON_QUALITY_TYPE', 'T', '1079', NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1095, '1095', '起重机指挥', 'PERSON_QUALITY_TYPE', 'Q1', '1080', NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1096, '1096', '起重机司机', 'PERSON_QUALITY_TYPE', 'Q2', '1080', NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1097, '1097', '客运索道修理', 'PERSON_QUALITY_TYPE', 'S1', '1081', NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1098, '1098', '客运索道司机', 'PERSON_QUALITY_TYPE', 'S2', '1081', NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1099, '1099', '大型游乐设施修理', 'PERSON_QUALITY_TYPE', 'Y1', '1082', NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1100, '1100', '大型游乐设施操作', 'PERSON_QUALITY_TYPE', 'Y2', '1082', NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1101, '1101', '叉车司机', 'PERSON_QUALITY_TYPE', 'N', '1083', NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1102, '1102', '观光车和观光列车司机', 'PERSON_QUALITY_TYPE', 'N2', '1083', NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1103, '1103', '安全阀校验', 'PERSON_QUALITY_TYPE', 'F', '1084', NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1104, '1104', '金属焊接操作', 'PERSON_QUALITY_TYPE', '', '1085', NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1105, '1105', '非金属焊接操作', 'PERSON_QUALITY_TYPE', '', '1085', NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1106, '1106', '企业人员', 'ORG_USER_TYPE', NULL, NULL, NULL, NULL, NULL, b'0', 1);
		</sql>
	</changeSet>


	<changeSet author="kongfm" id="2021-11-22-02">
		<preConditions onFail="MARK_RAN">
			<not>
				<tableExists tableName="tz_flc_person_education"/>
			</not>
		</preConditions>
		<comment>add tz_flc_person_education table </comment>
		<sql>
			CREATE TABLE `tz_flc_person_education`  (
			`sequence_nbr` bigint(30) NOT NULL AUTO_INCREMENT COMMENT '自增主键',
			`pserson_id` bigint(30) NULL DEFAULT NULL COMMENT 'org_user_id',
			`education_record` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '教育记录',
			`remark` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
			`rec_user_id` bigint(30) NULL DEFAULT NULL COMMENT '审批人id',
			`rec_user_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '审批人',
			`rec_date` datetime NULL DEFAULT NULL COMMENT '审批日期',
			`is_delete` bit(1) NULL DEFAULT b'0' COMMENT '是否删除（0：未删除，1：已删除）',
			PRIMARY KEY (`sequence_nbr`) USING BTREE
			) ENGINE = InnoDB AUTO_INCREMENT = 1462605642928455682 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '企业人员教育信息表' ROW_FORMAT = Dynamic;
		</sql>
	</changeSet>

	<changeSet author="kongfm" id="2021-11-22-03">
		<preConditions onFail="MARK_RAN">
			<not>
				<tableExists tableName="tz_flc_person_quality"/>
			</not>
		</preConditions>
		<comment>add tz_flc_person_quality table </comment>
		<sql>
			CREATE TABLE `tz_flc_person_quality`  (
			`sequence_nbr` bigint(30) NOT NULL AUTO_INCREMENT COMMENT '自增主键',
			`pserson_id` bigint(30) NULL DEFAULT NULL COMMENT 'org_user_id',
			`record_num` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '档案编号',
			`licence_type` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '证书类型',
			`licence_type_code` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '证书类型编码',
			`licence_issue_org_id` bigint(30) NULL DEFAULT NULL COMMENT '发证机关id',
			`licence_issue_org` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '发证机关',
			`project_work` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '作业项目',
			`recheck_record` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '复审记录',
			`hire_record` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '聘用记录',
			`remark` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
			`rec_user_id` bigint(30) NULL DEFAULT NULL COMMENT '审批人id',
			`rec_user_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '审批人',
			`rec_date` datetime NULL DEFAULT NULL COMMENT '审批日期',
			`is_delete` bit(1) NULL DEFAULT b'0' COMMENT '是否删除（0：未删除，1：已删除）',
			PRIMARY KEY (`sequence_nbr`) USING BTREE
			) ENGINE = InnoDB AUTO_INCREMENT = 1462605642928455682 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '企业人员资质信息表' ROW_FORMAT = Dynamic;
		</sql>
	</changeSet>

	<changeSet author="kongfm" id="2021-11-22-04">
		<preConditions onFail="MARK_RAN">
			<sqlCheck expectedResult="0">select count(*) from tz_alert_form_type where sequence_nbr = 7</sqlCheck>
		</preConditions>
		<comment>INSERT person info  </comment>
		<sql>
			INSERT INTO `tz_alert_form_type` (`sequence_nbr`, `alert_type_code`, `alert_type_name`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`) VALUES (7, '1106', '企业人员', NULL, NULL, NULL, b'0');
			INSERT INTO `tz_alert_form` (`sequence_nbr`, `alert_type_code`, `field_value_code`, `field_name`, `field_code`, `field_type`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `block`, `sort_num`, `url`, `hide`) VALUES (44, '1106', 'PERSON_TYPE', '人员类型', 'person_type', 'select', NULL, NULL, NULL, b'0', b'0', 1, NULL, b'0');
			INSERT INTO `tz_alert_form` (`sequence_nbr`, `alert_type_code`, `field_value_code`, `field_name`, `field_code`, `field_type`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `block`, `sort_num`, `url`, `hide`) VALUES (45, '1106', 'XB', '人员性别', 'sex', 'radio', NULL, NULL, NULL, b'0', b'0', 1, NULL, b'0');
			INSERT INTO `tz_alert_form` (`sequence_nbr`, `alert_type_code`, `field_value_code`, `field_name`, `field_code`, `field_type`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `block`, `sort_num`, `url`, `hide`) VALUES (46, '1106', NULL, '出生日期', 'birthday', 'datetime', NULL, NULL, NULL, b'0', b'0', 1, NULL, b'0');
			INSERT INTO `tz_alert_form` (`sequence_nbr`, `alert_type_code`, `field_value_code`, `field_name`, `field_code`, `field_type`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `block`, `sort_num`, `url`, `hide`) VALUES (47, '1106', 'PERSON_LICENCE_TYPE', '证件类型', 'licence_type', 'radio', NULL, NULL, NULL, b'0', b'0', 1, NULL, b'0');
			INSERT INTO `tz_alert_form` (`sequence_nbr`, `alert_type_code`, `field_value_code`, `field_name`, `field_code`, `field_type`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `block`, `sort_num`, `url`, `hide`) VALUES (48, '1106', NULL, '证件编号', 'licence_code', 'string', NULL, NULL, NULL, b'0', b'0', 1, NULL, b'0');
			INSERT INTO `tz_alert_form` (`sequence_nbr`, `alert_type_code`, `field_value_code`, `field_name`, `field_code`, `field_type`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `block`, `sort_num`, `url`, `hide`) VALUES (49, '1106', 'XLLX', '学历', 'education', 'radio', NULL, NULL, NULL, b'0', b'0', 1, NULL, b'0');
			INSERT INTO `tz_alert_form` (`sequence_nbr`, `alert_type_code`, `field_value_code`, `field_name`, `field_code`, `field_type`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `block`, `sort_num`, `url`, `hide`) VALUES (50, '1106', NULL, '专业', 'major', 'string', NULL, NULL, NULL, b'0', b'0', 1, NULL, b'0');
			INSERT INTO `tz_alert_form` (`sequence_nbr`, `alert_type_code`, `field_value_code`, `field_name`, `field_code`, `field_type`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `block`, `sort_num`, `url`, `hide`) VALUES (51, '1106', NULL, '电话', 'phone', 'string', NULL, NULL, NULL, b'0', b'0', 1, NULL, b'0');
			INSERT INTO `tz_alert_form` (`sequence_nbr`, `alert_type_code`, `field_value_code`, `field_name`, `field_code`, `field_type`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `block`, `sort_num`, `url`, `hide`) VALUES (52, '1106', NULL, '邮箱', 'email', 'string', NULL, NULL, NULL, b'0', b'0', 1, NULL, b'0');
			INSERT INTO `tz_alert_form` (`sequence_nbr`, `alert_type_code`, `field_value_code`, `field_name`, `field_code`, `field_type`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `block`, `sort_num`, `url`, `hide`) VALUES (53, '1106', NULL, '省', 'province', 'string', NULL, NULL, NULL, b'0', b'0', 1, NULL, b'0');
			INSERT INTO `tz_alert_form` (`sequence_nbr`, `alert_type_code`, `field_value_code`, `field_name`, `field_code`, `field_type`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `block`, `sort_num`, `url`, `hide`) VALUES (54, '1106', NULL, '市', 'city', 'string', NULL, NULL, NULL, b'0', b'0', 1, NULL, b'0');
			INSERT INTO `tz_alert_form` (`sequence_nbr`, `alert_type_code`, `field_value_code`, `field_name`, `field_code`, `field_type`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `block`, `sort_num`, `url`, `hide`) VALUES (55, '1106', NULL, '区县', 'district', 'string', NULL, NULL, NULL, b'0', b'0', 1, NULL, b'0');
			INSERT INTO `tz_alert_form` (`sequence_nbr`, `alert_type_code`, `field_value_code`, `field_name`, `field_code`, `field_type`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `block`, `sort_num`, `url`, `hide`) VALUES (56, '1106', NULL, '详细地址', 'address', 'string', NULL, NULL, NULL, b'0', b'0', 1, NULL, b'0');
		</sql>
	</changeSet>

	<changeSet author="kongfm" id="2021-11-24-01">
		<preConditions onFail="MARK_RAN">
			<sqlCheck expectedResult="0">select count(*) from cb_dynamic_form_column where sequence_nbr = 1</sqlCheck>
		</preConditions>
		<comment>INSERT person info  </comment>
		<sql>
			INSERT INTO `cb_dynamic_form_column` (`sequence_nbr`, `field_code`, `field_name`, `field_type`, `group_id`, `query_strategy`, `not_null`, `block`, `group_code`, `column_config`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `remark`, `sort`, `org_code`) VALUES (1, 'person_type', '人员类型', 'select', 7, 'eq', b'0', b'0', '1106', '{\"url\": \"\", \"data\": [], \"dict\": \"PERSON_TYPE\", \"type\": \"dict\"}', NULL, NULL, '2021-11-24 13:50:47', b'0', NULL, 1, NULL);
			INSERT INTO `cb_dynamic_form_column` (`sequence_nbr`, `field_code`, `field_name`, `field_type`, `group_id`, `query_strategy`, `not_null`, `block`, `group_code`, `column_config`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `remark`, `sort`, `org_code`) VALUES (2, 'sex', '人员性别', 'radio', 7, 'eq', b'0', b'0', '1106', '{\"url\": \"\", \"data\": [], \"dict\": \"XB\", \"type\": \"dict\"}', NULL, NULL, '2021-11-24 13:51:29', b'0', NULL, 2, NULL);
			INSERT INTO `cb_dynamic_form_column` (`sequence_nbr`, `field_code`, `field_name`, `field_type`, `group_id`, `query_strategy`, `not_null`, `block`, `group_code`, `column_config`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `remark`, `sort`, `org_code`) VALUES (3, 'birthday', '出生日期', 'datetime', 7, 'eq', b'0', b'0', '1106', NULL, NULL, NULL, '2021-11-24 13:53:12', b'0', NULL, 3, NULL);
			INSERT INTO `cb_dynamic_form_column` (`sequence_nbr`, `field_code`, `field_name`, `field_type`, `group_id`, `query_strategy`, `not_null`, `block`, `group_code`, `column_config`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `remark`, `sort`, `org_code`) VALUES (4, 'licence_type', '证件类型', 'radio', 7, 'eq', b'0', b'0', '1106', '{\"url\": \"\", \"data\": [], \"dict\": \"PERSON_LICENCE_TYPE\", \"type\": \"dict\"}', NULL, NULL, '2021-11-24 13:53:48', b'0', NULL, 4, NULL);
			INSERT INTO `cb_dynamic_form_column` (`sequence_nbr`, `field_code`, `field_name`, `field_type`, `group_id`, `query_strategy`, `not_null`, `block`, `group_code`, `column_config`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `remark`, `sort`, `org_code`) VALUES (5, 'licence_code', '证件编号', 'input', 7, 'like', b'0', b'0', '1106', NULL, NULL, NULL, NULL, b'0', NULL, 5, NULL);
			INSERT INTO `cb_dynamic_form_column` (`sequence_nbr`, `field_code`, `field_name`, `field_type`, `group_id`, `query_strategy`, `not_null`, `block`, `group_code`, `column_config`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `remark`, `sort`, `org_code`) VALUES (6, 'education', '学历', 'radio', 7, 'eq', b'0', b'0', '1106', '{\"url\": \"\", \"data\": [], \"dict\": \"XLLX\", \"type\": \"dict\"}', NULL, NULL, '2021-11-24 13:55:02', b'0', NULL, 6, NULL);
			INSERT INTO `cb_dynamic_form_column` (`sequence_nbr`, `field_code`, `field_name`, `field_type`, `group_id`, `query_strategy`, `not_null`, `block`, `group_code`, `column_config`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `remark`, `sort`, `org_code`) VALUES (7, 'major', '专业', 'input', 7, 'like', b'0', b'0', '1106', NULL, NULL, NULL, NULL, b'0', NULL, 7, NULL);
			INSERT INTO `cb_dynamic_form_column` (`sequence_nbr`, `field_code`, `field_name`, `field_type`, `group_id`, `query_strategy`, `not_null`, `block`, `group_code`, `column_config`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `remark`, `sort`, `org_code`) VALUES (8, 'phone', '电话', 'input', 7, 'like', b'0', b'0', '1106', NULL, NULL, NULL, NULL, b'0', NULL, 8, NULL);
			INSERT INTO `cb_dynamic_form_column` (`sequence_nbr`, `field_code`, `field_name`, `field_type`, `group_id`, `query_strategy`, `not_null`, `block`, `group_code`, `column_config`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `remark`, `sort`, `org_code`) VALUES (9, 'email', '邮箱', 'input', 7, 'like', b'0', b'0', '1106', NULL, NULL, NULL, NULL, b'0', NULL, 9, NULL);
			INSERT INTO `cb_dynamic_form_column` (`sequence_nbr`, `field_code`, `field_name`, `field_type`, `group_id`, `query_strategy`, `not_null`, `block`, `group_code`, `column_config`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `remark`, `sort`, `org_code`) VALUES (10, 'province', '省', 'provinceSelect', 7, 'like', b'0', b'0', '1106', NULL, NULL, NULL, NULL, b'0', NULL, 10, NULL);
			INSERT INTO `cb_dynamic_form_column` (`sequence_nbr`, `field_code`, `field_name`, `field_type`, `group_id`, `query_strategy`, `not_null`, `block`, `group_code`, `column_config`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `remark`, `sort`, `org_code`) VALUES (11, 'city', '市', 'citySelect', 7, 'like', b'0', b'0', '1106', NULL, NULL, NULL, NULL, b'0', NULL, 11, NULL);
			INSERT INTO `cb_dynamic_form_column` (`sequence_nbr`, `field_code`, `field_name`, `field_type`, `group_id`, `query_strategy`, `not_null`, `block`, `group_code`, `column_config`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `remark`, `sort`, `org_code`) VALUES (12, 'district', '区县', 'districtSelect', 7, 'like', b'0', b'0', '1106', NULL, NULL, NULL, NULL, b'0', NULL, 12, NULL);
			INSERT INTO `cb_dynamic_form_column` (`sequence_nbr`, `field_code`, `field_name`, `field_type`, `group_id`, `query_strategy`, `not_null`, `block`, `group_code`, `column_config`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `remark`, `sort`, `org_code`) VALUES (13, 'address', '详细地址', 'input', 7, 'like', b'0', b'0', '1106', NULL, NULL, NULL, NULL, b'0', NULL, 13, NULL);

		</sql>
	</changeSet>

	<changeSet author="kongfm" id="2021-11-25-01">
		<preConditions onFail="MARK_RAN">
			<sqlCheck expectedResult="1">select count(*) from cb_dynamic_form_column where sequence_nbr = 10</sqlCheck>
		</preConditions>
		<comment>delete person record  </comment>
		<sql>
			delete FROM cb_dynamic_form_column  where sequence_nbr = 10;
			delete FROM cb_dynamic_form_column  where sequence_nbr = 11;
			delete FROM cb_dynamic_form_column  where sequence_nbr = 12;
			delete FROM cb_dynamic_form_column  where sequence_nbr = 13;
		</sql>
	</changeSet>

	<changeSet author="kongfm" id="2021-11-26-01">
		<preConditions onFail="MARK_RAN">
			<tableExists tableName="tz_flc_person_quality"/>
		</preConditions>
		<comment>modify table tz_flc_person_quality add licence_date columns</comment>
		<sql>
			ALTER TABLE `tz_flc_person_quality` add licence_date datetime COMMENT '发证日期';
		</sql>
	</changeSet>

	<changeSet author="kongfm" id="2021-12-07-01">
		<preConditions onFail="MARK_RAN">
			<tableExists tableName="tcb_equipment"/>
		</preConditions>
		<comment>modify table tcb_equipment add equip_unit, equip_unit_id columns</comment>
		<sql>
			ALTER TABLE `tcb_equipment` add equip_unit_id bigint(32) COMMENT '设备所属单位id';
			ALTER TABLE `tcb_equipment` add equip_unit varchar(104) COMMENT '设备所属单位';
		</sql>
	</changeSet>


	<changeSet author="kongfm" id="2021-12-16-01">
		<preConditions onFail="MARK_RAN">
			<sqlCheck expectedResult="0">select count(*) from cb_data_dictionary where sequence_nbr = 1107</sqlCheck>
		</preConditions>
		<comment>add data_dictionary inform </comment>
		<sql>
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1107, '1107', '安装', 'BUILD_TYPE', NULL, NULL, NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1108, '1108', '改造', 'BUILD_TYPE', NULL, NULL, NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1109, '1109', '维修', 'BUILD_TYPE', NULL, NULL, NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1110, '1110', '移装', 'BUILD_TYPE', NULL, NULL, NULL, NULL, NULL, b'0', 1);

		</sql>
	</changeSet>


	<changeSet author="kongfm" id="2021-12-22-01">
		<preConditions onFail="MARK_RAN">
			<not>
				<tableExists tableName="tcb_equipment"/>
			</not>
		</preConditions>
		<comment>add tcb_equipment table </comment>
		<sql>
			CREATE TABLE `tcb_equipment`  (
			`sequence_nbr` bigint(50) NOT NULL COMMENT '主键',
			`equip_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '设备id',
			`code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '设备编号',
			`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '设备名称',
			`category_id` bigint(50) NOT NULL COMMENT '设备类别id',
			`category_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '设备类别名称',
			`type_id` bigint(50) NOT NULL COMMENT '设备种类id',
			`type_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '设备种类名称',
			`variety_id` bigint(50) NULL DEFAULT NULL COMMENT '设备品种id',
			`variety_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '设备品种名称',
			`brand` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '设备品牌',
			`model` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '规格型号',
			`inner_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '单位内部编号',
			`design_unit_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '设计单位名称',
			`manufacturer` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '制造单位名称',
			`design_life` int(10) NULL DEFAULT NULL COMMENT '设计使用年限',
			`factory_date` datetime NULL DEFAULT NULL COMMENT '出厂日期',
			`product_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '产品编号（出厂编号）',
			`supervision_agency` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '监督检验机构',
			`inspection_report_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '检验报告编号',
			`status` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '设备状态（未安装，已安装...）',
			`rec_user_id` int(11) NULL DEFAULT NULL COMMENT '更新人id',
			`rec_user_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人名称',
			`rec_date` datetime NULL DEFAULT NULL COMMENT '更新日期',
			`is_delete` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除(0未删除，1删除)',
			`equip_unit_id` bigint(32) NULL DEFAULT NULL COMMENT '设备所属单位id',
			`equip_unit` varchar(104) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '设备所属单位',
			PRIMARY KEY (`sequence_nbr`) USING BTREE
			) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '装备信息表' ROW_FORMAT = DYNAMIC;

		</sql>
	</changeSet>

	<changeSet author="kongfm" id="2021-12-22-02">
		<preConditions onFail="MARK_RAN">
			<not>
				<tableExists tableName="tcb_equipment_associated"/>
			</not>
		</preConditions>
		<comment>add tcb_equipment_associated table </comment>
		<sql>
			CREATE TABLE `tcb_equipment_associated`  (
			`sequence_nbr` bigint(50) NOT NULL COMMENT '主键',
			`equipment_id` bigint(50) NULL DEFAULT NULL COMMENT '设备id',
			`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '名称',
			`model` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '型号',
			`specifications` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '规格',
			`code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '编号',
			`amount` int(10) NULL DEFAULT NULL COMMENT '数量',
			`manufacturer` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '制造单位',
			`production_date` datetime NULL DEFAULT NULL COMMENT '制造日期',
			`part_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '部件/装置号',
			`certificate_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '型式试验合格证号',
			`remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
			`appraisal_agency_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '鉴定机构名称',
			`appraisal_date` datetime NULL DEFAULT NULL COMMENT '设计文件鉴定日期',
			`appraisal_report_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '鉴定报告书编号',
			`supervisory_inspection_agency` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '监检检验机构',
			`social_credit_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '统一社会信用代码',
			`approval_certificate_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '机构核准证编号',
			`rec_user_id` bigint(50) NULL DEFAULT NULL COMMENT '更新人id',
			`rec_user_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人名称',
			`rec_date` datetime NULL DEFAULT NULL COMMENT '更新日期',
			`is_delete` bit(1) NULL DEFAULT NULL COMMENT '是否删除（1删除，0未删除）',
			PRIMARY KEY (`sequence_nbr`) USING BTREE
			) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '配套设备/设施/部件' ROW_FORMAT = DYNAMIC;
		</sql>
	</changeSet>

	<changeSet author="kongfm" id="2021-12-22-03">
		<preConditions onFail="MARK_RAN">
			<not>
				<tableExists tableName="tcb_equipment_index"/>
			</not>
		</preConditions>
		<comment>add tcb_equipment_index table </comment>
		<sql>
			CREATE TABLE `tcb_equipment_index`  (
			`sequence_nbr` bigint(50) NOT NULL COMMENT '主键',
			`equipment_id` bigint(50) NOT NULL COMMENT '设备id',
			`equipment_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '设备名称',
			`value` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '指标值',
			`def_index_id` bigint(50) NULL DEFAULT NULL COMMENT '装备定义指标id',
			`def_index_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '装备定义指标名称',
			`def_index_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '装备定义指标key',
			`rec_user_id` bigint(50) NULL DEFAULT NULL COMMENT '更新人id',
			`rec_user_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人名称',
			`rec_date` datetime NULL DEFAULT NULL COMMENT '更新时间',
			`is_delete` bit(1) NULL DEFAULT NULL COMMENT '是否删除（1删除，0未删除）',
			PRIMARY KEY (`sequence_nbr`) USING BTREE
			) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '设备指标' ROW_FORMAT = DYNAMIC;
		</sql>
	</changeSet>

	<changeSet author="kongfm" id="2021-12-23-01">
		<preConditions onFail="MARK_RAN">
			<tableExists tableName="tcb_equipment"/>
		</preConditions>
		<comment>modify table tcb_equipment add address columns</comment>
		<sql>
			ALTER TABLE `tcb_equipment` add address varchar(500) COMMENT '详细地址';
			ALTER TABLE `tcb_equipment` add longitude varchar(30) COMMENT '经度';
			ALTER TABLE `tcb_equipment` add latitude varchar(30) COMMENT '纬度';
			ALTER TABLE `tcb_equipment` add region_code varchar(30) COMMENT '所属区域代码';
		</sql>
	</changeSet>

	<changeSet author="kongfm" id="2021-12-23-02">
	<preConditions onFail="MARK_RAN">
		<not>
			<tableExists tableName="tcb_inform_equipment"/>
		</not>
	</preConditions>
	<comment>add tcb_inform_equipment table </comment>
	<sql>
		CREATE TABLE `tcb_inform_equipment` (
		`sequence_nbr` bigint(50) NOT NULL COMMENT '主键',
		`equip_id` varchar(50) NOT NULL COMMENT '设备id',
		`code` varchar(50) DEFAULT NULL COMMENT '设备编号',
		`name` varchar(255) NOT NULL COMMENT '设备名称',
		`category_id` bigint(50) NOT NULL COMMENT '设备类别id',
		`category_name` varchar(255) DEFAULT NULL COMMENT '设备类别名称',
		`type_id` bigint(50) NOT NULL COMMENT '设备种类id',
		`type_name` varchar(255) DEFAULT NULL COMMENT '设备种类名称',
		`variety_id` bigint(50) DEFAULT NULL COMMENT '设备品种id',
		`variety_name` varchar(255) DEFAULT NULL COMMENT '设备品种名称',
		`brand` varchar(255) DEFAULT NULL COMMENT '设备品牌',
		`model` varchar(255) DEFAULT NULL COMMENT '规格型号',
		`inner_code` varchar(50) DEFAULT NULL COMMENT '单位内部编号',
		`design_unit_name` varchar(255) DEFAULT NULL COMMENT '设计单位名称',
		`manufacturer` varchar(255) DEFAULT NULL COMMENT '制造单位名称',
		`design_life` int(10) DEFAULT NULL COMMENT '设计使用年限',
		`factory_date` datetime DEFAULT NULL COMMENT '出厂日期',
		`product_code` varchar(255) DEFAULT NULL COMMENT '产品编号（出厂编号）',
		`supervision_agency` bigint(50) DEFAULT NULL COMMENT '监督检验机构',
		`inspection_report_code` varchar(255) DEFAULT NULL COMMENT '检验报告编号',
		`status` varchar(50) NOT NULL COMMENT '设备状态（未安装，已安装...）',
		`rec_user_id` int(11) DEFAULT NULL COMMENT '更新人id',
		`rec_user_name` varchar(255) DEFAULT NULL COMMENT '更新人名称',
		`rec_date` datetime DEFAULT NULL COMMENT '更新日期',
		`is_delete` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除(0未删除，1删除)',
		`equip_unit_id` bigint(32) DEFAULT NULL COMMENT '设备所属单位id',
		`equip_unit` varchar(104) DEFAULT NULL COMMENT '设备所属单位',
		`inform_id` bigint(32) DEFAULT NULL COMMENT '告知单id',
		`source_equipment_id` bigint(32) DEFAULT NULL COMMENT '原设备id',
		PRIMARY KEY (`sequence_nbr`) USING BTREE
		) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='告知申请-设备信息表';
	</sql>
</changeSet>

	<changeSet author="kongfm" id="2021-12-23-03">
		<preConditions onFail="MARK_RAN">
			<not>
				<tableExists tableName="tz_equipment_inform"/>
			</not>
		</preConditions>
		<comment>add tz_equipment_inform table </comment>
		<sql>
			CREATE TABLE `tz_equipment_inform` (
			`sequence_nbr` bigint(19) NOT NULL DEFAULT '0' COMMENT 'id',
			`product_code` varchar(20) DEFAULT NULL COMMENT '施工告知编号',
			`product_inform_date` datetime DEFAULT NULL COMMENT '施工告知日期',
			`product_unit` varchar(50) DEFAULT NULL COMMENT '施工单位',
			`product_unit_id` bigint(32) DEFAULT NULL COMMENT '施工单位id',
			`product_type` varchar(20) DEFAULT NULL COMMENT '施工类型',
			`product_type_code` varchar(25) DEFAULT NULL COMMENT '施工类型code',
			`licence_code` varchar(50) DEFAULT NULL COMMENT '生产许可证编号',
			`licence_date` datetime DEFAULT NULL COMMENT '生产许可证有效期',
			`region_code` varchar(100) DEFAULT NULL COMMENT '区域编码',
			`province` varchar(50) DEFAULT NULL COMMENT '省',
			`city` varchar(50) DEFAULT NULL COMMENT '市',
			`district` varchar(50) DEFAULT NULL COMMENT '县区',
			`stree` varchar(50) DEFAULT NULL COMMENT '街道',
			`community` varchar(50) DEFAULT NULL COMMENT '小区',
			`address` varchar(100) DEFAULT NULL COMMENT '详细地址',
			`longitude` varchar(50) DEFAULT NULL COMMENT '经度',
			`latitude` varchar(50) DEFAULT NULL COMMENT '纬度',
			`principal` varchar(20) DEFAULT NULL COMMENT '施工负责人',
			`principal_id` bigint(32) DEFAULT NULL COMMENT '施工负责人id',
			`principal_phone` varchar(20) DEFAULT NULL COMMENT '施工负责人电话',
			`plan_product_date` datetime DEFAULT NULL COMMENT '计划施工日期',
			`accept_unit` varchar(50) DEFAULT NULL COMMENT '接收机构',
			`accept_unit_id` bigint(32) DEFAULT NULL COMMENT '接收机构id',
			`inspecton_unit` varchar(50) DEFAULT NULL COMMENT '检验机构',
			`inspecton_unit_id` bigint(32) DEFAULT NULL COMMENT '检验机构id',
			`use_unit` varchar(50) DEFAULT NULL COMMENT '使用单位',
			`use_unit_id` bigint(32) DEFAULT NULL COMMENT '使用单位id',
			`property_unit` varchar(50) DEFAULT NULL COMMENT '产权单位',
			`property_unit_id` bigint(32) DEFAULT NULL COMMENT '产权单位id',
			`use_site` varchar(50) DEFAULT NULL COMMENT '使用场所',
			`use_site_code` varchar(50) DEFAULT NULL COMMENT '使用场所code',
			`inform_code` varchar(50) DEFAULT NULL COMMENT '告知书编号',
			`inform_status` varchar(50) DEFAULT NULL COMMENT '告知单状态 0 暂存 1未接收 9已接收',
			`rec_user_name` varchar(15) CHARACTER SET utf8 DEFAULT NULL COMMENT '接警人名称',
			`rec_user_id` varchar(19) CHARACTER SET utf8 DEFAULT NULL COMMENT '接警人',
			`rec_date` datetime DEFAULT NULL COMMENT '接警时间',
			`is_delete` bit(1) DEFAULT b'0' COMMENT '是否删除',
			PRIMARY KEY (`sequence_nbr`) USING BTREE
			) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='设备告知单';
		</sql>
	</changeSet>

	<changeSet author="kongfm" id="2021-12-23-04">
		<preConditions onFail="MARK_RAN">
			<sqlCheck expectedResult="0">select count(*) from cb_data_dictionary where sequence_nbr = 1108</sqlCheck>
		</preConditions>
		<comment>add data_dictionary inform </comment>
		<sql>
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1108, '1108', '改造', 'BUILD_TYPE', NULL, NULL, NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1109, '1109', '维修', 'BUILD_TYPE', NULL, NULL, NULL, NULL, NULL, b'0', 1);
			INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1110, '1110', '移装', 'BUILD_TYPE', NULL, NULL, NULL, NULL, NULL, b'0', 1);

		</sql>
	</changeSet>


	<changeSet author="kongfm" id="2021-12-23-05">
		<preConditions onFail="MARK_RAN">
			<tableExists tableName="tcb_inform_equipment"/>
		</preConditions>
		<comment>modify table tcb_inform_equipment add address columns</comment>
		<sql>
			ALTER TABLE `tcb_inform_equipment` add address varchar(500) COMMENT '详细地址';
			ALTER TABLE `tcb_inform_equipment` add longitude varchar(30) COMMENT '经度';
			ALTER TABLE `tcb_inform_equipment` add latitude varchar(30) COMMENT '纬度';
			ALTER TABLE `tcb_inform_equipment` add region_code varchar(30) COMMENT '所属区域代码';
		</sql>
	</changeSet>

	<changeSet author="kongfm" id="2021-12-24-01">
		<preConditions onFail="MARK_RAN">
			<tableExists tableName="tz_equipment_inform"/>
		</preConditions>
		<comment>modify table tz_equipment_inform add processInfo columns</comment>
		<sql>
			ALTER TABLE `tz_equipment_inform` add process_id varchar(50) COMMENT '流程id';
		</sql>
	</changeSet>

	<changeSet author="kongfm" id="2021-12-27-01">
		<preConditions onFail="MARK_RAN">
			<tableExists tableName="tz_equipment_inform"/>
		</preConditions>
		<comment>modify table tz_equipment_inform add processInfo columns</comment>
		<sql>
			ALTER TABLE `tz_equipment_inform` add process_status varchar(50) COMMENT '流程状态';
		</sql>
	</changeSet>


	<changeSet author="kongfm" id="2021-12-27-02">
		<preConditions onFail="MARK_RAN">
			<not>
				<tableExists tableName="tz_inform_process_info"/>
			</not>
		</preConditions>
		<comment>add tz_inform_process_info table </comment>
		<sql>
			CREATE TABLE `tz_inform_process_info` (
			`sequence_nbr` bigint(30) NOT NULL AUTO_INCREMENT COMMENT '自增主键',
			`process_info` varchar(255) NOT NULL COMMENT '流转内容',
			`handler` varchar(255) NOT NULL COMMENT '流程操作人',
			`handler_unit_id` bigint(32) NOT NULL COMMENT '操作人所属单位id',
			`rec_user_id` bigint(30) DEFAULT NULL COMMENT '更新人id',
			`rec_user_name` varchar(100) DEFAULT NULL COMMENT '更新人名称',
			`rec_date` datetime DEFAULT NULL COMMENT '更新时间',
			`is_delete` bit(1) DEFAULT b'0' COMMENT '是否删除（0：未删除，1：已删除）',
			`process_status` varchar(15) NOT NULL COMMENT '流程状态',
			`handler_id` bigint(32) DEFAULT NULL COMMENT '流程操作人id',
			`handler_unit` varchar(255) DEFAULT NULL COMMENT '操作人所属单位',
			`process_id` varchar(50) DEFAULT NULL COMMENT '流程id',
			`inform_id` bigint(32) DEFAULT NULL COMMENT '告知书id',
			PRIMARY KEY (`sequence_nbr`) USING BTREE
			) ENGINE=InnoDB AUTO_INCREMENT=1458324621349306370 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='通话记录附件';
		</sql>
	</changeSet>

	<changeSet author="kongfm" id="2021-12-29-01">
		<preConditions onFail="MARK_RAN">
			<not>
				<tableExists tableName="tcb_equipment_index_inform"/>
			</not>
		</preConditions>
		<comment>add tcb_equipment_index_inform table </comment>
		<sql>
			CREATE TABLE `tcb_equipment_index_inform` (
			`sequence_nbr` bigint(50) NOT NULL COMMENT '主键',
			`equipment_id` bigint(50) NOT NULL COMMENT '设备id',
			`equipment_name` varchar(255) DEFAULT NULL COMMENT '设备名称',
			`value` varchar(255) DEFAULT NULL COMMENT '指标值',
			`def_index_id` bigint(50) DEFAULT NULL COMMENT '装备定义指标id',
			`def_index_name` varchar(255) DEFAULT NULL COMMENT '装备定义指标名称',
			`def_index_key` varchar(255) DEFAULT NULL COMMENT '装备定义指标key',
			`rec_user_id` bigint(50) DEFAULT NULL COMMENT '更新人id',
			`rec_user_name` varchar(255) DEFAULT NULL COMMENT '更新人名称',
			`rec_date` datetime DEFAULT NULL COMMENT '更新时间',
			`is_delete` bit(1) DEFAULT NULL COMMENT '是否删除（1删除，0未删除）',
			PRIMARY KEY (`sequence_nbr`) USING BTREE
			) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='设备指标';
		</sql>
	</changeSet>

</databaseChangeLog>

