INSERT INTO `sc_tb_menu` (`id`, `pai`, `nome`, `icone`, `tipo`, `local`, `arquivo`, `url`, `target`, `ativo`, `modulo`, `ordem`, `ad_a_click`, `ad_p_nome`, `ad_p_nome_cor`, `cor_nome`, `cor_icone`, `temp`) VALUES
('prevbra_01', '001', 'Indicadores Geral', 'activity', 'C', '.content-body', 'mod/prevbra/dash_g.php', '#', NULL, 1, 'prevbra', 0, NULL, NULL, 'bg-primary', NULL, NULL, NULL),
('prevbra_37', '001', 'Indicadores Unidade', 'activity', 'C', '.content-body', 'mod/prevbra/dash_u.php', '#', NULL, 1, 'prevbra', 0, NULL, NULL, 'bg-primary', NULL, NULL, NULL),
('prevbra_38', '001', 'Indicadores Equipe', 'activity', 'C', '.content-body', 'mod/prevbra/dash_e.php', '#', NULL, 1, 'prevbra', 0, NULL, NULL, 'bg-primary', NULL, NULL, NULL),
('prevbra_02', '000', 'Previne Brasil', 'activity', 'N', '.content-body', NULL, '#', NULL, 1, 'prevbra', 0, NULL, NULL, 'bg-primary', NULL, NULL, NULL),
('prevbra_03', 'prevbra_02', '1, 2 e 3', 'list', 'C', '.content-body', 'mod/prevbra/indicador_123.php', '#', NULL, 1, 'prevbra', 0, NULL, NULL, 'bg-primary', NULL, NULL, NULL),
('prevbra_04', 'prevbra_02', '4', 'list', 'C', '.content-body', 'mod/prevbra/indicador_4.php', '#', NULL, 1, 'prevbra', 0, NULL, NULL, 'bg-primary', NULL, NULL, NULL),
('prevbra_05', 'prevbra_02', '5', 'list', 'C', '.content-body', 'mod/prevbra/indicador_5.php', '#', NULL, 1, 'prevbra', 0, NULL, NULL, 'bg-primary', NULL, NULL, NULL),
('prevbra_06', 'prevbra_02', '6', 'list', 'C', '.content-body', 'mod/prevbra/indicador_6.php', '#', NULL, 1, 'prevbra', 0, NULL, NULL, 'bg-primary', NULL, NULL, NULL),
('prevbra_07', 'prevbra_02', '7', 'list', 'C', '.content-body', 'mod/prevbra/indicador_7.php', '#', NULL, 1, 'prevbra', 0, NULL, NULL, 'bg-primary', NULL, NULL, NULL),
('prevbra_08', 'prevbra_02', 'Gerar', 'play-circle', 'N', '.content-body', NULL, '#', NULL, 1, 'prevbra', 0, NULL, NULL, 'bg-primary', NULL, NULL, NULL),
('prevbra_09', 'prevbra_02', 'Configurações', 'settings', 'N', '.content-body', NULL, '#', NULL, 1, 'prevbra', 0, NULL, NULL, 'bg-primary', NULL, NULL, NULL),
('prevbra_10', 'prevbra_08', '1, 2 e 3', 'play', 'C', '.content-body', 'mod/prevbra/run_i123.php', '#', NULL, 1, 'prevbra', 0, 'SlickLoader.enable();', NULL, 'bg-primary', NULL, NULL, NULL),
('prevbra_11', 'prevbra_08', '4', 'play', 'C', '.content-body', 'mod/prevbra/run_i4.php', '#', NULL, 1, 'prevbra', 0, 'SlickLoader.enable();', NULL, 'bg-primary', NULL, NULL, NULL),
('prevbra_12', 'prevbra_08', '5', 'play', 'C', '.content-body', 'mod/prevbra/run_i5.php', '#', NULL, 1, 'prevbra', 0, 'SlickLoader.enable();', NULL, 'bg-primary', NULL, NULL, NULL),
('prevbra_13', 'prevbra_08', '6', 'play', 'C', '.content-body', 'mod/prevbra/run_i6.php', '#', NULL, 1, 'prevbra', 0, 'SlickLoader.enable();', NULL, 'bg-primary', NULL, NULL, NULL),
('prevbra_14', 'prevbra_08', '7', 'play', 'C', '.content-body', 'mod/prevbra/run_i7.php', '#', NULL, 1, 'prevbra', 0, 'SlickLoader.enable();', NULL, 'bg-primary', NULL, NULL, NULL),
('prevbra_31', 'prevbra_08', 'Todos', 'play', 'C', '.content-body', 'mod/prevbra/frm_ex_todos.php', '#', NULL, 1, 'prevbra', 0, NULL, NULL, 'bg-primary', NULL, NULL, NULL),
('prevbra_15', 'prevbra_09', '1, 2 e 3', 'tool', 'C', '.content-body', 'mod/prevbra/frm_ind_123.php', '#', NULL, 1, 'prevbra', 0, NULL, NULL, 'bg-primary', NULL, NULL, NULL),
('prevbra_16', 'prevbra_09', '4', 'tool', 'C', '.content-body', 'mod/prevbra/frm_ind_4.php', '#', NULL, 1, 'prevbra', 0, NULL, NULL, 'bg-primary', NULL, NULL, NULL),
('prevbra_17', 'prevbra_09', '5', 'tool', 'C', '.content-body', 'mod/prevbra/frm_ind_5.php', '#', NULL, 1, 'prevbra', 0, NULL, NULL, 'bg-primary', NULL, NULL, NULL),
('prevbra_18', 'prevbra_09', '6', 'tool', 'C', '.content-body', 'mod/prevbra/frm_ind_6.php', '#', NULL, 1, 'prevbra', 0, NULL, NULL, 'bg-primary', NULL, NULL, NULL),
('prevbra_19', 'prevbra_09', '7', 'tool', 'C', '.content-body', 'mod/prevbra/frm_ind_7.php', '#', NULL, 1, 'prevbra', 0, NULL, NULL, 'bg-primary', NULL, NULL, NULL),
('prevbra_20', 'prevbra_09', 'Todos', 'tool', 'C', '.content-body', 'mod/prevbra/frm_dti_dtf.php', '#', NULL, 1, 'prevbra', 0, NULL, NULL, 'bg-primary', NULL, NULL, NULL),
('prevbra_35', 'prevbra_09', 'Denominador', 'tool', 'C', '.content-body', 'mod/prevbra/frm_iest.php', '#', NULL, 1, 'prevbra', 0, NULL, NULL, 'bg-primary', NULL, NULL, NULL),
('prevbra_36', 'prevbra_09', 'Denominador por equipe', 'tool', 'C', '.content-body', 'mod/prevbra/frm_iesteq.php', '#', NULL, 1, 'prevbra', 0, NULL, NULL, 'bg-primary', NULL, NULL, NULL),
('prevbra_21', 'prevbra_02', 'XML', 'clipboard', 'N', '.content-body', NULL, '#', NULL, 1, 'prevbra', 0, NULL, NULL, 'bg-primary', NULL, NULL, NULL),
('prevbra_22', 'prevbra_21', 'Importação', 'upload', 'C', '.content-body', 'mod/prevbra/frm_xml.php', '#', NULL, 1, 'prevbra', 0, NULL, NULL, 'bg-primary', NULL, NULL, NULL),
('prevbra_23', 'prevbra_21', 'Lotação', 'archive', 'C', '.content-body', 'mod/prevbra/frm_tb_my.php?ap=prevbra_tb_xml_lotacao&nb=Lotação', '#', NULL, 1, 'prevbra', 0, NULL, NULL, 'bg-primary', NULL, NULL, NULL),
('prevbra_24', 'prevbra_21', 'Profissional', 'archive', 'C', '.content-body', 'mod/prevbra/frm_tb_my.php?ap=prevbra_tb_xml_profissionais&nb=Profissionais', '#', NULL, 1, 'prevbra', 0, NULL, NULL, 'bg-primary', NULL, NULL, NULL),
('prevbra_25', 'prevbra_02', 'Logs exclusão', 'minus-circle', 'N', '.content-body', NULL, '#', NULL, 1, 'prevbra', 0, NULL, NULL, 'bg-primary', NULL, NULL, NULL),
('prevbra_26', 'prevbra_25', '1, 2 e 3', 'minus-square', 'C', '.content-body', 'mod/prevbra/frm_tb_csv.php?ap=ind_123', '#', NULL, 1, 'prevbra', 0, NULL, NULL, 'bg-primary', NULL, NULL, NULL),
('prevbra_27', 'prevbra_25', '4', 'minus-square', 'C', '.content-body', 'mod/prevbra/frm_tb_csv.php?ap=ind_4', '#', NULL, 1, 'prevbra', 0, NULL, NULL, 'bg-primary', NULL, NULL, NULL),
('prevbra_28', 'prevbra_25', '5', 'minus-square', 'C', '.content-body', 'mod/prevbra/frm_tb_csv.php?ap=ind_5', '#', NULL, 1, 'prevbra', 0, NULL, NULL, 'bg-primary', NULL, NULL, NULL),
('prevbra_29', 'prevbra_25', '6', 'minus-square', 'C', '.content-body', 'mod/prevbra/frm_tb_csv.php?ap=ind_6', '#', NULL, 1, 'prevbra', 0, NULL, NULL, 'bg-primary', NULL, NULL, NULL),
('prevbra_30', 'prevbra_25', '7', 'minus-square', 'C', '.content-body', 'mod/prevbra/frm_tb_csv.php?ap=ind_7', '#', NULL, 1, 'prevbra', 0, NULL, NULL, 'bg-primary', NULL, NULL, NULL),
('prevbra_32', 'prevbra_02', 'SISAB', 'aperture', 'N', '.content-body', NULL, '#', NULL, 1, 'prevbra', 0, NULL, NULL, 'bg-primary', NULL, NULL, NULL),
('prevbra_33', 'prevbra_32', 'Importação', 'upload', 'C', '.content-body', 'mod/prevbra/frm_sisab.php', '#', NULL, 1, 'prevbra', 0, NULL, NULL, 'bg-primary', NULL, NULL, NULL),
('prevbra_34', 'prevbra_32', 'Cadastros (por eq.)', 'archive', 'C', '.content-body', 'mod/prevbra/frm_tb_my.php?ap=prevbra_tb_sisab_cadastros&nb=Cadastros', '#', NULL, 1, 'prevbra', 0, NULL, NULL, 'bg-primary', NULL, NULL, NULL),
('prevbra_39', 'prevbra_32', 'Denominador (Apoio ao Cuid.)', 'archive', 'C', '.content-body', 'mod/prevbra/frm_tb_my.php?ap=prevbra_tb_sisab_denominador&nb=Denominador', '#', NULL, 1, 'prevbra', 0, NULL, NULL, 'bg-primary', NULL, NULL, NULL),
('prevbra_40', 'prevbra_09', 'Exclusão', 'x-circle', 'C', '.content-body', 'mod/prevbra/frm_exclusao.php', '#', NULL, 1, 'prevbra', 0, NULL, NULL, 'bg-primary', NULL, NULL, NULL),
('prevbra_41', 'prevbra_09', 'Limpar', 'x-circle', 'C', '.content-body', 'mod/prevbra/frm_limpa.php', '#', NULL, 1, 'prevbra', 0, NULL, NULL, 'bg-primary', NULL, NULL, NULL),
('prevbra_42', 'prevbra_09', 'Geral', 'tool', 'C', '.content-body', 'mod/prevbra/frm_cf.php', '#', NULL, 1, 'prevbra', 0, NULL, NULL, 'bg-primary', NULL, NULL, NULL);




