CREATE TABLE `app_config` (
  `id` int NOT NULL AUTO_INCREMENT,
  `appid` varchar(100) COLLATE utf8_bin DEFAULT NULL,
  `appsecret` varchar(100) COLLATE utf8_bin DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb3 COLLATE=utf8_bin
INSERT INTO app_config
(id, app_id, app_secret, app_name)
VALUES(1, '6LzizcRf7h8yLx28', '5033dcbfbc6509b91b7f51ecf8a4b3c13276d0297bf09e429ae3213ef9cff3280a4797ac47c8ce301aebd3a9c49fb6343a64fe7287c3e9e65ad8f8ab5ebaedef', 'SalesForce');
INSERT INTO app_config
(id, app_id, app_secret, app_name)
VALUES(2, 'xLjAH3Bc8sKVzfZG', '4517b457fefc0c59437c2ece7fe1800e08a3c09dfbce876fe5bdd5fe64e2329cfd400e7fed2c5e258e10171a41cddd2d60dbeada9745d5be4717f088d9c50b77', 'SAP');
INSERT INTO app_config
(id, app_id, app_secret, app_name)
VALUES(3, 'ovfbOZvxKqi0Hx6t', '1c24efb7c4253209101ef037ea605907301f8b332aefefbcea40c901c29d6e2680487309c3abc5121a363dafc5c59dd1ffc6d2da79715192d40483d0d3115af5', 'SPO');
INSERT INTO app_config
(id, app_id, app_secret, app_name)
VALUES(4, 'hzS6VlraGh7tjXKo', 'e7325ca5b7b673a3e0e9ceabf72090d68605cf7cda3c0392202e584cb52965fd041416842f7ce1cc2ea35c1d2d17c0b25641361c9f52854b21bdc91c6d040935', '千里马');
INSERT INTO app_config
(id, app_id, app_secret, app_name)
VALUES(5, 'axkUARv7nzMqRzkO', 'b48833bc48592bdfecad68a75b275aab80b29b7af9aa5f553f8fb503e6edb3fd2f2682907be2549c1ad0c12314db4cbd368e0b61e2fd9a29e33012108527b7cb', '小程序');
INSERT INTO app_config
(id, app_id, app_secret, app_name)
VALUES(6, '8LzKI9btg5eq3QiW', 'bb4e50bac195ae65833d1f8fdbefdb2ecbe32f483e6dfc9405d0bd4506b3e18df9d04a753495cb046418fcfe1d903341c85e4f06a4e2afe5943e9489bdc4fa60', '共通平台');
INSERT INTO app_config
(id, app_id, app_secret, app_name)
VALUES(7, 'FlcS0v228lzsn9cN', '6522e3f835acfadbf8da05d01cfc9885ccfaef6b9c7ac189aa9747f7066610e33adef181378d11265fd2d19f46c2dac7ce1c5063fbc8768f274147929806c95a', 'OBPM');

CREATE TABLE `app_permission_config` (
  `id` int NOT NULL AUTO_INCREMENT,
  `appid` varchar(45) COLLATE utf8_bin DEFAULT NULL,
  `url` varchar(45) COLLATE utf8_bin DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb3 COLLATE=utf8_bin


CREATE TABLE `sys_log` (
  `id` int NOT NULL AUTO_INCREMENT,
  `ret_content` tinytext COLLATE utf8_bin,
  `ip` varchar(45) COLLATE utf8_bin DEFAULT NULL,
  `is_delete` int DEFAULT NULL,
  `create_time` datetime DEFAULT NULL,
  `update_time` datetime DEFAULT NULL,
  `uri` varchar(45) COLLATE utf8_bin DEFAULT NULL,
  `create_by` varchar(100) COLLATE utf8_bin DEFAULT NULL,
  `update_by` varchar(100) COLLATE utf8_bin DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=81 DEFAULT CHARSET=utf8mb3 COLLATE=utf8_bin

CREATE TABLE `lead` (
                        `id` bigint(20) NOT NULL,
                        `last_name` varchar(255) COLLATE utf8_bin DEFAULT NULL,
                        `phone` varchar(255) COLLATE utf8_bin DEFAULT NULL,
                        `email` varchar(255) COLLATE utf8_bin DEFAULT NULL,
                        `create_by` varchar(255) COLLATE utf8_bin DEFAULT NULL,
                        `create_time` datetime DEFAULT NULL,
                        `update_by` varchar(255) COLLATE utf8_bin DEFAULT NULL,
                        `update_time` datetime DEFAULT NULL,
                        `is_delete` int(3) DEFAULT NULL,
                        `sf_record_id` varchar(255) DEFAULT NULL,
                        PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;


CREATE TABLE `contact` (
                           `id` bigint(20) NOT NULL,
                           `last_name` varchar(255) COLLATE utf8_bin DEFAULT NULL,
                           `phone` varchar(255) COLLATE utf8_bin DEFAULT NULL,
                           `email` varchar(255) COLLATE utf8_bin DEFAULT NULL,
                           `create_by` varchar(255) COLLATE utf8_bin DEFAULT NULL,
                           `create_time` datetime DEFAULT NULL,
                           `update_by` varchar(255) COLLATE utf8_bin DEFAULT NULL,
                           `update_time` datetime DEFAULT NULL,
                           `is_delete` int(3) DEFAULT NULL,
                           `sf_record_id` varchar(255) DEFAULT NULL,
                           PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- pipl.consum_apply definition

CREATE TABLE `consum_apply` (
                                `id` bigint NOT NULL,
                                `phone_number` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
                                `direct_shippment_address` varchar(500) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
                                `create_by` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
                                `create_time` datetime DEFAULT NULL,
                                `update_by` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
                                `update_time` datetime DEFAULT NULL,
                                `is_delete` int DEFAULT NULL,
                                `sf_record_id` varchar(255) COLLATE utf8_bin DEFAULT NULL,
                                PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

CREATE TABLE pipl.`consum_apply_equipment_set_detail` (
                                                          `id` bigint(20) NOT NULL,
                                                          `trial_user` varchar(255) COLLATE utf8_bin DEFAULT NULL,
                                                          `create_by` varchar(255) COLLATE utf8_bin DEFAULT NULL,
                                                          `create_time` datetime DEFAULT NULL,
                                                          `update_by` varchar(255) COLLATE utf8_bin DEFAULT NULL,
                                                          `update_time` datetime DEFAULT NULL,
                                                          `is_delete` int(3) DEFAULT NULL,
                                                          `sf_record_id` varchar(255) DEFAULT NULL,
                                                          PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

CREATE TABLE pipl.`repair` (
                                                          `id` bigint(20) NOT NULL,
                                                          `address_contacts` varchar(255) COLLATE utf8_bin DEFAULT NULL,
                                                          `address_telephone` varchar(255) COLLATE utf8_bin DEFAULT NULL,
                                                          `detailed_address` varchar(255) COLLATE utf8_bin DEFAULT NULL,
                                                          `address_contacts_name` varchar(255) COLLATE utf8_bin DEFAULT NULL,
                                                          `repair_applicant` varchar(255) COLLATE utf8_bin DEFAULT NULL,
                                                          `address_zip_code` varchar(255) COLLATE utf8_bin DEFAULT NULL,
                                                          `create_by` varchar(255) COLLATE utf8_bin DEFAULT NULL,
                                                          `create_time` datetime DEFAULT NULL,
                                                          `update_by` varchar(255) COLLATE utf8_bin DEFAULT NULL,
                                                          `update_time` datetime DEFAULT NULL,
                                                          `is_delete` int(3) DEFAULT NULL,
                                                          `sf_record_id` varchar(255) DEFAULT NULL,
                                                          PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

alter table contact add column title varchar(255);
alter table contact add column oly_assistant_type varchar(255);
alter table contact add column job_category_picklist varchar(255);
alter table contact add column contact_address varchar(255);
alter table contact add column type varchar(255);
alter table contact add column doctor_division1 varchar(255);
alter table contact add column contact_type varchar(255);
alter table contact add column medical_staff_full_name varchar(255);
alter table contact add column mobile_phone varchar(255);
alter table contact add column unique_number varchar(255);

CREATE TABLE `aseactivity` (
                               `id` bigint(20) NOT NULL,
                               `visit_staff` varchar(255) COLLATE utf8_bin DEFAULT NULL,
                               `reporter_ase` varchar(255) COLLATE utf8_bin DEFAULT NULL,
                               `create_by` varchar(255) COLLATE utf8_bin DEFAULT NULL,
                               `create_time` datetime DEFAULT NULL,
                               `update_by` varchar(255) COLLATE utf8_bin DEFAULT NULL,
                               `update_time` datetime DEFAULT NULL,
                               `is_delete` int(3) DEFAULT NULL,
                               `sf_record_id` varchar(255) DEFAULT NULL,
                               PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

CREATE TABLE `address` (
                           `id` bigint(20) NOT NULL,
                           `telephone` varchar(255) COLLATE utf8_bin DEFAULT NULL,
                           `zip_code` varchar(255) COLLATE utf8_bin DEFAULT NULL,
                           `detailed_address` varchar(255) COLLATE utf8_bin DEFAULT NULL,
                           `create_by` varchar(255) COLLATE utf8_bin DEFAULT NULL,
                           `create_time` datetime DEFAULT NULL,
                           `update_by` varchar(255) COLLATE utf8_bin DEFAULT NULL,
                           `update_time` datetime DEFAULT NULL,
                           `is_delete` int(3) DEFAULT NULL,
                           `sf_record_id` varchar(255) DEFAULT NULL,
                           PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

CREATE TABLE `campaign_member` (
                                   `id` bigint(20) NOT NULL,
                                   `contact` bigint(20) COLLATE utf8_bin DEFAULT NULL,
                                   `create_by` varchar(255) COLLATE utf8_bin DEFAULT NULL,
                                   `create_time` datetime DEFAULT NULL,
                                   `update_by` varchar(255) COLLATE utf8_bin DEFAULT NULL,
                                   `update_time` datetime DEFAULT NULL,
                                   `is_delete` int(3) DEFAULT NULL,
                                   `sf_record_id` varchar(255) DEFAULT NULL,
                                   PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

alter table campaign_member modify column contact varchar(255) COLLATE utf8_bin DEFAULT NULL;


CREATE TABLE `report`  (
  `id` bigint(20) NOT NULL,
  `voc_informer_name` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `caller_phone` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `voc_informer_contact` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `person_in_charge_text` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `professor_sigh_text` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `staff_info_manual` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `responsible_person_HP` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `[REDACTED]` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `[REDACTED]` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `[REDACTED]` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `[REDACTED]` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `[REDACTED]` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `age` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `medical_history` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `sex` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `create_by` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `create_time` datetime DEFAULT NULL,
  `update_by` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `update_time` datetime DEFAULT NULL,
  `is_delete` int(3) DEFAULT NULL,
  `sf_record_id` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;



CREATE TABLE pipl.`inquiry_form` (
   `id` bigint(20) NOT NULL,
   `phone` varchar(255) COLLATE utf8_bin DEFAULT NULL,
	 `email` varchar(255) COLLATE utf8_bin DEFAULT NULL,
   `create_by` varchar(255) COLLATE utf8_bin DEFAULT NULL,
   `create_time` datetime DEFAULT NULL,
   `update_by` varchar(255) COLLATE utf8_bin DEFAULT NULL,
   `update_time` datetime DEFAULT NULL,
   `is_delete` int(3) DEFAULT NULL,
   `sf_record_id` varchar(255) DEFAULT NULL,
   PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;


CREATE TABLE `agency_contact` (
                                   `id` bigint(20) NOT NULL,
                                   `name` varchar(255) COLLATE utf8_bin DEFAULT NULL,
                                   `doctor_division1` varchar(255) COLLATE utf8_bin DEFAULT NULL,
                                   `type` varchar(255) COLLATE utf8_bin DEFAULT NULL,
                                   `create_by` varchar(255) COLLATE utf8_bin DEFAULT NULL,
                                   `create_time` datetime DEFAULT NULL,
                                   `update_by` varchar(255) COLLATE utf8_bin DEFAULT NULL,
                                   `update_time` datetime DEFAULT NULL,
                                   `is_delete` int(3) DEFAULT NULL,
                                   `sf_record_id` varchar(255) DEFAULT NULL,
                                   PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;


CREATE TABLE `qis_report` (
                                  `id` bigint(20) NOT NULL,
                                  `caller_phone` varchar(255) COLLATE utf8_bin DEFAULT NULL,
                                  `responsible_person_h_p` varchar(255) COLLATE utf8_bin DEFAULT NULL,
                                  `create_by` varchar(255) COLLATE utf8_bin DEFAULT NULL,
                                  `create_time` datetime DEFAULT NULL,
                                  `update_by` varchar(255) COLLATE utf8_bin DEFAULT NULL,
                                  `update_time` datetime DEFAULT NULL,
                                  `is_delete` int(3) DEFAULT NULL,
                                  `sf_record_id` varchar(255) DEFAULT NULL,
                                  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;


CREATE TABLE `sample_order_list` (
   `id` bigint(20) NOT NULL,
   `delivery_address` varchar(255) COLLATE utf8_bin DEFAULT NULL,
	 `delivery_contact` varchar(255) COLLATE utf8_bin DEFAULT NULL,
	 `delivery_phone` varchar(255) COLLATE utf8_bin DEFAULT NULL,
   `create_by` varchar(255) COLLATE utf8_bin DEFAULT NULL,
   `create_time` datetime DEFAULT NULL,
   `update_by` varchar(255) COLLATE utf8_bin DEFAULT NULL,
   `update_time` datetime DEFAULT NULL,
   `is_delete` int(3) DEFAULT NULL,
   `sf_record_id` varchar(255) DEFAULT NULL,
   PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

CREATE TABLE `tender_information` (
                                      `id` bigint(20) NOT NULL,
                                      `zhao_relation_name` varchar(255) COLLATE utf8_bin DEFAULT NULL,
                                      `zhao_relation_way` varchar(255) COLLATE utf8_bin DEFAULT NULL,
                                      `zhong_relation_name` varchar(255) COLLATE utf8_bin DEFAULT NULL,
                                      `zhong_relation_way` varchar(255) COLLATE utf8_bin DEFAULT NULL,
                                      `agent_relation_name` varchar(255) COLLATE utf8_bin DEFAULT NULL,
                                      `agent_relation_way` varchar(255) COLLATE utf8_bin DEFAULT NULL,
                                      `create_by` varchar(255) COLLATE utf8_bin DEFAULT NULL,
                                      `create_time` datetime DEFAULT NULL,
                                      `update_by` varchar(255) COLLATE utf8_bin DEFAULT NULL,
                                      `update_time` datetime DEFAULT NULL,
                                      `is_delete` int(3) DEFAULT NULL,
                                      `sf_record_id` varchar(255) DEFAULT NULL,
                                      PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

ALTER TABLE ase_activity ADD CustomerTel varchar(100) NULL;
ALTER TABLE ase_activity ADD WorkPlace varchar(100) NULL;

CREATE TABLE `campaign_user` (  `id` bigint NOT NULL,  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,  `email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,  `phone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,  `create_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,  `create_time` datetime DEFAULT NULL,  `update_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,  `update_time` datetime DEFAULT NULL,  `is_delete` int DEFAULT NULL,  `sf_record_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,  PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC

INSERT INTO app_permission_config(id, app_id, url)VALUES(180, 'M2os1A1gC8GH4S9v', '/ssbgapi/campaignuser/query');
INSERT INTO app_permission_config(id, app_id, url)VALUES(181, 'M2os1A1gC8GH4S9v', '/ssbgapi/campaignuser/insert');
INSERT INTO app_permission_config(id, app_id, url)VALUES(182, 'M2os1A1gC8GH4S9v', '/ssbgapi/campaignuser/update');
INSERT INTO app_permission_config(id, app_id, url)VALUES(183, 'M2os1A1gC8GH4S9v', '/ssbgapi/campaignuser/delete');
INSERT INTO app_permission_config(id, app_id, url)VALUES(184, 'M2os1A1gC8GH4S9v', '/ssbgapi/campaignuser/undelete');
INSERT INTO app_permission_config(id, app_id, url)VALUES(185, 'M2os1A1gC8GH4S9v', '/ssbgapi/campaignuser/search');
INSERT INTO app_permission_config(id, app_id, url)VALUES(186, 'M2os1A1gC8GH4S9v', '/ssbgapi/campaignuser/batchupload');