INSERT INTO `sc_tb_modulos` (`modulo`) VALUES ('prevbra');


CREATE TABLE IF NOT EXISTS `prevbra_tb_cf_ind_123` (
  `id` varchar(11) NOT NULL,
  `ibge` varchar(7) NOT NULL,
  `dti` bigint(20) NOT NULL DEFAULT 20210101,
  `dtf` bigint(20) NOT NULL DEFAULT 20210430,
  `des` int(11) NOT NULL DEFAULT 0,
  `dum` char(2) NOT NULL DEFAULT 'A',
  `meta1` int(11) NOT NULL DEFAULT 45,
  `ponderacao1` int(11) NOT NULL DEFAULT 1,
  `meta2` int(11) NOT NULL DEFAULT 60,
  `ponderacao2` int(11) NOT NULL DEFAULT 1,
  `meta3` int(11) NOT NULL DEFAULT 60,
  `ponderacao3` int(11) NOT NULL DEFAULT 2,
  `cor1` varchar(7) NOT NULL DEFAULT '#F51010',
  `cor2` varchar(7) NOT NULL DEFAULT '#6F4DF5',
  `cor3` varchar(7) NOT NULL DEFAULT '#2AC68D',
  `icone1` varchar(100) NOT NULL DEFAULT 'fas fa-baby',
  `icone2` varchar(100) NOT NULL DEFAULT 'fas fa-flask',
  `icone3` varchar(100) NOT NULL DEFAULT 'fas fa-tooth',
  `dov` varchar(1) NOT NULL DEFAULT 'D',
  `amarelo11` float NOT NULL DEFAULT 18,
  `amarelo21` float NOT NULL DEFAULT 31.5,
  `verde11` float NOT NULL DEFAULT 31.5,
  `verde21` float NOT NULL DEFAULT 45,
  `amarelo12` float NOT NULL DEFAULT 24,
  `amarelo22` float NOT NULL DEFAULT 42,
  `verde12` float NOT NULL DEFAULT 42,
  `verde22` float NOT NULL DEFAULT 60,
  `amarelo13` float NOT NULL DEFAULT 24,
  `amarelo23` float NOT NULL DEFAULT 42,
  `verde13` float NOT NULL DEFAULT 42,
  `verde23` float NOT NULL DEFAULT 60,
  `mexc` varchar(10) NOT NULL DEFAULT '0110111111',
  `dupl_geral` int(11) NOT NULL DEFAULT 0,
  `dupl_detal` int(11) NOT NULL DEFAULT 0,
  `csv_geral` int(11) NOT NULL DEFAULT 0,
  `csv_detal` int(11) NOT NULL DEFAULT 0,
  `csv_exclu` int(11) NOT NULL DEFAULT 0,
  `origden` char(1) NOT NULL DEFAULT 'P',
  `qdad` int(11) NOT NULL DEFAULT 1,
  CONSTRAINT pk_CE primary key(id,ibge)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE IF NOT EXISTS `prevbra_tb_cf_ind_4` (
  `id` varchar(11) NOT NULL,
  `ibge` varchar(7) NOT NULL,
  `dti` bigint(20) NOT NULL DEFAULT 20210101,
  `dtf` bigint(20) NOT NULL DEFAULT 20210430,
  `des` int(11) NOT NULL DEFAULT 0,
  `meta4` int(11) NOT NULL DEFAULT 40,
  `ponderacao4` int(11) NOT NULL DEFAULT 1,
  `cor4` varchar(7) NOT NULL DEFAULT '#55D228',
  `icone4` varchar(100) NOT NULL DEFAULT 'fas fa-female',
  `amarelo1` float NOT NULL DEFAULT 16,
  `amarelo2` float NOT NULL DEFAULT 28,
  `verde1` float NOT NULL DEFAULT 28,
  `verde2` float NOT NULL DEFAULT 40,
  `mexc` varchar(10) NOT NULL DEFAULT '0110111111',
  `dupl_geral` int(11) NOT NULL DEFAULT 0,
  `dupl_detal` int(11) NOT NULL DEFAULT 0,
  `csv_geral` int(11) NOT NULL DEFAULT 0,
  `csv_detal` int(11) NOT NULL DEFAULT 0,
  `csv_exclu` int(11) NOT NULL DEFAULT 0,
  `origden` char(1) NOT NULL DEFAULT 'P',
  `qdad` int(11) NOT NULL DEFAULT 1,
  CONSTRAINT pk_CE primary key(id,ibge)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE IF NOT EXISTS `prevbra_tb_cf_ind_5` (
  `id` varchar(11) NOT NULL,
  `ibge` varchar(7) NOT NULL,
  `dti` bigint(20) NOT NULL DEFAULT 20210101,
  `dtf` bigint(20) NOT NULL DEFAULT 20210430,
  `des` int(11) NOT NULL DEFAULT 0,
  `tpb` int(11) NOT NULL DEFAULT 10,
  `meta5` int(11) NOT NULL DEFAULT 95,
  `ponderacao5` int(11) NOT NULL DEFAULT 2,
  `cor5` varchar(7) NOT NULL DEFAULT '#EFCC42',
  `icone5` varchar(100) NOT NULL DEFAULT 'fas fa-syringe',
  `tp_ind` varchar(1) NOT NULL DEFAULT 'E',
  `amarelo1` float NOT NULL DEFAULT 38,
  `amarelo2` float NOT NULL DEFAULT 66.5,
  `verde1` float NOT NULL DEFAULT 66.5,
  `verde2` float NOT NULL DEFAULT 95,
  `mexc` varchar(10) NOT NULL DEFAULT '0110111111',
  `dupl_geral` int(11) NOT NULL DEFAULT 0,
  `dupl_detal` int(11) NOT NULL DEFAULT 0,
  `csv_geral` int(11) NOT NULL DEFAULT 0,
  `csv_detal` int(11) NOT NULL DEFAULT 0,
  `csv_exclu` int(11) NOT NULL DEFAULT 0,
  `origden` char(1) NOT NULL DEFAULT 'P',
  `qdad` int(11) NOT NULL DEFAULT 1,
  CONSTRAINT pk_CE primary key(id,ibge)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE IF NOT EXISTS `prevbra_tb_cf_ind_6` (
  `id` varchar(11) NOT NULL,
  `ibge` varchar(7) NOT NULL,
  `dti` bigint(20) NOT NULL DEFAULT 20210101,
  `dtf` bigint(20) NOT NULL DEFAULT 20210430,
  `des` int(11) NOT NULL DEFAULT 0,
  `meta6` int(11) NOT NULL DEFAULT 50,
  `ponderacao6` int(11) NOT NULL DEFAULT 2,
  `cor6` varchar(7) NOT NULL DEFAULT '#EF8D42',
  `icone6` varchar(100) NOT NULL DEFAULT 'fas fa-heartbeat',
  `criterio_busca` varchar(1) NOT NULL DEFAULT 'B',
  `amarelo1` float NOT NULL DEFAULT 20,
  `amarelo2` float NOT NULL DEFAULT 35,
  `verde1` float NOT NULL DEFAULT 35,
  `verde2` float NOT NULL DEFAULT 50,
  `mexc` varchar(10) NOT NULL DEFAULT '0110111111',
  `dupl_geral` int(11) NOT NULL DEFAULT 0,
  `dupl_detal` int(11) NOT NULL DEFAULT 0,
  `csv_geral` int(11) NOT NULL DEFAULT 0,
  `csv_detal` int(11) NOT NULL DEFAULT 0,
  `csv_exclu` int(11) NOT NULL DEFAULT 0,
  `origden` char(1) NOT NULL DEFAULT 'P',
  `qdad` int(11) NOT NULL DEFAULT 1,
  CONSTRAINT pk_CE primary key(id,ibge)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE IF NOT EXISTS `prevbra_tb_cf_ind_7` (
  `id` varchar(11) NOT NULL,
  `ibge` varchar(7) NOT NULL,
  `dti` bigint(20) NOT NULL DEFAULT 20210101,
  `dtf` bigint(20) NOT NULL DEFAULT 20210430,
  `des` int(11) NOT NULL DEFAULT 0,
  `meta7` int(11) NOT NULL DEFAULT 50,
  `ponderacao7` int(11) NOT NULL DEFAULT 1,
  `cor7` varchar(7) NOT NULL DEFAULT '#7EF638',
  `icone7` varchar(100) NOT NULL DEFAULT 'fas fa-tint',
  `criterio_busca` varchar(1) NOT NULL DEFAULT 'B',
  `amarelo1` float NOT NULL DEFAULT 20,
  `amarelo2` float NOT NULL DEFAULT 35,
  `verde1` float NOT NULL DEFAULT 35,
  `verde2` float NOT NULL DEFAULT 50,
  `mexc` varchar(10) NOT NULL DEFAULT '0110111111',
  `dupl_geral` int(11) NOT NULL DEFAULT 0,
  `dupl_detal` int(11) NOT NULL DEFAULT 0,
  `csv_geral` int(11) NOT NULL DEFAULT 0,
  `csv_detal` int(11) NOT NULL DEFAULT 0,
  `csv_exclu` int(11) NOT NULL DEFAULT 0,
  `origden` char(1) NOT NULL DEFAULT 'P',
  `qdad` int(11) NOT NULL DEFAULT 1,
  CONSTRAINT pk_CE primary key(id,ibge)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE IF NOT EXISTS `prevbra_tb_exclusao` (
  `ikey` int(11) NOT NULL AUTO_INCREMENT,
  `dtinc` timestamp NOT NULL DEFAULT current_timestamp(),
  `id` varchar(11) NOT NULL,
  `ibge` varchar(7) NOT NULL,
  `indicador` int(11) NOT NULL DEFAULT 0,
  `quadrimestre` varchar(6) NOT NULL DEFAULT '0',
  `cpf` varchar(11) DEFAULT NULL,
  `cns` varchar(15) DEFAULT NULL,
  `denominador` int(11) NOT NULL DEFAULT 0,
  `numerador` int(11) NOT NULL DEFAULT 0,
  `obs` varchar(250) DEFAULT NULL,
  PRIMARY KEY (`ikey`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE IF NOT EXISTS `prevbra_tb_cf_geral` (
  `id` varchar(11) NOT NULL,
  `ibge` varchar(7) NOT NULL,
  `dtidtf` varchar(17) NOT NULL DEFAULT '0',
  `tden` int(11) NOT NULL DEFAULT 1,
  `qdad` int(11) NOT NULL DEFAULT 1,
  `qdad2` int(11) NOT NULL DEFAULT 1,
  `maps_nt` int(11) NOT NULL DEFAULT 0,
  `maps_ignorar` int(11) NOT NULL DEFAULT 1,
  CONSTRAINT pk_CE primary key(id,ibge)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE IF NOT EXISTS `prevbra_tb_dash_geral_h` (
  `id` varchar(11) NOT NULL,
  `ibge` varchar(7) NOT NULL,
  `dti` bigint(20) NOT NULL,
  `dtf` bigint(20) NOT NULL,
  `indicador` int(11) NOT NULL DEFAULT 0,
  `quadrimestre` bigint(20) NOT NULL DEFAULT 0,
  `denominador` int(11) NOT NULL DEFAULT 0,
  `denominador_i` int(11) NOT NULL DEFAULT 0,
  `numerador` int(11) NOT NULL DEFAULT 0,
  `porcentagem` float NOT NULL DEFAULT 0,
  `resultadoi` float NOT NULL DEFAULT 0,
  `meta` int(11) NOT NULL DEFAULT 0,
  `pontuacao` int(11) NOT NULL DEFAULT 0,
  `ponderacao` int(11) NOT NULL DEFAULT 0,
  `resultadop` float NOT NULL DEFAULT 0,
  `dt_geracao` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `banco` varchar(50) DEFAULT NULL,
  `versao` varchar(20) DEFAULT NULL,
  `cor1` varchar(30) DEFAULT NULL,
  `cor2` varchar(30) DEFAULT NULL,
  `icone` varchar(100) DEFAULT NULL,
  `icone_geral` varchar(100) DEFAULT NULL,
  `qden` varchar(1) NOT NULL DEFAULT 'I'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE IF NOT EXISTS `prevbra_tb_dash_ue_h` (
  `id` varchar(11) NOT NULL,
  `ibge` varchar(7) NOT NULL,
  `dti` bigint(20) NOT NULL DEFAULT 0,
  `dtf` bigint(20) NOT NULL DEFAULT 0,
  `indicador` int(11) NOT NULL DEFAULT 0,
  `quadrimestre` bigint(20) NOT NULL DEFAULT 0,
  `denominador` int(11) NOT NULL DEFAULT 0,
  `denominador_i` int(11) NOT NULL DEFAULT 0,
  `numerador` int(11) NOT NULL DEFAULT 0,
  `porcentagem` float DEFAULT 0,
  `resultadoi` float NOT NULL DEFAULT 0,
  `meta` int(11) NOT NULL DEFAULT 0,
  `pontuacao` int(11) NOT NULL DEFAULT 0,
  `ponderacao` int(11) NOT NULL DEFAULT 0,
  `resultadop` float NOT NULL DEFAULT 0,
  `dt_geracao` timestamp NOT NULL DEFAULT current_timestamp(),
  `banco` varchar(50) DEFAULT NULL,
  `versao` varchar(20) DEFAULT NULL,
  `cor1` varchar(20) DEFAULT NULL,
  `cor2` varchar(30) DEFAULT NULL,
  `icone` varchar(100) DEFAULT NULL,
  `icone_geral` varchar(100) DEFAULT NULL,
  `qden` varchar(1) NOT NULL DEFAULT 'I',
  `ine` varchar(10) DEFAULT NULL,
  `cnes` varchar(7) DEFAULT NULL,
  `tipo` varchar(1) NOT NULL,
  `nome` varchar(250) DEFAULT NULL,
  `den` int(11) NOT NULL DEFAULT 0,
  `num` int(11) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE IF NOT EXISTS `prevbra_tb_ind_gerado` (
  `idkey` int(11) PRIMARY KEY NOT NULL AUTO_INCREMENT,
  `id` varchar(11) NOT NULL,
  `ibge` varchar(7) NOT NULL,
  `indicador` int(11) NOT NULL DEFAULT 0,
  `quadrimestre` bigint(20) NOT NULL DEFAULT 0,
  `ligacao` varchar(200) NOT NULL,
  `seq` int(11) DEFAULT NULL,
  `dti` bigint(20) NOT NULL,
  `dtf` bigint(20) NOT NULL,
  `cdum` varchar(1) DEFAULT NULL,
  `cdpp` int(11) DEFAULT NULL,
  `cns` varchar(15) DEFAULT NULL,
  `cpf` varchar(11) DEFAULT NULL,
  `cns2` varchar(15) DEFAULT NULL,
  `cpf2` varchar(11) DEFAULT NULL,
  `dtNascimento` bigint(20) NOT NULL DEFAULT 0,
  `nome` varchar(250) DEFAULT NULL,
  `mae` varchar(250) DEFAULT NULL,
  `idade` varchar(10) DEFAULT '0',
  `dpp` bigint(20) DEFAULT NULL,
  `consulta1` bigint(20) DEFAULT NULL,
  `semana12` bigint(20) DEFAULT NULL,
  `cnes` varchar(7) DEFAULT NULL,
  `ine` varchar(10) DEFAULT NULL,
  `ma` varchar(10) DEFAULT NULL,
  `numConsultas` int(11) NOT NULL DEFAULT 0,
  `numConsultasOd` int(11) NOT NULL DEFAULT 0,
  `numProcs` int(11) DEFAULT 0,
  `unificada` varchar(10) DEFAULT NULL,
  `obito` varchar(22) DEFAULT NULL,
  `indicador1` int(11) NOT NULL DEFAULT 0,
  `indicador11` int(11) NOT NULL DEFAULT 0,
  `indicador12` int(11) NOT NULL DEFAULT 0,
  `indicador12d` varchar(30) DEFAULT '0:0:0:0',
  `indicador2` int(11) NOT NULL DEFAULT 0,
  `indicador21` int(11) NOT NULL DEFAULT 0,
  `indicador22` int(11) NOT NULL DEFAULT 0,
  `indicador3` int(11) NOT NULL DEFAULT 0,
  `indicador4` int(11) NOT NULL DEFAULT 0,
  `indicador5` int(11) NOT NULL DEFAULT 0,
  `indicador51` int(11) NOT NULL DEFAULT 0,
  `indicador52` int(11) NOT NULL DEFAULT 0,
  `indicador53` int(11) NOT NULL DEFAULT 0,
  `indicador6` int(11) NOT NULL DEFAULT 0,
  `indicador7` int(11) NOT NULL DEFAULT 0,
  `obs_vacina` varchar(2500) DEFAULT NULL,
  `obs` varchar(2500) DEFAULT NULL,
  `alerta_idade` varchar(250) DEFAULT NULL,
  `alerta_baixa` varchar(250) DEFAULT NULL,
  `marc_gest` varchar(10) DEFAULT '0',
  `marc_hiper` varchar(10) DEFAULT '0',
  `marc_diab` varchar(10) DEFAULT '0',
  `marc_ac` varchar(10) DEFAULT '0',
  `excluir` int(11) NOT NULL DEFAULT 0,
  `numConsSem1` int(11) NOT NULL DEFAULT 0,
  `numConsSem2` int(11) NOT NULL DEFAULT 0,
  `numProcSem1` int(11) NOT NULL DEFAULT 0,
  `numProcSem2` int(11) NOT NULL DEFAULT 0,
  `interrupcao` int(11) NOT NULL DEFAULT 0,
  `sexo` varchar(11) NOT NULL DEFAULT 'I',
  `unidade` varchar(250) DEFAULT NULL,
  `equipe` varchar(250) DEFAULT NULL,
  `dt_inter` bigint(20) NOT NULL DEFAULT 0,
  `dumc` bigint(20) NOT NULL DEFAULT 0,
  `po_comp` int(11) NOT NULL DEFAULT 0,
  `pe_comp` int(11) NOT NULL DEFAULT 0,
  `he_comp` int(11) NOT NULL DEFAULT 0,
  `dose_d3` int(11) NOT NULL DEFAULT 0,
  `baixa` int(11) NOT NULL DEFAULT 0,
  `cidadao` bigint(20) NOT NULL DEFAULT 0,
  `cidadaoc` bigint(20) NOT NULL DEFAULT 0,
  `cidadao2` bigint(20) NOT NULL DEFAULT 0,
  `cons_dti` bigint(20) NOT NULL DEFAULT 0,
  `cons_dtf` bigint(20) NOT NULL DEFAULT 0,
  `proc_dti` bigint(20) NOT NULL DEFAULT 0,
  `proc_dtf` bigint(20) NOT NULL DEFAULT 0,
  `telefone` varchar(20) DEFAULT NULL,
  `sms_status` varchar(1) NOT NULL DEFAULT 'N',
  `sms_data` bigint(20) NOT NULL DEFAULT 0,
  `latitude` DOUBLE NOT NULL DEFAULT 0,
  `longitude` DOUBLE NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE IF NOT EXISTS `prevbra_tb_ind_gerado_det` (
  `idkey` int(11) PRIMARY KEY NOT NULL AUTO_INCREMENT,
  `id` varchar(11) NOT NULL,
  `ibge` varchar(7) NOT NULL,
  `ligacao` varchar(200) NOT NULL,
  `dti` bigint(20) NOT NULL,
  `dtf` bigint(20) NOT NULL,
  `indicador` int(11) NOT NULL,
  `quadrimestre` bigint(20) NOT NULL DEFAULT 0,
  `tipo_cp` varchar(2) NOT NULL,
  `data` bigint(20) NOT NULL,
  `dum` bigint(20) DEFAULT NULL,
  `ine` varchar(10) DEFAULT NULL,
  `equipe` varchar(250) DEFAULT NULL,
  `prof_cns_1` varchar(15) DEFAULT NULL,
  `prof_n_1` varchar(250) DEFAULT NULL,
  `prof_alert_1` varchar(250) DEFAULT NULL,
  `cbo_1` varchar(10) DEFAULT NULL,
  `ocupacao_1` varchar(250) DEFAULT NULL,
  `prof_cns_2` varchar(15) DEFAULT NULL,
  `prof_n_2` varchar(250) DEFAULT NULL,
  `prof_alert_2` varchar(250) DEFAULT NULL,
  `cbo_2` varchar(10) DEFAULT NULL,
  `ocupacao_2` varchar(250) DEFAULT NULL,
  `cnes` varchar(7) DEFAULT NULL,
  `unidade` varchar(250) DEFAULT NULL,
  `cid` varchar(250) DEFAULT NULL,
  `ciap` varchar(250) DEFAULT NULL,
  `proc` varchar(250) DEFAULT NULL,
  `proc_s` varchar(250) DEFAULT NULL,
  `proc_a` varchar(250) DEFAULT NULL,
  `imuno` varchar(10) DEFAULT NULL,
  `reg_anterior` int(11) NOT NULL DEFAULT 0,
  `dose` varchar(3) NOT NULL DEFAULT '0',
  `sg_imuno` varchar(100) DEFAULT NULL,
  `no_imuno` varchar(250) DEFAULT NULL,
  `lote` varchar(200) DEFAULT NULL,
  `fabricante` varchar(200) DEFAULT NULL,
  `estado` varchar(15) DEFAULT NULL,
  `tipo` varchar(10) DEFAULT NULL,
  `gestante` int(11) DEFAULT 0,
  `tp_cons` varchar(30) DEFAULT NULL,
  `id_gestacional` int(11) DEFAULT 0,
  `cns` varchar(15) DEFAULT NULL,
  `cpf` varchar(11) DEFAULT NULL,
  `semestre` varchar(10) DEFAULT '0',
  `cidadao` bigint(20) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE IF NOT EXISTS `prevbra_tb_sisab` (
  `id` varchar(11) NOT NULL,
  `uf` varchar(2) NOT NULL,
  `ibge` varchar(7) NOT NULL,
  `municipio` varchar(200) NOT NULL,
  `numerador` int(11) NOT NULL DEFAULT 0,
  `den_inf` int(11) NOT NULL DEFAULT 0,
  `den_est` int(11) NOT NULL DEFAULT 0,
  `quadrimestre` bigint(20) NOT NULL DEFAULT 0,
  `indicador` int(11) NOT NULL DEFAULT 0,
  `pind` float NOT NULL DEFAULT 0,
  `meta` float NOT NULL DEFAULT 0,
  `pontuacao` float NOT NULL DEFAULT 0,
  `ponderacao` float NOT NULL DEFAULT 0,
  `rponderacao` float NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE IF NOT EXISTS `prevbra_tb_equipe_den_est` (
  `id` varchar(11) NOT NULL,
  `ibge` varchar(7) NOT NULL,
  `ine` varchar(10) NOT NULL,
  `den` int(11) NOT NULL DEFAULT 0,
  `quadrimestre` varchar(7) DEFAULT NULL,
  `indicador` int(11) NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE IF NOT EXISTS `prevbra_tb_sisab_cadastros` (
  `id` varchar(11) NOT NULL,
  `ibge` varchar(7) NOT NULL,
  `nome` varchar(250) NOT NULL,
  `cpf` varchar(11) NOT NULL,
  `cns` varchar(15) NOT NULL,
  `local` varchar(3) NOT NULL DEFAULT 'SCL',
  `dtn` varchar(10) NOT NULL,
  `pon` varchar(200) NOT NULL,
  `equipe` varchar(10) NOT NULL,
  `cond_avaliada` int(11) NOT NULL DEFAULT 0,
  `autorreferido` int(11) NOT NULL DEFAULT 0,
  `atend_indiv` bigint(20) NOT NULL DEFAULT 0,
  `soli_afer_cole` bigint(20) NOT NULL DEFAULT 0,
  `presente_mumerador` int(11) NOT NULL DEFAULT 0,
  `indicador` int(11) NOT NULL DEFAULT 0,
  `dum` bigint(20) NOT NULL DEFAULT 0,
  `dt1c` bigint(20) NOT NULL DEFAULT 0,
  `ig1c` bigint(20) NOT NULL DEFAULT 0,
  `qtdcons` int(11) NOT NULL DEFAULT 0,
  `dpp14` bigint(20) NOT NULL DEFAULT 0,
  `polio` bigint(20) NOT NULL DEFAULT 0,
  `penta` bigint(20) NOT NULL DEFAULT 0,
  `cenario` varchar(1) NOT NULL DEFAULT 'N',
  `sifilis` bigint(20) NOT NULL DEFAULT 0,
  `hiv` bigint(20) NOT NULL DEFAULT 0,
  `oatend` bigint(20) NOT NULL DEFAULT 0,
  `cidadao` varchar(20) NOT NULL DEFAULT '0',
  `cidadaoc` varchar(20) NOT NULL DEFAULT '0',
  `cnes` varchar(7) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE IF NOT EXISTS `prevbra_tb_sisab_denominador` (
  `id` varchar(11) NOT NULL,
  `ibge` varchar(7) NOT NULL,
  `ref` varchar(3) NOT NULL,
  `cnes` varchar(7) NOT NULL,
  `ine` varchar(10) NOT NULL,
  `nome` varchar(250) NOT NULL,
  `cpf` varchar(11) NOT NULL,
  `cns` varchar(15) NOT NULL,
  `dtnas` bigint(20) NOT NULL DEFAULT 30001231,
  `dtini` bigint(20) NOT NULL DEFAULT 30001231,
  `dtfin` bigint(20) NOT NULL DEFAULT 30001231,
  `aborto` varchar(100) DEFAULT NULL,
  `quadrimestre` bigint(20) NOT NULL DEFAULT 0,
  `local` varchar(3) NOT NULL DEFAULT 'SCL',
  `cidadao` varchar(20) NOT NULL DEFAULT '0',
  `cidadaoc` varchar(20) NOT NULL DEFAULT '0',
  `dum` bigint(20) NOT NULL DEFAULT 0,
  `dpp` bigint(20) NOT NULL DEFAULT 0,
  `con1cDoI` bigint(20) NOT NULL DEFAULT 0,
  `cidadao2` int(11) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE IF NOT EXISTS `prevbra_tb_xml_lotacao` (
  `id` varchar(11) NOT NULL,
  `ibge` varchar(7) NOT NULL,
  `cpf` varchar(11) NOT NULL,
  `cns` varchar(15) NOT NULL,
  `nome` varchar(200) NOT NULL,
  `cnes` varchar(8) NOT NULL,
  `ine` varchar(10) NOT NULL,
  `cbo` varchar(6) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE IF NOT EXISTS `prevbra_tb_xml_profissionais` (
  `id` varchar(11) NOT NULL,
  `ibge` varchar(7) NOT NULL,
  `cpf` varchar(11) NOT NULL,
  `cns` varchar(15) NOT NULL,
  `nome` varchar(200) NOT NULL,
  `dtnas` bigint(20) NOT NULL DEFAULT 30001231,
  `sexo` char(1) NOT NULL,
  `c_id` char(3) NOT NULL,
  `c_uf` char(2) NOT NULL,
  `c_registro` char(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;