✏️ 正在编辑: tabelas.sql
路径:
/srv/systems_dir/tabelas.sql
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
-- Create syntax for TABLE 'tb_acessos' CREATE TABLE `tb_acessos` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `tipo_acesso` int(2) unsigned NOT NULL, `usuario_id` int(11) NOT NULL, `ip` varchar(16) COLLATE utf8_unicode_ci NOT NULL, `datahora` datetime NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `UNIQUE` (`tipo_acesso`,`usuario_id`), KEY `datahora` (`datahora`) ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_acessos_historico' CREATE TABLE `tb_acessos_historico` ( `id` int(11) NOT NULL AUTO_INCREMENT, `tipo_acesso` int(2) NOT NULL, `usuario_id` int(11) NOT NULL, `ip` varchar(16) COLLATE utf8_unicode_ci NOT NULL, `datahora` datetime NOT NULL, PRIMARY KEY (`id`), KEY `tb_acessos_historico_tipo_acesso_index` (`tipo_acesso`), KEY `tb_acessos_historico_usuario_id_index` (`usuario_id`) ) ENGINE=InnoDB AUTO_INCREMENT=59 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_arquivos_importados' CREATE TABLE `tb_arquivos_importados` ( `id` int(11) NOT NULL AUTO_INCREMENT, `arquivo` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `data_importacao` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `excluido` tinyint(4) NOT NULL DEFAULT '0', `banco_id` int(11) NOT NULL, PRIMARY KEY (`id`), KEY `arquivo` (`arquivo`), KEY `data_importacao` (`data_importacao`), KEY `banco_id` (`banco_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_arquivos_remessa' CREATE TABLE `tb_arquivos_remessa` ( `id` int(6) unsigned NOT NULL AUTO_INCREMENT, `usuario_id` int(11) DEFAULT NULL, `banco_id` int(11) NOT NULL, `data_criacao` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `empresa_id` int(11) NOT NULL, `sequencial_debito` int(11) DEFAULT NULL, PRIMARY KEY (`id`), KEY `usuario_id` (`usuario_id`), KEY `empresa_id` (`empresa_id`), KEY `banco_id` (`banco_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_atendimento_corretor' CREATE TABLE `tb_atendimento_corretor` ( `id` int(11) NOT NULL AUTO_INCREMENT, `data_cadastro` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `corretor_id` int(11) NOT NULL, `usuario_atendimento` int(11) NOT NULL, `data_ligacao` date DEFAULT NULL, `motivo_ligacao` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL, `sinalizar_supervisor` int(11) DEFAULT '0', `descricao` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL, `data_proximo_contato` date DEFAULT NULL, `hora_proximo_contato` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, `gerente_comercial_id` int(11) DEFAULT NULL, `status_resolucao_id` int(11) NOT NULL, `excluido` tinyint(2) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `corretor_id` (`corretor_id`,`gerente_comercial_id`), KEY `usuario_atendimento` (`usuario_atendimento`), KEY `status_resolucao_id` (`status_resolucao_id`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_automatizacao' CREATE TABLE `tb_automatizacao` ( `id` int(11) NOT NULL AUTO_INCREMENT, `reprocessar_atendimentos` tinyint(2) DEFAULT '1', `relatorio_diario` tinyint(2) DEFAULT '1', `produtividade_supervisores` tinyint(2) DEFAULT '1', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_bancos' CREATE TABLE `tb_bancos` ( `id` int(11) NOT NULL AUTO_INCREMENT, `nome` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `dias_refin` int(11) NOT NULL DEFAULT '0', `ativo` tinyint(4) DEFAULT '1', `excluido` tinyint(4) NOT NULL, `codigo` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `imposto` decimal(15,2) NOT NULL DEFAULT '0.00', `obedecer_id` tinyint(4) DEFAULT '0', `recebimento_comissao_generico` tinyint(4) DEFAULT '0', `estornar_pendentes` tinyint(4) DEFAULT '0', `desativar_comissoes` tinyint(4) DEFAULT '0', `importacao_valor_contrato` tinyint(4) DEFAULT '0', `teto_producao` decimal(15,2) DEFAULT NULL, `credito_pessoal` tinyint(4) DEFAULT '0', `anti_fraude` tinyint(4) DEFAULT '0', `pagar_com_fisico` tinyint(4) DEFAULT '0', `margem` decimal(15,2) DEFAULT NULL, `notificar_atraso` tinyint(4) NOT NULL DEFAULT '0', `contrato_alfanumerico` tinyint(4) DEFAULT '0', `taxa_portabilidade` decimal(15,2) DEFAULT NULL, `permitir_contrato_autonumeracao` tinyint(1) DEFAULT '0', `comissao_por_taxa` tinyint(1) DEFAULT '0', `comissao_por_idade` tinyint(4) DEFAULT '0', `efetivar_finalizar` tinyint(1) DEFAULT '0', PRIMARY KEY (`id`), KEY `excluido` (`excluido`,`ativo`), KEY `desativar_comissoes` (`desativar_comissoes`), KEY `pagar_com_fisico` (`pagar_com_fisico`) ) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_bancos_comissoes' CREATE TABLE `tb_bancos_comissoes` ( `id` int(11) NOT NULL AUTO_INCREMENT, `banco_id` int(11) NOT NULL, `convenio_id` int(11) NOT NULL, `tabela_id` int(11) NOT NULL, `excluido` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `banco_id` (`banco_id`), KEY `convenio_id` (`convenio_id`), KEY `tabela_id` (`tabela_id`), KEY `excuido` (`excluido`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_bancos_febraban' CREATE TABLE `tb_bancos_febraban` ( `id` int(11) NOT NULL AUTO_INCREMENT, `nome` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `codigo` varchar(10) COLLATE utf8_unicode_ci NOT NULL, `taxa_transf` decimal(15,2) DEFAULT NULL, `digital` tinyint(4) DEFAULT '0', `exibir_autocontratacao` tinyint(4) DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `codigo_2` (`codigo`), UNIQUE KEY `codigo_3` (`codigo`), KEY `codigo` (`codigo`), KEY `exibir_autocontratacao` (`exibir_autocontratacao`) ) ENGINE=InnoDB AUTO_INCREMENT=435 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_bancos_metas_status' CREATE TABLE `tb_bancos_metas_status` ( `id` int(11) NOT NULL AUTO_INCREMENT, `banco_id` int(11) NOT NULL, `status_proposta` int(11) NOT NULL, `excluido` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `status_proposta` (`status_proposta`), KEY `gerente_meta_id` (`banco_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_bancos_tipos_formalizacao' CREATE TABLE `tb_bancos_tipos_formalizacao` ( `id` int(11) NOT NULL AUTO_INCREMENT, `banco_id` int(11) NOT NULL, `descricao` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `tipo_formalizacao` int(11) NOT NULL, `excluido` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `banco_id` (`banco_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_bancos_token_api' CREATE TABLE `tb_bancos_token_api` ( `id` int(11) NOT NULL AUTO_INCREMENT, `banco_id` int(11) NOT NULL, `token` text COLLATE utf8_unicode_ci, `data_expiracao` datetime DEFAULT NULL, PRIMARY KEY (`id`), KEY `tb_bancos_token_api_banco_id_index` (`banco_id`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_bancos_vinculados' CREATE TABLE `tb_bancos_vinculados` ( `id` int(11) NOT NULL AUTO_INCREMENT, `banco_id` int(11) NOT NULL, `descricao` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `excluido` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `banco_id` (`banco_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_bonificacao' CREATE TABLE `tb_bonificacao` ( `id` int(11) NOT NULL AUTO_INCREMENT, `banco_id` int(11) NOT NULL, `descricao` varchar(150) COLLATE utf8_unicode_ci NOT NULL, `frequencia` int(2) NOT NULL, `percentual` decimal(15,2) NOT NULL, `data_inicial` date NOT NULL, `data_final` date NOT NULL, `excluido` int(11) NOT NULL, PRIMARY KEY (`id`), KEY `banco_id` (`banco_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_bonificacao_convenio' CREATE TABLE `tb_bonificacao_convenio` ( `id` int(11) NOT NULL AUTO_INCREMENT, `bonificacao_id` int(11) NOT NULL, `convenio_id` int(11) NOT NULL, `excluido` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_bonus' CREATE TABLE `tb_bonus` ( `id` int(11) NOT NULL AUTO_INCREMENT, `tabela_id` int(11) NOT NULL, `convenio_id` int(11) NOT NULL, `prazo` int(11) DEFAULT NULL, `bonus` decimal(15,2) DEFAULT NULL, `data_validade` date DEFAULT NULL, `produto` int(11) DEFAULT NULL, `intervalo_parcelas_de` decimal(15,2) DEFAULT NULL, `intervalo_parcelas_a` decimal(15,2) DEFAULT NULL, `excluido` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `tabela_id` (`tabela_id`,`convenio_id`,`prazo`,`produto`,`excluido`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_bonus_percentual' CREATE TABLE `tb_bonus_percentual` ( `id` int(11) NOT NULL AUTO_INCREMENT, `bonus_id` int(11) NOT NULL, `percentual` decimal(15,2) NOT NULL, `data_inicial` date DEFAULT NULL, `data_final` date DEFAULT NULL, `excluido` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `bonus_id` (`bonus_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_bordero' CREATE TABLE `tb_bordero` ( `id` int(11) NOT NULL AUTO_INCREMENT, `corretor_id` varchar(45) COLLATE utf8_unicode_ci NOT NULL, `observacao` text COLLATE utf8_unicode_ci, `status` varchar(45) CHARACTER SET latin1 DEFAULT NULL, `num_cod_barras` varchar(45) CHARACTER SET latin1 DEFAULT NULL, `data_previa` varchar(45) CHARACTER SET latin1 DEFAULT NULL, `data_cadastro` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `anexo_bordero` varchar(255) CHARACTER SET latin1 DEFAULT NULL, `tipo` varchar(45) CHARACTER SET latin1 DEFAULT NULL, `excluido` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `num_cod_barras` (`num_cod_barras`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_callcenter_atendimentos' CREATE TABLE `tb_callcenter_atendimentos` ( `id` int(11) NOT NULL AUTO_INCREMENT, `campanha_id` int(11) DEFAULT NULL, `cliente_id` int(11) NOT NULL, `data_atendimento` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `usuario` int(11) NOT NULL, `status_atendimento` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `comentario` text COLLATE utf8_unicode_ci NOT NULL, `telefone_chamada` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `excluido` tinyint(4) NOT NULL DEFAULT '0', `ignorar` int(1) NOT NULL DEFAULT '0' COMMENT 'Ignorar como atendido por callcenter na planilha de pagamento', `tempo_atendimento` int(11) DEFAULT NULL, `corretor_id` int(11) DEFAULT '0', PRIMARY KEY (`id`), KEY `usuario` (`usuario`), KEY `excluido` (`excluido`), KEY `cliente_id` (`cliente_id`), KEY `campanha_id` (`campanha_id`), KEY `tb_callcenter_atendimentos_corretor_id_index` (`corretor_id`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_callcenter_atentimentos_resetados' CREATE TABLE `tb_callcenter_atentimentos_resetados` ( `id` int(11) NOT NULL AUTO_INCREMENT, `campanha_id` int(11) DEFAULT NULL, `campanhas` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL, `clientes_resetados` bigint(20) DEFAULT '0', `filtros_usados` text COLLATE utf8_unicode_ci, `retorno_discador` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `erro` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `automatizacao` tinyint(2) DEFAULT '0', `data_processo` datetime DEFAULT NULL, PRIMARY KEY (`id`), KEY `fk_atendimentos_resetados_camapanha` (`campanha_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_callcenter_base' CREATE TABLE `tb_callcenter_base` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `data_cadastro` timestamp NULL DEFAULT CURRENT_TIMESTAMP, `campanha_id` int(11) DEFAULT NULL, `nome` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `matricula` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `cpf` varchar(14) COLLATE utf8_unicode_ci NOT NULL, `nome_responsavel` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `cpf_responsavel` char(14) COLLATE utf8_unicode_ci DEFAULT NULL, `razao_social` char(4) COLLATE utf8_unicode_ci DEFAULT NULL, `tipo_pessoa` char(10) COLLATE utf8_unicode_ci DEFAULT 'fisica', `data_nascimento` date DEFAULT NULL, `sexo` enum('M','F') COLLATE utf8_unicode_ci DEFAULT NULL, `endereco` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `numero` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `complemento` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `bairro` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `cidade` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `uf` char(2) COLLATE utf8_unicode_ci DEFAULT NULL, `obs_endereco` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `cep` varchar(8) COLLATE utf8_unicode_ci DEFAULT NULL, `email` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `email2` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `email3` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `telefone1` varchar(14) COLLATE utf8_unicode_ci DEFAULT NULL, `telefone2` varchar(14) COLLATE utf8_unicode_ci DEFAULT NULL, `telefone3` varchar(14) COLLATE utf8_unicode_ci DEFAULT NULL, `status_atendimento` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `data_ultimo_atendimento` datetime DEFAULT NULL, `usuario_ultimo_atendimento` int(11) DEFAULT NULL, `agendado_para` date DEFAULT NULL, `hora_agendada` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, `agenda_notificada` int(1) NOT NULL DEFAULT '0', `loja_finalizar` int(11) DEFAULT NULL, `ativo` tinyint(4) NOT NULL DEFAULT '0', `margem_livre` decimal(15,2) DEFAULT NULL, `comentario` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `margem_cartao` decimal(15,2) DEFAULT NULL, `valor_saque` decimal(15,2) DEFAULT NULL, `senha_contra_cheque` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `secretaria` varchar(150) CHARACTER SET utf8 DEFAULT NULL, `orgao_id` int(11) DEFAULT NULL, `sigla_upg` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL, `orgao` varchar(150) CHARACTER SET utf8 DEFAULT NULL, `cargo` varchar(150) COLLATE utf8_unicode_ci DEFAULT NULL, `secretaria_id` int(11) DEFAULT NULL, `data_ultimo_reset` date DEFAULT NULL, `usuario_carteirizacao` int(11) DEFAULT NULL, `valor_beneficio` decimal(15,2) DEFAULT '0.00', `especie` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `obito` tinyint(4) DEFAULT '0', `rep_legal` tinyint(4) DEFAULT '0', `data_higienizacao` date DEFAULT NULL, `data_higienizacao_telefones` date DEFAULT NULL, `carteira_corretor` int(11) DEFAULT NULL, `telefone_chamada` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `rg` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `nome_mae` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `nome_pai` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `base_legal_id` int(11) DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `cpf` (`cpf`), KEY `campanha_id` (`campanha_id`), KEY `status_atendimento` (`status_atendimento`), KEY `usuario_ultimo_atendimento` (`usuario_ultimo_atendimento`), KEY `agendado_para` (`agendado_para`), KEY `loja_finalizar` (`loja_finalizar`), KEY `ativo` (`ativo`), KEY `hora_agendado` (`hora_agendada`), KEY `orgao` (`orgao`), KEY `usuario_carteirizacao` (`usuario_carteirizacao`), KEY `status_atendimento_2` (`status_atendimento`), KEY `campanha_id_2` (`campanha_id`,`status_atendimento`,`data_ultimo_atendimento`,`usuario_ultimo_atendimento`,`ativo`,`usuario_carteirizacao`), KEY `status_atendimento_3` (`status_atendimento`,`usuario_ultimo_atendimento`,`ativo`), KEY `status_atendimento_4` (`status_atendimento`,`usuario_ultimo_atendimento`,`agendado_para`,`hora_agendada`), KEY `carteira_corretor` (`carteira_corretor`), KEY `data_higienizacao_telefones` (`data_higienizacao_telefones`) ) ENGINE=InnoDB AUTO_INCREMENT=1642 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_callcenter_beneficios' CREATE TABLE `tb_callcenter_beneficios` ( `id` int(11) NOT NULL AUTO_INCREMENT, `cpf_cliente` varchar(14) COLLATE utf8_unicode_ci NOT NULL, `beneficio` varchar(20) COLLATE utf8_unicode_ci NOT NULL, `margem_livre` decimal(15,2) DEFAULT NULL, `margem_cartao` decimal(15,2) DEFAULT '0.00', `margem_cartao_rmc` decimal(15,2) DEFAULT '0.00', `saque_complementar` decimal(15,2) DEFAULT '0.00', `margem_bens_duraveis` decimal(15,2) DEFAULT '0.00', `mr` decimal(15,2) DEFAULT '0.00', `situacao` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `banco_pagto` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `agencia_pagto` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `conta_pagto` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `orgao_pagador` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `tipo_pagto` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `data_consulta` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `origem` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL, `competencia` varchar(7) COLLATE utf8_unicode_ci DEFAULT NULL, `especie` int(10) unsigned DEFAULT NULL, `detalhamento` varchar(255) COLLATE utf8_unicode_ci DEFAULT '', `cessado` tinyint(4) DEFAULT '0', `dib` date DEFAULT NULL COMMENT 'data de inicio do beneficio', `bloq_emp` tinyint(4) DEFAULT '0', `senha_contra_cheque` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `limite_cartao` decimal(15,2) DEFAULT '0.00', `permite_saque_complementar` tinyint(1) DEFAULT '0', `obs` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `parcela_suspensa` tinyint(1) DEFAULT NULL, `base_cliente_id` int(11) DEFAULT NULL, `extrato_creditos` varchar(255) COLLATE utf8_unicode_ci DEFAULT '', PRIMARY KEY (`id`), KEY `cpf_cliente` (`cpf_cliente`), KEY `index3` (`beneficio`,`cpf_cliente`), KEY `base_cliente_id` (`base_cliente_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_callcenter_blacklist' CREATE TABLE `tb_callcenter_blacklist` ( `id` int(11) NOT NULL AUTO_INCREMENT, `telefone` varchar(15) NOT NULL, `cpf` varchar(14) DEFAULT NULL, `banco` varchar(100) DEFAULT NULL, `excluido` tinyint(1) DEFAULT '0', PRIMARY KEY (`id`), KEY `excluido` (`excluido`), KEY `telefone` (`telefone`), KEY `cpf` (`cpf`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- Create syntax for TABLE 'tb_callcenter_campanha_operadores' CREATE TABLE `tb_callcenter_campanha_operadores` ( `id` int(11) NOT NULL AUTO_INCREMENT, `campanha_id` int(11) NOT NULL, `operador_id` int(11) NOT NULL, `excluido` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `campanha_id` (`campanha_id`), KEY `operador_id` (`operador_id`), KEY `excluido` (`excluido`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_callcenter_campanha_supervisores' CREATE TABLE `tb_callcenter_campanha_supervisores` ( `id` int(11) NOT NULL AUTO_INCREMENT, `supervisor_id` int(11) NOT NULL, `campanha_id` int(11) NOT NULL, `excluido` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `excluido` (`excluido`), KEY `supervisor_id` (`supervisor_id`), KEY `campanha_id` (`campanha_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_callcenter_campanhas' CREATE TABLE `tb_callcenter_campanhas` ( `id` int(11) NOT NULL AUTO_INCREMENT, `nome` varchar(50) COLLATE utf8_unicode_ci NOT NULL, `codigo` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `data_inicial` date DEFAULT NULL, `data_final` date DEFAULT NULL, `situacao` varchar(20) COLLATE utf8_unicode_ci NOT NULL, `carteirizar` tinyint(4) NOT NULL DEFAULT '0', `escolher_cliente` tinyint(4) NOT NULL DEFAULT '0', `descricao` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `excluido` tinyint(4) NOT NULL DEFAULT '0', `idade_maxima` tinyint(3) DEFAULT NULL, `idade_minima` tinyint(3) DEFAULT NULL, `codigo_entidade` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `status_discador` tinyint(4) DEFAULT NULL, `ultima_higienizacao` date DEFAULT NULL, `qtd_higienizada` int(11) DEFAULT '0', `discador_ultima_chamada` datetime DEFAULT NULL, `corretor_id` int(11) DEFAULT '0', `codigo_promotora` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `nome` (`nome`,`situacao`), KEY `excluido` (`excluido`), KEY `escolher_cliente` (`escolher_cliente`), KEY `campanhas_alocadas` (`data_inicial`,`data_final`,`situacao`,`excluido`), KEY `corretor_id` (`corretor_id`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_callcenter_emprestimos_clientes' CREATE TABLE `tb_callcenter_emprestimos_clientes` ( `id` int(11) NOT NULL AUTO_INCREMENT, `tipo` varchar(50) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'EMPRESTIMO', `situacao` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `cpf_cliente` varchar(14) COLLATE utf8_unicode_ci NOT NULL, `base_cliente_id` int(11) DEFAULT '0', `beneficio` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `banco` varchar(50) COLLATE utf8_unicode_ci NOT NULL, `qtd_parcelas` int(11) DEFAULT NULL, `valor_parcela` decimal(15,2) DEFAULT NULL, `quitacao` decimal(15,2) DEFAULT NULL, `mes` varchar(2) COLLATE utf8_unicode_ci DEFAULT NULL, `ano` varchar(4) COLLATE utf8_unicode_ci DEFAULT NULL, `parcelas_pagas` int(11) DEFAULT NULL, `parcelas_abertas` int(11) DEFAULT NULL, `numero_contrato` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `numero_banco` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `tipo_operacao` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `margem_livre` decimal(15,2) DEFAULT NULL, `valor_atual_beneficio` decimal(15,2) DEFAULT NULL, `banco_recebe_beneficio` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `inicio_contrato` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `termino_contrato` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `valor_emprestimo` decimal(15,2) DEFAULT NULL, `data_inclusao` date DEFAULT NULL COMMENT 'data de averbação', `emp_bloq` tinyint(4) DEFAULT '0', `taxa` decimal(15,3) DEFAULT NULL, `data_quitacao` date DEFAULT NULL, `saldo` decimal(15,2) DEFAULT NULL, PRIMARY KEY (`id`), KEY `cliente_id` (`cpf_cliente`), KEY `tipo` (`tipo`), KEY `numero_contrato` (`numero_contrato`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='armazena os emprestimos dos clientes em outros bancos'; -- Create syntax for TABLE 'tb_callcenter_enderecos' CREATE TABLE `tb_callcenter_enderecos` ( `id` int(11) NOT NULL AUTO_INCREMENT, `cpf_cliente` varchar(15) COLLATE utf8_unicode_ci NOT NULL, `endereco` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `numero` varchar(20) COLLATE utf8_unicode_ci NOT NULL, `complemento` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `bairro` varchar(50) COLLATE utf8_unicode_ci NOT NULL, `cidade` varchar(50) COLLATE utf8_unicode_ci NOT NULL, `uf` char(2) COLLATE utf8_unicode_ci NOT NULL, `obs_endereco` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `cep` varchar(8) COLLATE utf8_unicode_ci NOT NULL, `excluido` tinyint(2) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `cpf_cliente` (`cpf_cliente`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_callcenter_estrategia_reprocessamento' CREATE TABLE `tb_callcenter_estrategia_reprocessamento` ( `id` int(11) NOT NULL AUTO_INCREMENT, `campanha_id` int(11) NOT NULL, `status_atendimento` text COLLATE utf8_unicode_ci, `status_discador` text COLLATE utf8_unicode_ci, `valor_parcela_de` decimal(15,2) DEFAULT NULL, `valor_parcela_a` decimal(15,2) DEFAULT NULL, `margem_consignado_de` decimal(15,2) DEFAULT NULL, `margem_consignado_a` decimal(15,2) DEFAULT NULL, `margem_cartao_de` decimal(15,2) DEFAULT NULL, `margem_cartao_a` decimal(15,2) DEFAULT NULL, `margem_bens_duraveis_de` decimal(15,2) DEFAULT NULL, `margem_bens_duraveis_a` decimal(15,2) DEFAULT NULL, `telefone` tinyint(2) DEFAULT NULL, `ativo` tinyint(2) DEFAULT NULL, `usuario_carteirizacao` int(11) DEFAULT NULL, `uf` varchar(2) COLLATE utf8_unicode_ci DEFAULT NULL, `cidade` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL, `data_final_atendimento` date DEFAULT NULL, `validar_idade_de` int(3) DEFAULT NULL, `validar_idade_a` int(3) DEFAULT NULL, `data_higienizacao_de` date DEFAULT NULL, `data_higienizacao_a` date DEFAULT NULL, `retirar_carteirizacao` tinyint(2) DEFAULT NULL, `opcao_ura_reversa` varchar(2) COLLATE utf8_unicode_ci DEFAULT NULL, `percentual_campanha` decimal(5,2) DEFAULT '90.00', `numero_reprocessamentos` int(3) DEFAULT '20', `enviar_discador` tinyint(2) DEFAULT '0', `automatizar` tinyint(2) DEFAULT '0', PRIMARY KEY (`id`), KEY `fk_estrategia_campanha` (`campanha_id`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_callcenter_fgts' CREATE TABLE `tb_callcenter_fgts` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `base_id` int(11) NOT NULL, `data_cadastro` timestamp NULL DEFAULT CURRENT_TIMESTAMP, `periodo` int(11) DEFAULT NULL, `data_repasse` date DEFAULT NULL, `valor` decimal(15,2) DEFAULT '0.00', `codigo_erro` int(11) DEFAULT NULL, `descricao_erro` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `origem_consulta` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `base_id` (`base_id`), KEY `valor` (`valor`), KEY `descricao_erro` (`descricao_erro`) ) ENGINE=InnoDB AUTO_INCREMENT=1640 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_callcenter_gravacoes' CREATE TABLE `tb_callcenter_gravacoes` ( `id` int(11) NOT NULL AUTO_INCREMENT, `cliente_id` int(11) NOT NULL, `data_cadastro` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `origem` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, `telefone` varchar(14) COLLATE utf8_unicode_ci DEFAULT NULL, `ramal` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `data` datetime DEFAULT NULL, `arquivo` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `excluido` tinyint(2) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_callcenter_mensagens' CREATE TABLE `tb_callcenter_mensagens` ( `id` int(11) NOT NULL AUTO_INCREMENT, `assunto` varchar(300) COLLATE utf8_unicode_ci NOT NULL, `mensagem` text COLLATE utf8_unicode_ci, `data_cadastro` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `tipo` varchar(200) COLLATE utf8_unicode_ci NOT NULL, `excluido` int(10) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `assunto` (`assunto`(255),`tipo`,`excluido`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_callcenter_mensagens_historicos' CREATE TABLE `tb_callcenter_mensagens_historicos` ( `id` int(11) NOT NULL AUTO_INCREMENT, `usuario` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `campanha_id` int(11) NOT NULL, `base_id` int(11) NOT NULL, `mensagem_id` int(11) NOT NULL, `tipo` varchar(5) COLLATE utf8_unicode_ci NOT NULL, `retorno` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `data_envio` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `fone` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL, `excluido` int(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `base_id` (`base_id`,`mensagem_id`,`excluido`), KEY `tipo` (`tipo`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_callcenter_mensagens_respostas' CREATE TABLE `tb_callcenter_mensagens_respostas` ( `id` int(11) NOT NULL, `mensagem_id` int(11) NOT NULL, `contato_id` int(11) NOT NULL, `data_hora_resposta` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `resposta` varchar(160) DEFAULT NULL, `celular` varchar(15) NOT NULL, `short_code` varchar(30) NOT NULL, `excluido` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='recebe as respostas do sms enviados'; -- Create syntax for TABLE 'tb_callcenter_modelo_atendimento' CREATE TABLE `tb_callcenter_modelo_atendimento` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `descricao` varchar(60) COLLATE utf8_unicode_ci NOT NULL, `texto` longtext COLLATE utf8_unicode_ci NOT NULL, `excluido` tinyint(1) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_callcenter_motivo_pausa' CREATE TABLE `tb_callcenter_motivo_pausa` ( `id` int(11) NOT NULL AUTO_INCREMENT, `descricao` varchar(255) NOT NULL, `pausa_yuppie` tinyint(1) DEFAULT NULL, `pausa_discador` tinyint(1) DEFAULT NULL, `tempo_limite_pausa` smallint(1) DEFAULT NULL, `tolerancia_pausa` smallint(1) DEFAULT NULL, `logout_discador` int(11) NOT NULL DEFAULT '0', `excluido` tinyint(1) DEFAULT '0', PRIMARY KEY (`id`), KEY `pausa_yuppie` (`pausa_yuppie`), KEY `pausa_discador` (`pausa_discador`), KEY `excluido` (`excluido`), KEY `tb_callcenter_motivo_pausa_logout_discador_index` (`logout_discador`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- Create syntax for TABLE 'tb_callcenter_pausas_operadores' CREATE TABLE `tb_callcenter_pausas_operadores` ( `id` int(11) NOT NULL AUTO_INCREMENT, `operador` varchar(150) COLLATE utf8_unicode_ci NOT NULL, `data_hora_acao` datetime DEFAULT CURRENT_TIMESTAMP, `acao` varchar(50) COLLATE utf8_unicode_ci NOT NULL, `motivo_acao` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `pausa_manual` tinyint(2) DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `tb_callcenter_pausas_operadores_id_uindex` (`id`), KEY `pausa_manual` (`pausa_manual`), KEY `operador` (`operador`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_callcenter_pausas_programadas' CREATE TABLE `tb_callcenter_pausas_programadas` ( `id` int(11) NOT NULL AUTO_INCREMENT, `usuario_id` int(11) NOT NULL, `hora_pausa` int(11) NOT NULL, `motivo_id` int(11) NOT NULL, `excluido` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `callcenter_pausas_programadas_callcenter_motivo_pausa_id_fk` (`motivo_id`), KEY `callcenter_pausas_programadas_usuarios_id_fk` (`usuario_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_callcenter_propostas' CREATE TABLE `tb_callcenter_propostas` ( `id` int(11) NOT NULL AUTO_INCREMENT, `cliente_id` int(11) NOT NULL, `campanha_id` int(11) NOT NULL, `corretor_id` int(11) NOT NULL, `tabela_id` int(11) NOT NULL, `convenio_id` int(11) NOT NULL, `banco_id` int(11) NOT NULL, `prazo` int(11) DEFAULT NULL, `data_emissao` date NOT NULL, `produto` int(11) DEFAULT NULL, `numero_beneficio` int(11) DEFAULT NULL, `valor_bruto` decimal(15,2) DEFAULT NULL, `valor_liquido` decimal(15,2) DEFAULT NULL, `valor_parcela` decimal(15,2) DEFAULT NULL, `banco_beneficiado` int(11) DEFAULT NULL, `agencia_beneficiado` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `conta_beneficiado` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `operacao_beneficiado` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `tipo` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL, `excluido` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `excluido` (`excluido`), KEY `cliente_id` (`cliente_id`), KEY `corretor_id` (`corretor_id`), KEY `tabela_id` (`tabela_id`), KEY `banco_id` (`banco_id`), KEY `campanha_id` (`campanha_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_callcenter_relatorio_ura' CREATE TABLE `tb_callcenter_relatorio_ura` ( `id` int(11) NOT NULL AUTO_INCREMENT, `data_hora` timestamp NULL DEFAULT NULL, `numero` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `opcao` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `campanha_id` int(11) DEFAULT NULL, `cliente_id` int(11) DEFAULT NULL, `fone` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `campanha_id` (`campanha_id`), KEY `cliente_id` (`cliente_id`), KEY `data_hora` (`data_hora`), KEY `fone` (`fone`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_callcenter_status' CREATE TABLE `tb_callcenter_status` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `descricao` varchar(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `codigo` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `desativar_cliente_callcenter` tinyint(4) DEFAULT '0', `bloquear` tinyint(4) DEFAULT '0', `tipo_tabulacao` enum('Positiva','Negativa') COLLATE utf8_unicode_ci DEFAULT 'Positiva', `excluido` tinyint(4) DEFAULT '0', `negocio_fechado` tinyint(1) NOT NULL DEFAULT '0', `exibir_oportunidades` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `excluido` (`excluido`) ) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_callcenter_telefones' CREATE TABLE `tb_callcenter_telefones` ( `id` int(11) NOT NULL AUTO_INCREMENT, `cliente_id` int(11) NOT NULL, `fone` varchar(15) COLLATE utf8_unicode_ci NOT NULL, `cpf_cliente` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL, `origem` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `nao_perturbe` tinyint(4) NOT NULL DEFAULT '0', `obs` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `discador_status` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `discador_chamada_id` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `discador_descartar` tinyint(1) NOT NULL DEFAULT '0', `whatsapp` tinyint(4) DEFAULT '0', `discador_tabulacao_pendente` tinyint(1) NOT NULL DEFAULT '0', `opcao_ura_reversa` int(11) DEFAULT NULL, `excluido` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `excluido` (`excluido`), KEY `cliente_id` (`cliente_id`), KEY `nao_perturbe` (`nao_perturbe`), KEY `discador_chamada_id` (`discador_chamada_id`), KEY `opcao_ura_reversa` (`opcao_ura_reversa`), KEY `fone` (`fone`), KEY `discador_status` (`discador_status`) ) ENGINE=InnoDB AUTO_INCREMENT=1673 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_campanha_faixa_valores' CREATE TABLE `tb_campanha_faixa_valores` ( `id` int(11) NOT NULL AUTO_INCREMENT, `campanha_id` int(11) NOT NULL, `valor_inicial` decimal(15,2) NOT NULL, `valor_final` decimal(15,2) NOT NULL, `nome` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `excluido` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_campanhas' CREATE TABLE `tb_campanhas` ( `id` int(11) NOT NULL AUTO_INCREMENT, `descricao` varchar(255) CHARACTER SET latin1 NOT NULL, `data_inicial` date NOT NULL, `data_final` date NOT NULL, `valor_ponto` decimal(15,2) NOT NULL, `prazo_resgate` int(11) DEFAULT '0', `excluido` tinyint(4) NOT NULL DEFAULT '0', `producao_media` decimal(15,2) NOT NULL, `protocolo_fisico` tinyint(4) NOT NULL DEFAULT '0', `frequencia_resgate` int(11) DEFAULT NULL, `acrescimo_ultimo_resgate` int(11) DEFAULT NULL, `periodo_sem_producao` int(11) DEFAULT NULL, `regras` text CHARACTER SET latin1, `anexo` varchar(255) CHARACTER SET latin1 DEFAULT NULL, PRIMARY KEY (`id`), KEY `data_inicial` (`data_inicial`,`data_final`,`prazo_resgate`,`excluido`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_campanhas_convenios' CREATE TABLE `tb_campanhas_convenios` ( `id` int(11) NOT NULL AUTO_INCREMENT, `campanha_id` int(11) NOT NULL, `convenio_id` int(11) NOT NULL, `excluido` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_campanhas_resgates' CREATE TABLE `tb_campanhas_resgates` ( `id` int(11) NOT NULL AUTO_INCREMENT, `corretor_id` int(11) NOT NULL, `campanha_id` int(11) NOT NULL, `data_resgate` date NOT NULL, `valor_resgate` decimal(15,2) NOT NULL, `excluido` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `excluido` (`excluido`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_campanhas_status' CREATE TABLE `tb_campanhas_status` ( `id` int(11) NOT NULL AUTO_INCREMENT, `campanha_id` int(11) NOT NULL, `status_id` int(11) NOT NULL, `excluido` tinyint(4) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_campanhas_tabelas' CREATE TABLE `tb_campanhas_tabelas` ( `id` int(11) NOT NULL AUTO_INCREMENT, `campanha_id` int(11) NOT NULL, `tabela_id` int(11) NOT NULL, `excluido` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_categorias' CREATE TABLE `tb_categorias` ( `id` int(11) NOT NULL AUTO_INCREMENT, `nome` varchar(100) CHARACTER SET latin1 NOT NULL, `categoria_pai` int(11) NOT NULL DEFAULT '0', `excluido` tinyint(4) NOT NULL, `extra_id` int(11) DEFAULT NULL, `categoria_dre` varchar(25) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `excluido` (`excluido`), KEY `categoria_pai` (`categoria_pai`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_chamados' CREATE TABLE `tb_chamados` ( `id` int(11) NOT NULL AUTO_INCREMENT, `corretor_id` int(11) NOT NULL, `data_cadastro` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `usuario_abertura` int(11) DEFAULT NULL, `assunto` int(11) NOT NULL, `descricao` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `status` int(11) DEFAULT NULL, `finalizado` tinyint(4) DEFAULT '0', `data_finalizacao` timestamp NULL DEFAULT NULL, `usuario_finalizacao` int(11) DEFAULT NULL, `numero_certificado` varchar(80) COLLATE utf8_unicode_ci DEFAULT NULL, `anexo` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `validar_anexo` tinyint(2) DEFAULT '0', `solicitacao_pac_id` int(11) DEFAULT NULL, `codigo_rastreamento` varchar(140) COLLATE utf8_unicode_ci DEFAULT NULL, `usuario_normal` tinyint(4) DEFAULT '0', `usuario_digital` tinyint(4) DEFAULT '0', `excluido` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `corretor_id` (`corretor_id`), KEY `usuario_abertura` (`usuario_abertura`), KEY `solicitacao_pac_id` (`solicitacao_pac_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_chamados_interacoes' CREATE TABLE `tb_chamados_interacoes` ( `id` int(11) NOT NULL AUTO_INCREMENT, `chamado_id` int(11) NOT NULL, `usuario_id` int(11) DEFAULT NULL, `comentario` text COLLATE utf8_unicode_ci NOT NULL, `data_cadastro` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `anexo` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `validar_anexo` tinyint(2) DEFAULT '0', `excluido` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_chamados_solicitacoes' CREATE TABLE `tb_chamados_solicitacoes` ( `id` int(11) NOT NULL AUTO_INCREMENT, `chamado_id` int(11) NOT NULL, `banco_id` int(11) NOT NULL, `codigo_usuario` int(11) DEFAULT NULL, `tipo_solicitacao` varchar(20) COLLATE utf8_unicode_ci DEFAULT '0', `validado` tinyint(2) NOT NULL DEFAULT '0', `nome_completo` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `login` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, `cpf` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, `rg` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, `data_nascimento` date DEFAULT NULL, `nome_mae` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `celular` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, `email` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `parametrizacao` varchar(2) COLLATE utf8_unicode_ci DEFAULT NULL, `excluido` tinyint(2) NOT NULL DEFAULT '0', `numero_proposta` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, `nome_pai` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `dt_expedicao_documento` date NOT NULL, `nome_loja` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `cidade` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `uf` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `numero_certificado` varchar(50) COLLATE utf8_unicode_ci NOT NULL, `endereco` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `cep` varchar(8) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `banco_id` (`banco_id`,`codigo_usuario`), KEY `chamado_id` (`chamado_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_chatbot_log' CREATE TABLE `tb_chatbot_log` ( `id` int(11) NOT NULL AUTO_INCREMENT, `usuario_id` int(11) NOT NULL, `proposta` varchar(45) CHARACTER SET latin1 NOT NULL, `banco` varchar(45) CHARACTER SET latin1 NOT NULL, `servico` varchar(45) CHARACTER SET latin1 NOT NULL, `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `excluido` tinyint(2) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_cidades' CREATE TABLE `tb_cidades` ( `id` int(11) NOT NULL AUTO_INCREMENT, `uf` varchar(255) DEFAULT NULL, `nome` varchar(255) NOT NULL, `parent_id` int(11) DEFAULT NULL, `excluido` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=5565 DEFAULT CHARSET=utf8; -- Create syntax for TABLE 'tb_clientes' CREATE TABLE `tb_clientes` ( `id` int(11) NOT NULL AUTO_INCREMENT, `empresa_id` int(11) NOT NULL, `data_cadastro` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `nome` varchar(100) CHARACTER SET latin1 NOT NULL, `numero_dependentes` int(11) DEFAULT NULL, `compoe_renda` tinyint(2) DEFAULT NULL, `tipo_moradia` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `profissao` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL, `anos_servicos` varchar(20) CHARACTER SET latin1 DEFAULT NULL, `meses_servicos` varchar(20) CHARACTER SET latin1 DEFAULT NULL, `tipo_comprovante` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `orgao_pagador` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `numero_beneficio` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `empresa_beneficiado` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `cpf` varchar(14) CHARACTER SET latin1 NOT NULL, `rg` varchar(20) CHARACTER SET latin1 DEFAULT NULL, `orgao_expedidor` varchar(20) CHARACTER SET latin1 DEFAULT NULL, `uf_expedidor` char(2) CHARACTER SET latin1 DEFAULT NULL, `data_expedicao` date DEFAULT NULL, `data_nascimento` date DEFAULT NULL, `nome_pai` varchar(100) CHARACTER SET latin1 DEFAULT NULL, `nome_mae` varchar(100) CHARACTER SET latin1 DEFAULT NULL, `estado_civil` varchar(20) CHARACTER SET latin1 DEFAULT NULL, `sexo` char(1) CHARACTER SET latin1 DEFAULT NULL, `conjuge` varchar(100) CHARACTER SET latin1 DEFAULT NULL, `endereco` varchar(255) CHARACTER SET latin1 DEFAULT NULL, `complemento` varchar(255) CHARACTER SET latin1 DEFAULT NULL, `bairro` varchar(100) CHARACTER SET latin1 DEFAULT NULL, `cidade` varchar(100) CHARACTER SET latin1 DEFAULT NULL, `uf` char(2) CHARACTER SET latin1 DEFAULT NULL, `cep` varchar(8) CHARACTER SET latin1 DEFAULT NULL, `email` varchar(100) CHARACTER SET latin1 DEFAULT NULL, `celular` varchar(15) CHARACTER SET latin1 DEFAULT NULL, `fax` varchar(15) CHARACTER SET latin1 DEFAULT NULL, `fone` varchar(15) CHARACTER SET latin1 DEFAULT NULL, `telefone_comercial` varchar(15) CHARACTER SET latin1 DEFAULT NULL, `obs` text CHARACTER SET latin1, `naturalidade` varchar(20) CHARACTER SET latin1 DEFAULT NULL, `tipo_registro` tinyint(4) NOT NULL DEFAULT '1', `senha_contracheque` varchar(20) CHARACTER SET latin1 DEFAULT NULL, `matricula` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `orgao` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `renda` decimal(15,2) DEFAULT NULL, `anexo_cpf` varchar(255) CHARACTER SET latin1 DEFAULT NULL, `anexo_rg` varchar(255) CHARACTER SET latin1 DEFAULT NULL, `anexo_contra_cheque` varchar(255) CHARACTER SET latin1 DEFAULT NULL, `excluido` tinyint(4) NOT NULL, PRIMARY KEY (`id`), KEY `excluido` (`excluido`), KEY `empresa_id` (`empresa_id`), KEY `cpf` (`cpf`) ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_comissionamento' CREATE TABLE `tb_comissionamento` ( `id` int(11) NOT NULL AUTO_INCREMENT, `banco_id` int(11) NOT NULL, `empresa_id` int(11) DEFAULT NULL, `tabela_id` int(11) NOT NULL, `convenio_id` int(11) NOT NULL, `produto` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `tipo_produto` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `prazo` int(11) NOT NULL DEFAULT '0', `prazo_de` int(11) NOT NULL DEFAULT '0', `prazo_a` int(11) NOT NULL DEFAULT '0', `valor_de` decimal(15,2) NOT NULL DEFAULT '0.00', `valor_a` decimal(15,2) NOT NULL DEFAULT '0.00', `base_comissao_empresa` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `valor_fixo` decimal(15,2) DEFAULT NULL, `validar_faixa` tinyint(4) DEFAULT '0', `desativado` tinyint(4) DEFAULT '0', `taxa_contrato_de` decimal(15,4) DEFAULT '0.0000', `taxa_contrato_a` decimal(15,4) DEFAULT '0.0000', `idade_inicial` int(11) DEFAULT NULL, `idade_final` int(11) DEFAULT NULL, `excluido` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `empresa_id` (`empresa_id`,`prazo`), KEY `produto` (`produto`), KEY `excluido` (`excluido`), KEY `banco_id` (`banco_id`), KEY `convenio_id` (`convenio_id`), KEY `tabela_id` (`tabela_id`), KEY `validar_faixa` (`validar_faixa`) USING BTREE, KEY `tipo_produto` (`tipo_produto`) USING BTREE, KEY `valor_de` (`valor_de`) USING BTREE, KEY `valor_a` (`valor_a`) USING BTREE, KEY `taxa_contrato_de` (`taxa_contrato_de`), KEY `taxa_contrato_a` (`taxa_contrato_a`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_comissionamento_corretor' CREATE TABLE `tb_comissionamento_corretor` ( `id` int(11) NOT NULL AUTO_INCREMENT, `banco_id` int(11) NOT NULL, `corretor_id` int(11) NOT NULL, `tabela_id` int(11) DEFAULT NULL, `convenio_id` int(11) NOT NULL, `produto` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `tipo_produto` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `prazo` int(11) NOT NULL DEFAULT '0', `prazo_de` int(11) NOT NULL DEFAULT '0', `prazo_a` int(11) NOT NULL DEFAULT '0', `valor_de` decimal(15,2) NOT NULL DEFAULT '0.00', `valor_a` decimal(15,2) NOT NULL DEFAULT '0.00', `taxa_contrato_de` decimal(15,4) DEFAULT '0.0000', `taxa_contrato_a` decimal(15,4) DEFAULT '0.0000', `idade_inicial` int(11) DEFAULT NULL, `idade_final` int(11) DEFAULT NULL, `base_comissao` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `valor_fixo` decimal(15,2) DEFAULT NULL, `validar_faixa` tinyint(4) DEFAULT '0', `tipo` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `desativado` tinyint(4) DEFAULT '0', `excluido` tinyint(4) NOT NULL DEFAULT '0', `incidir_sobre` int(11) DEFAULT '0', PRIMARY KEY (`id`), KEY `corretor_id` (`corretor_id`,`prazo`), KEY `produto` (`produto`), KEY `excluido` (`excluido`), KEY `banco_id` (`banco_id`), KEY `convenio_id` (`convenio_id`), KEY `tabela_id` (`tabela_id`), KEY `prazo_de` (`prazo_de`), KEY `prazo_a` (`prazo_a`), KEY `valor_de` (`valor_de`), KEY `valor_a` (`valor_a`), KEY `taxa_contrato_de` (`taxa_contrato_de`), KEY `taxa_contrato_a` (`taxa_contrato_a`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_comissionamento_corretor_percentual' CREATE TABLE `tb_comissionamento_corretor_percentual` ( `id` int(11) NOT NULL AUTO_INCREMENT, `comissionamento_id` int(11) NOT NULL, `data_inicial` date NOT NULL, `data_final` date DEFAULT NULL, `data_base` enum('E','L') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'E', `comissao` decimal(15,2) NOT NULL, `bonus` decimal(15,2) DEFAULT NULL, `base_comissao_valor` varchar(45) COLLATE utf8_unicode_ci NOT NULL, `base_comissao_adiantamento` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, `base_comissao_diferimento` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, `base_comissao_bonus` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, `data_cadastro` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `excluido` tinyint(4) NOT NULL, `diferimento` decimal(15,2) DEFAULT NULL, PRIMARY KEY (`id`), KEY `comissionamento_id` (`comissionamento_id`), KEY `index1` (`data_inicial`,`data_final`,`excluido`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_comissionamento_grupo' CREATE TABLE `tb_comissionamento_grupo` ( `id` int(11) NOT NULL AUTO_INCREMENT, `banco_id` int(11) NOT NULL, `grupo_id` int(11) NOT NULL, `tabela_id` int(11) DEFAULT NULL, `convenio_id` int(11) NOT NULL, `produto` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `tipo_produto` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `prazo` int(11) NOT NULL DEFAULT '0', `prazo_de` int(11) NOT NULL DEFAULT '0', `prazo_a` int(11) NOT NULL DEFAULT '0', `valor_de` decimal(15,2) NOT NULL DEFAULT '0.00', `valor_a` decimal(15,2) NOT NULL DEFAULT '0.00', `taxa_contrato_de` decimal(15,4) DEFAULT '0.0000', `taxa_contrato_a` decimal(15,4) DEFAULT '0.0000', `idade_inicial` int(11) DEFAULT NULL, `idade_final` int(11) DEFAULT NULL, `base_comissao` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `valor_fixo` decimal(15,2) DEFAULT NULL, `validar_faixa` tinyint(4) DEFAULT '0', `desativado` tinyint(4) DEFAULT '0', `excluido` tinyint(1) unsigned NOT NULL DEFAULT '0', `incidir_sobre` int(11) DEFAULT '0', PRIMARY KEY (`id`), KEY `grupo_id` (`grupo_id`,`prazo`), KEY `produto` (`produto`), KEY `excluido` (`excluido`), KEY `banco_id` (`banco_id`), KEY `convenio_id` (`convenio_id`), KEY `tabela_id` (`tabela_id`), KEY `prazo_de` (`prazo_de`), KEY `prazo_a` (`prazo_a`), KEY `valor_de` (`valor_de`), KEY `valor_a` (`valor_a`), KEY `taxa_contrato_de` (`taxa_contrato_de`), KEY `taxa_contrato_a` (`taxa_contrato_a`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_comissionamento_grupo_percentual' CREATE TABLE `tb_comissionamento_grupo_percentual` ( `id` int(11) NOT NULL AUTO_INCREMENT, `comissionamento_id` int(11) NOT NULL, `data_inicial` date NOT NULL, `data_final` date DEFAULT NULL, `data_base` enum('E','L') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'E', `comissao` decimal(15,2) NOT NULL, `bonus` decimal(15,2) DEFAULT NULL, `base_comissao_valor` varchar(45) COLLATE utf8_unicode_ci NOT NULL, `base_comissao_adiantamento` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, `base_comissao_diferimento` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, `base_comissao_bonus` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, `data_cadastro` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `excluido` tinyint(4) NOT NULL, `diferimento` decimal(15,2) DEFAULT NULL, `adiantamento` decimal(15,2) DEFAULT '0.00', PRIMARY KEY (`id`), KEY `comissionamento_id` (`comissionamento_id`), KEY `index1` (`data_inicial`,`data_final`,`excluido`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_comissionamento_percentual' CREATE TABLE `tb_comissionamento_percentual` ( `id` int(11) NOT NULL AUTO_INCREMENT, `comissionamento_id` int(11) NOT NULL, `data_inicial` date NOT NULL, `data_final` date DEFAULT NULL, `data_base` enum('E','L') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'E', `comissao` decimal(15,2) NOT NULL, `bonus` decimal(15,2) DEFAULT '0.00', `base_comissao_valor` varchar(45) COLLATE utf8_unicode_ci NOT NULL, `base_comissao_adiantamento` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, `base_comissao_diferimento` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, `base_comissao_bonus` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, `data_cadastro` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `diferimento` decimal(15,2) DEFAULT '0.00', `adiantamento` decimal(15,2) DEFAULT '0.00', `excluido` tinyint(4) NOT NULL, PRIMARY KEY (`id`), KEY `index1` (`data_inicial`,`data_final`,`excluido`), KEY `comissionamento_id` (`comissionamento_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_comissoes' CREATE TABLE `tb_comissoes` ( `id` int(11) NOT NULL AUTO_INCREMENT, `empresa_id` int(11) NOT NULL, `corretor_id` int(11) NOT NULL, `contrato_id` int(11) NOT NULL, `data_pagamento` date NOT NULL, `data_cadastro` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `obs` text CHARACTER SET latin1, `excluido` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `empresa_id` (`empresa_id`,`corretor_id`,`excluido`,`data_pagamento`), KEY `contrato_id` (`contrato_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_command_log' CREATE TABLE `tb_command_log` ( `id` int(11) NOT NULL AUTO_INCREMENT, `class` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `erro` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `erro_trace` text COLLATE utf8_unicode_ci, `inicio` datetime NOT NULL, `fim` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_config_sincronizacao' CREATE TABLE `tb_config_sincronizacao` ( `id` int(11) NOT NULL AUTO_INCREMENT, `banco_id` int(11) NOT NULL, `email` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `senha` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `senha_anexos` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `excluido` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `banco_id` (`banco_id`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_consultas_multibr' CREATE TABLE `tb_consultas_multibr` ( `id` int(11) NOT NULL AUTO_INCREMENT, `cpf` varchar(20) COLLATE utf8_unicode_ci NOT NULL, `beneficio` varchar(20) COLLATE utf8_unicode_ci NOT NULL, `margem_cartao` decimal(15,2) DEFAULT NULL, `margem_cartao_rmc` decimal(15,2) DEFAULT NULL, `margem` decimal(15,2) DEFAULT NULL, `corretor_id` int(11) NOT NULL, `data_hora_consulta` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `tipo` char(1) COLLATE utf8_unicode_ci DEFAULT NULL, `empresa_id` int(11) DEFAULT NULL, `origem` varchar(15) COLLATE utf8_unicode_ci NOT NULL, `usuario_id` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `orgao_consulta` varchar(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'INSS', PRIMARY KEY (`id`), KEY `corretor_id` (`corretor_id`,`data_hora_consulta`), KEY `cpf` (`cpf`), KEY `orgao_consulta` (`orgao_consulta`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_contas' CREATE TABLE `tb_contas` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `nome` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `banco_id` int(10) unsigned NOT NULL, `tipo` varchar(45) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'CORRENTE', `agencia` varchar(30) COLLATE utf8_unicode_ci DEFAULT '', `agencia_dv` varchar(30) COLLATE utf8_unicode_ci DEFAULT '', `conta` varchar(30) COLLATE utf8_unicode_ci NOT NULL, `conta_dv` varchar(30) COLLATE utf8_unicode_ci DEFAULT '', `carteira` varchar(30) COLLATE utf8_unicode_ci DEFAULT '', `variacao_carteira` varchar(30) COLLATE utf8_unicode_ci DEFAULT '', `carteira_cobranca` int(1) unsigned DEFAULT NULL, `convenio` varchar(30) COLLATE utf8_unicode_ci DEFAULT '', `formatacao_convenio` varchar(150) COLLATE utf8_unicode_ci DEFAULT '', `codigo_cedente` varchar(10) COLLATE utf8_unicode_ci DEFAULT '', `empresa_id` int(11) DEFAULT NULL, `excluido` tinyint(1) unsigned NOT NULL, PRIMARY KEY (`id`), KEY `excluido` (`excluido`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_contrato_bordero' CREATE TABLE `tb_contrato_bordero` ( `id` int(11) NOT NULL AUTO_INCREMENT, `bordero_id` int(11) NOT NULL, `nome_cliente` varchar(45) CHARACTER SET latin1 DEFAULT NULL, `cpf_cliente` varchar(45) CHARACTER SET latin1 DEFAULT NULL, `matricula_cliente` varchar(45) CHARACTER SET latin1 DEFAULT NULL, `data_nasc_cliente` varchar(45) CHARACTER SET latin1 DEFAULT NULL, `endereco_cliente` varchar(45) CHARACTER SET latin1 DEFAULT NULL, `uf_cidade_bairro_cliente` varchar(45) CHARACTER SET latin1 DEFAULT NULL, `tipo_conta_cliente` varchar(45) CHARACTER SET latin1 DEFAULT NULL, `banco_cliente` varchar(45) CHARACTER SET latin1 DEFAULT NULL, `conta_cliente` varchar(45) CHARACTER SET latin1 DEFAULT NULL, `agencia_cliente` varchar(45) CHARACTER SET latin1 DEFAULT NULL, `tipo_contrato` varchar(45) CHARACTER SET latin1 DEFAULT NULL, `produto` varchar(45) CHARACTER SET latin1 DEFAULT NULL, `fator` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, `valor_comissao` decimal(15,2) DEFAULT '0.00', `valor_bruto` decimal(15,2) DEFAULT '0.00', `valor_saldo_contrato` decimal(15,2) DEFAULT '0.00', `valor_liquido` decimal(15,2) DEFAULT '0.00', `valor_parcela_contrato` decimal(15,2) DEFAULT '0.00', `prazo` int(11) DEFAULT NULL, `numero_contrato` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `numero_ade` varchar(45) CHARACTER SET latin1 DEFAULT NULL, `obs_pendencia_contrato` varchar(45) CHARACTER SET latin1 DEFAULT NULL, `obs_geral_contrato` varchar(45) CHARACTER SET latin1 DEFAULT NULL, `convenio` varchar(45) CHARACTER SET latin1 DEFAULT NULL, `data_emissao` varchar(45) CHARACTER SET latin1 DEFAULT NULL, `data_liberacao` varchar(45) CHARACTER SET latin1 DEFAULT NULL, `data_cadastro` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `status` varchar(45) CHARACTER SET latin1 DEFAULT NULL, `excluido` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `numero_contrato` (`numero_contrato`), KEY `bordero_id` (`bordero_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_contratos' CREATE TABLE `tb_contratos` ( `id` int(11) NOT NULL AUTO_INCREMENT, `empresa_id` int(11) NOT NULL, `cliente_id` int(11) NOT NULL, `banco_id` int(11) NOT NULL, `tabela_id` int(11) DEFAULT NULL, `convenio_id` int(11) DEFAULT NULL, `corretor_id` int(11) DEFAULT NULL, `subestabelecido_id` int(11) DEFAULT NULL, `data_cadastro` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `data_atualizacao` timestamp NULL DEFAULT NULL, `numero_contrato` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `tipo` varchar(30) COLLATE utf8_unicode_ci DEFAULT 'NOVO', `data_emissao` date DEFAULT NULL, `prazo` int(11) DEFAULT NULL, `forma_liberacao` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `produto` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL, `status_proposta` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `digitador` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `data_recebimento_comissao` date DEFAULT NULL, `numero_beneficio` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `data_liberacao` date DEFAULT NULL, `data_quitacao` date DEFAULT NULL, `valor_tac` decimal(15,2) DEFAULT NULL, `valor_liberado` decimal(15,2) DEFAULT NULL, `valor_beneficio` decimal(15,2) DEFAULT NULL, `valor_seguro` decimal(15,2) DEFAULT NULL, `valor_financiado` decimal(15,2) DEFAULT NULL, `valor_iof` decimal(15,2) DEFAULT NULL, `valor_prestacao` decimal(15,2) DEFAULT NULL, `data_primeiro_vencimento` date DEFAULT NULL, `valor_liquido` decimal(15,2) DEFAULT NULL, `valor_bruto` decimal(15,2) DEFAULT NULL, `comissao_empresa` decimal(15,2) DEFAULT '0.00', `comissao_corretor` decimal(15,2) DEFAULT NULL, `comissao_gerente` decimal(15,2) DEFAULT NULL, `bonus_corretor` decimal(15,2) DEFAULT NULL, `bonus_empresa` decimal(15,2) DEFAULT '0.00', `banco_beneficiado` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `agencia_beneficiado` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `conta_beneficiado` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `obs` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `descricao_pendencia` varchar(600) COLLATE utf8_unicode_ci DEFAULT NULL, `data_recebimento_fisico` date DEFAULT NULL, `obs_recebimento_fisico` mediumtext COLLATE utf8_unicode_ci, `data_envio_fisico` date DEFAULT NULL, `obs_envio_fisico` mediumtext COLLATE utf8_unicode_ci, `matricula` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `data_recebimento_bonus` date DEFAULT NULL, `bonus_recebido` decimal(15,2) DEFAULT NULL, `tipo_registro` tinyint(4) NOT NULL DEFAULT '1', `cep` char(8) COLLATE utf8_unicode_ci DEFAULT NULL, `endereco` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `complemento` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `bairro` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `cidade` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `uf` char(2) COLLATE utf8_unicode_ci DEFAULT NULL, `usuario_efetivacao` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `data_efetivacao` date DEFAULT NULL, `bordero_newspace` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `numero_envelope` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `operacao_beneficiado` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `protocolo_recebimento_fisico` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `cobranca_banco` tinyint(4) NOT NULL DEFAULT '0', `anterior_numero` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `anterior_prazo` int(11) DEFAULT NULL, `anterior_parcelas_pagas` int(11) DEFAULT NULL, `anterior_sequencial_compra` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `anterior_tipo_quitacao` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `anterior_banco` char(3) COLLATE utf8_unicode_ci DEFAULT NULL, `anterior_parcelas_restantes` int(11) DEFAULT NULL, `anterior_saldo_devedor` decimal(15,2) DEFAULT NULL, `anterior_valor_parcela` decimal(15,2) DEFAULT NULL, `protocolo_envio_fisico` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `usuario_envio_fisico` int(11) DEFAULT NULL, `numero_ade` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `codigo_barras_ade` bigint(20) DEFAULT NULL, `usuario_formalizacao` int(11) DEFAULT NULL, `previa_recebimento` tinyint(4) DEFAULT '0', `excluido` tinyint(4) NOT NULL DEFAULT '0', `seguranca` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, `especie` int(10) unsigned DEFAULT NULL, `digitado_banco` tinyint(1) DEFAULT '0', `estornado` tinyint(1) DEFAULT '0', `data_estornado_manual` datetime DEFAULT NULL, `data_ted_devolvida` date DEFAULT NULL, `data_op_sacada` date DEFAULT NULL, `data_impressao` datetime DEFAULT NULL, `usuario_impressao` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `diferimento_corretor` decimal(15,2) DEFAULT NULL, `data_recebimento_previa` date DEFAULT NULL, `usuario_recebimento` int(11) DEFAULT NULL, `usuario_previa` int(11) DEFAULT NULL, `usuario_grupo_previa` int(11) DEFAULT NULL, `verificar_contratos` tinyint(4) DEFAULT '0', `data_notificacao_analise` date DEFAULT NULL, `usuario_digitado` int(11) DEFAULT NULL, `cartao` tinyint(4) DEFAULT '0', `token_proposta` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `base_comissao_valor` decimal(15,2) DEFAULT '0.00', `base_comissao_adiantamento` decimal(15,2) DEFAULT '0.00', `base_comissao_diferimento` decimal(15,2) DEFAULT '0.00', `base_comissao_bonus` decimal(15,2) DEFAULT '0.00', `base_comissao_empresa_valor` decimal(15,2) DEFAULT '0.00', `base_comissao_empresa_adiantamento` decimal(15,2) DEFAULT '0.00', `base_comissao_empresa_diferimento` decimal(15,2) DEFAULT '0.00', `base_comissao_empresa_bonus` decimal(15,2) DEFAULT '0.00', `status_anexo` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `status_anexo_corretor` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `saldo_banco` decimal(15,2) DEFAULT NULL, `rco` decimal(15,2) NOT NULL DEFAULT '0.00', `outras_despesas` decimal(15,2) DEFAULT '0.00', `valor_fixo_empresa` decimal(15,2) DEFAULT '0.00', `valor_fixo_corretor` decimal(15,2) DEFAULT '0.00', `comissionamento_cartao_recebido` int(11) NOT NULL DEFAULT '0', `status` tinyint(5) DEFAULT '0', `digitacao_rapida` tinyint(4) DEFAULT '0', `usuario_fraude` int(11) DEFAULT NULL, `data_validacao_fraude` timestamp NULL DEFAULT NULL, `motivo_fraude` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `reanexo` tinyint(4) DEFAULT '0', `cobranca_promotora` tinyint(1) DEFAULT '0', `midia_origem_id` int(11) DEFAULT NULL, `esteira_banco` tinyint(4) DEFAULT '0', `adiantamento_comissao_empresa` decimal(15,2) DEFAULT NULL, `taxa_portabilidade` decimal(15,2) DEFAULT NULL, `usuario_pendencia` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `pendente` tinyint(1) DEFAULT '1', `motivo_pendencia` int(11) DEFAULT '0', `tipo_formalizacao` int(11) NOT NULL DEFAULT '0', `data_agendamento_proposta` date DEFAULT NULL, `hora_agendada` char(5) COLLATE utf8_unicode_ci DEFAULT NULL, `taxa_contrato` decimal(15,2) DEFAULT NULL, `valor_reducao` decimal(15,2) DEFAULT '0.00', `banco_reducao` int(11) DEFAULT NULL, `idade_cliente` int(11) DEFAULT NULL, `srcc` tinyint(2) DEFAULT '0', `beneficiado_recebe_cartao` tinyint(4) DEFAULT NULL, `banco_cartao` int(11) DEFAULT '0', `agencia_cartao` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `captador_id` int(11) DEFAULT NULL, PRIMARY KEY (`id`), KEY `cliente_id` (`cliente_id`), KEY `banco_id` (`banco_id`), KEY `tabela_id` (`tabela_id`), KEY `convenio_id` (`convenio_id`), KEY `corretor_id` (`corretor_id`), KEY `tipo_registro` (`tipo_registro`), KEY `numero_contrato` (`numero_contrato`), KEY `excluido` (`excluido`), KEY `subestabelecido_id` (`subestabelecido_id`), KEY `bordero_newspace` (`bordero_newspace`,`numero_envelope`), KEY `protocolo_recebimento_fisico` (`protocolo_recebimento_fisico`), KEY `status_proposta` (`status_proposta`), KEY `empresa_id` (`empresa_id`), KEY `protocolo_envio_fisico` (`protocolo_envio_fisico`), KEY `usuario_formalizacao` (`usuario_formalizacao`), KEY `diferimento_corretor` (`diferimento_corretor`), KEY `usuario_digitado` (`usuario_digitado`), KEY `numero_ade` (`numero_ade`), KEY `data_notificacao_analise` (`data_notificacao_analise`), KEY `data_atualizacao` (`data_atualizacao`), KEY `usuario_envio_fisico` (`usuario_envio_fisico`), KEY `usuario_fraude` (`usuario_fraude`), KEY `data_emissao` (`data_emissao`), KEY `motivo_pendencia_index` (`motivo_pendencia`), KEY `prazo` (`prazo`) USING BTREE, KEY `valor_liquido` (`valor_liquido`) USING BTREE, KEY `valor_bruto` (`valor_bruto`) USING BTREE, KEY `tb_contratos_data_estornado_manual_index` (`data_estornado_manual`), KEY `tb_contratos_captador_id_index` (`captador_id`) ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_contratos_acoes' CREATE TABLE `tb_contratos_acoes` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `contrato_id` int(11) NOT NULL, `nome` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `nome_advogado` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `cpf` varchar(14) COLLATE utf8_unicode_ci DEFAULT NULL, `codigo` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `responsabilidade` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `processo` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `data_audiencia` date DEFAULT NULL, `data_recebimento` date DEFAULT NULL, `motivo` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `procedimento` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `resposta_parceiro` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `resposta_banco` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `usuario_id` int(11) DEFAULT NULL, `dt_importacao` timestamp NULL DEFAULT CURRENT_TIMESTAMP, `anexo` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `hora_audiencia` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, `local_audiencia` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `data_notificacao` date DEFAULT NULL, `resposta_analise` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL, `obs` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `impedimento_cobranca` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL, `data_pagamento` date DEFAULT NULL, `valor_pago` decimal(15,2) DEFAULT NULL, `descontar` int(11) DEFAULT '0', `origem_reclamacao` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `tipo_acao` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `prazo_resposta` int(11) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_contratos_acoes_anexos' CREATE TABLE `tb_contratos_acoes_anexos` ( `id` int(11) NOT NULL AUTO_INCREMENT, `anexo` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `contrato_id` int(11) NOT NULL, `excluido` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_contratos_anexos' CREATE TABLE `tb_contratos_anexos` ( `id` int(11) NOT NULL AUTO_INCREMENT, `contrato_id` int(11) DEFAULT NULL, `tipo_id` int(11) NOT NULL, `data_cadastro` timestamp NULL DEFAULT CURRENT_TIMESTAMP, `descricao` varchar(45) NOT NULL, `arquivo` varchar(255) NOT NULL, `excluido` tinyint(2) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- Create syntax for TABLE 'tb_contratos_pendencias' CREATE TABLE `tb_contratos_pendencias` ( `id` int(11) NOT NULL AUTO_INCREMENT, `contrato_id` int(11) NOT NULL, `tipo` int(11) NOT NULL, `descricao` mediumtext CHARACTER SET latin1 NOT NULL, `data_hora_cadastro` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `usuario_cadastro` int(11) NOT NULL, `data_hora_resolvido` timestamp NULL DEFAULT NULL, `usuario_resolvido` int(11) DEFAULT NULL, `resposta` int(11) NOT NULL DEFAULT '0', `excluido` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_contratos_portabilidade' CREATE TABLE `tb_contratos_portabilidade` ( `id` int(11) NOT NULL AUTO_INCREMENT, `contrato_id` int(11) NOT NULL, `data_hora_simulacao` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `usuario_simulacao` int(11) DEFAULT NULL, `valor_liberado` decimal(15,2) NOT NULL DEFAULT '0.00', `saldo_banco` decimal(15,2) NOT NULL DEFAULT '0.00', `valor_parcela` decimal(15,2) NOT NULL DEFAULT '0.00', `prazo` int(11) DEFAULT NULL, `tabela_id` int(11) DEFAULT NULL, `obs` mediumtext CHARACTER SET latin1, `resposta_corretor` int(11) DEFAULT NULL, `comentario_corretor` mediumtext CHARACTER SET latin1, `data_hora_corretor` timestamp NULL DEFAULT NULL, `usuario_corretor` int(11) DEFAULT NULL, `data_hora_envio` timestamp NULL DEFAULT NULL, `usuario_envio` int(11) DEFAULT NULL, `data_hora_resolvido` int(11) DEFAULT NULL, `usuario_resolvido` int(11) DEFAULT NULL, `excluido` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_convenios' CREATE TABLE `tb_convenios` ( `id` int(11) NOT NULL AUTO_INCREMENT, `codigo` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL, `nome` varchar(100) CHARACTER SET latin1 NOT NULL, `aumento_salarial` tinyint(4) DEFAULT '0', `parent_id` int(11) DEFAULT '0', `valor_base` decimal(15,2) DEFAULT '0.00', `excluido` tinyint(4) NOT NULL, `exibir_simulacao_aberta` tinyint(4) DEFAULT '0', PRIMARY KEY (`id`), KEY `excluido` (`excluido`), KEY `nome` (`nome`), KEY `parent_id` (`parent_id`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_convenios_prazos' CREATE TABLE `tb_convenios_prazos` ( `id` int(11) NOT NULL AUTO_INCREMENT, `convenio_id` int(11) NOT NULL, `prazo` int(11) DEFAULT NULL, `prazo_de` int(11) DEFAULT NULL, `prazo_a` int(11) DEFAULT NULL, `excluido` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `convenio_id` (`convenio_id`), KEY `excluido` (`excluido`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_corretor_assinatura_termo' CREATE TABLE `tb_corretor_assinatura_termo` ( `id` int(11) NOT NULL AUTO_INCREMENT, `corretor_id` int(11) DEFAULT NULL, `corretor_email` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `uuid` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `result_assinatura` text COLLATE utf8_unicode_ci, `data_solicitacao` timestamp NULL DEFAULT NULL, `data_assinatura` timestamp NULL DEFAULT NULL, `documento_assinado` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `excluido` tinyint(2) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `corretor_id` (`corretor_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_corretor_bot' CREATE TABLE `tb_corretor_bot` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user_id` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `corretor_id` int(11) DEFAULT NULL, `contato_nome` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, `contato_fone` varchar(13) COLLATE utf8_unicode_ci DEFAULT NULL, `servico` varchar(45) COLLATE utf8_unicode_ci NOT NULL, `excluido` tinyint(4) DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `tb_corretor_bot_unique_key` (`user_id`,`corretor_id`,`servico`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_corretores' CREATE TABLE `tb_corretores` ( `id` int(11) NOT NULL AUTO_INCREMENT, `data_cadastro` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `data_ultima_atualizacao` timestamp NULL DEFAULT NULL, `empresa_id` int(11) NOT NULL, `tipo` int(11) NOT NULL, `rota_id` int(11) NOT NULL, `nome` varchar(100) CHARACTER SET latin1 NOT NULL, `cpf` varchar(14) CHARACTER SET latin1 DEFAULT NULL, `rg` varchar(20) CHARACTER SET latin1 DEFAULT NULL, `orgao_expedidor` varchar(20) CHARACTER SET latin1 DEFAULT NULL, `data_nascimento` date DEFAULT NULL, `responsavel` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `cpf_responsavel` varchar(11) COLLATE utf8_unicode_ci DEFAULT NULL, `endereco` varchar(255) CHARACTER SET latin1 DEFAULT NULL, `numero` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, `complemento` varchar(255) CHARACTER SET latin1 DEFAULT NULL, `bairro` varchar(100) CHARACTER SET latin1 DEFAULT NULL, `cidade` varchar(100) CHARACTER SET latin1 DEFAULT NULL, `uf` char(2) CHARACTER SET latin1 DEFAULT NULL, `cep` varchar(8) CHARACTER SET latin1 DEFAULT NULL, `banco` varchar(20) CHARACTER SET latin1 DEFAULT NULL, `agencia` varchar(20) CHARACTER SET latin1 DEFAULT NULL, `conta` varchar(20) CHARACTER SET latin1 DEFAULT NULL, `titular` varchar(100) CHARACTER SET latin1 DEFAULT NULL, `cpf_titular` varchar(14) CHARACTER SET latin1 DEFAULT NULL, `tipo_conta` char(2) CHARACTER SET latin1 DEFAULT NULL, `chave_pix` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `dados_banco_alterado` tinyint(4) DEFAULT '0', `obs` text COLLATE utf8_unicode_ci, `nome_mae` varchar(100) CHARACTER SET latin1 DEFAULT NULL, `apelido` varchar(100) CHARACTER SET latin1 DEFAULT NULL, `celular` varchar(15) CHARACTER SET latin1 DEFAULT NULL, `email` varchar(100) CHARACTER SET latin1 DEFAULT NULL, `fax` varchar(15) CHARACTER SET latin1 DEFAULT NULL, `site` varchar(255) CHARACTER SET latin1 DEFAULT NULL, `telefone_residencial` varchar(14) CHARACTER SET latin1 DEFAULT NULL, `telefone_comercial` varchar(15) CHARACTER SET latin1 DEFAULT NULL, `twitter` varchar(100) CHARACTER SET latin1 DEFAULT NULL, `grupo_comissao` int(11) DEFAULT NULL, `login` varchar(100) CHARACTER SET latin1 DEFAULT NULL, `senha` varchar(100) CHARACTER SET latin1 DEFAULT NULL, `prazo_fisico` int(11) DEFAULT '15', `bloquear_pagamento` tinyint(1) NOT NULL DEFAULT '0', `motivo` varchar(255) CHARACTER SET latin1 DEFAULT NULL, `corretor_desativado` int(1) DEFAULT '0', `obedecer_id` tinyint(4) DEFAULT '0', `mudar_senha` tinyint(4) DEFAULT '0', `data_alteracao_senha` date DEFAULT NULL, `descontar_taxa_transf` tinyint(4) DEFAULT '0', `token_aplicativo` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `acesso_aplicativo` tinyint(4) DEFAULT '0', `att_dados_corretor` tinyint(4) DEFAULT '0', `id_mobile_token` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `acesso_temporario` tinyint(2) DEFAULT '0', `data_temporario_app` date DEFAULT NULL, `permitir_sinc_yuppies` int(11) NOT NULL DEFAULT '0', `token_sinc_yuppies` varchar(100) CHARACTER SET latin1 DEFAULT NULL, `ip` varchar(15) CHARACTER SET latin1 DEFAULT NULL, `nivel_esteira` tinyint(3) NOT NULL DEFAULT '0', `tipo_venda` tinyint(3) NOT NULL DEFAULT '0', `excluido` tinyint(4) DEFAULT '0', `dias_bloqueio_producao` int(11) DEFAULT '0', `percentual_corte` decimal(15,2) DEFAULT '0.00', `potencial_venda` decimal(15,2) DEFAULT '0.00', `numero_certificado` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `validade_certificado` date DEFAULT NULL, `token_reset_senha` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, `data_request_reset` date DEFAULT NULL, `status_cadastro` tinyint(2) DEFAULT '1', `automatizacao_oportunidades_negocios` tinyint(2) DEFAULT '0', `oportunidades_negocios_filtro_id` int(11) DEFAULT NULL, `grupo_acesso` int(11) DEFAULT '1', PRIMARY KEY (`id`), KEY `grupo_comissao` (`grupo_comissao`), KEY `rota_id` (`rota_id`), KEY `excluido` (`excluido`), KEY `empresa_id` (`empresa_id`), KEY `nome` (`nome`), KEY `prazo_fisico` (`prazo_fisico`), KEY `corretor_desativado` (`corretor_desativado`,`excluido`), KEY `oportunidades_negocios_filtro_fk` (`oportunidades_negocios_filtro_id`) ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_corretores_bancos' CREATE TABLE `tb_corretores_bancos` ( `id` int(11) NOT NULL AUTO_INCREMENT, `corretor_id` int(10) NOT NULL, `banco_id` int(10) NOT NULL, `excluido` int(10) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_corretores_creditos' CREATE TABLE `tb_corretores_creditos` ( `id` int(11) NOT NULL AUTO_INCREMENT, `corretor_id` int(11) NOT NULL, `data_credito` date NOT NULL, `pacote_id` int(10) unsigned NOT NULL, `credito` decimal(15,2) NOT NULL, `usuario` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `excluido` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `corretor_id` (`corretor_id`,`excluido`), KEY `pacote_id` (`pacote_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_corretores_documentos' CREATE TABLE `tb_corretores_documentos` ( `id` int(11) NOT NULL AUTO_INCREMENT, `corretor_id` int(11) NOT NULL, `descricao` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `anexo` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `excluido` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `excluido` (`excluido`), KEY `corretor_id` (`corretor_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_corretores_emails' CREATE TABLE `tb_corretores_emails` ( `id` int(11) NOT NULL AUTO_INCREMENT, `corretor_id` int(11) NOT NULL, `email_adicional` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `descricao` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `protocolo` tinyint(2) DEFAULT '0', `pendencia` tinyint(2) DEFAULT '0', `chamado` tinyint(2) DEFAULT '0', `juridico` tinyint(2) DEFAULT '0', `apoio_comercial` tinyint(2) DEFAULT '0', `receber_email` tinyint(2) DEFAULT '0', `excluido` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `corretor_id` (`corretor_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_corretores_metas' CREATE TABLE `tb_corretores_metas` ( `id` int(11) NOT NULL AUTO_INCREMENT, `corretor_id` int(11) NOT NULL, `banco_id` int(11) DEFAULT NULL, `protocolo_fisico` tinyint(4) NOT NULL DEFAULT '0', `data_inicial` date DEFAULT NULL, `data_final` date DEFAULT NULL, `meta` decimal(15,2) DEFAULT NULL, `excluido` tinyint(4) NOT NULL DEFAULT '0', `producao_inicial` decimal(15,2) NOT NULL, `producao_final` decimal(15,2) NOT NULL, `producao_comissao` decimal(15,2) NOT NULL, PRIMARY KEY (`id`), KEY `corretor_id` (`corretor_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_corretores_metas_operador' CREATE TABLE `tb_corretores_metas_operador` ( `id` int(11) NOT NULL AUTO_INCREMENT, `corretor_id` int(11) NOT NULL, `data_inicial` date NOT NULL, `data_final` date NOT NULL, `meta` decimal(15,2) NOT NULL, `excluido` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `corretor_id` (`corretor_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_corretores_metas_status' CREATE TABLE `tb_corretores_metas_status` ( `id` int(11) NOT NULL AUTO_INCREMENT, `corretor_meta_id` int(11) NOT NULL, `status_proposta` int(11) NOT NULL, `excluido` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `corretor_meta_id` (`corretor_meta_id`,`status_proposta`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_corretores_prazos' CREATE TABLE `tb_corretores_prazos` ( `id` int(10) NOT NULL AUTO_INCREMENT, `banco_id` int(10) NOT NULL, `corretor_id` int(10) NOT NULL, `prazo` int(10) NOT NULL DEFAULT '0', `excluido` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `index4` (`excluido`), KEY `index2` (`corretor_id`,`banco_id`,`excluido`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_corretores_senhas' CREATE TABLE `tb_corretores_senhas` ( `id` int(11) NOT NULL AUTO_INCREMENT, `corretor_id` int(11) NOT NULL, `banco_id` int(11) NOT NULL, `senha` varchar(40) CHARACTER SET latin1 NOT NULL, `data_cadastro` timestamp NULL DEFAULT CURRENT_TIMESTAMP, `descricao` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `usuario_inseriu` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `excluido` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `corretor_id` (`corretor_id`,`senha`,`excluido`), KEY `banco_id` (`banco_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_diario_rotas' CREATE TABLE `tb_diario_rotas` ( `id` int(11) NOT NULL AUTO_INCREMENT, `supervisor_id` int(11) NOT NULL, `data_saida` date NOT NULL, `data_retorno` date NOT NULL, `status` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `excluido` tinyint(4) NOT NULL DEFAULT '0', `km_final` int(15) NOT NULL DEFAULT '0', `km_inicial` int(15) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `supervisor_id` (`supervisor_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_diario_tipos' CREATE TABLE `tb_diario_tipos` ( `id` int(11) NOT NULL AUTO_INCREMENT, `diario_rota_id` int(11) NOT NULL, `corretor_id` int(11) DEFAULT NULL, `supervisor_id` int(11) DEFAULT NULL, `data` date DEFAULT NULL, `cidade` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `uf` char(2) COLLATE utf8_unicode_ci DEFAULT NULL, `km_veiculo` int(11) DEFAULT NULL, `hospedagem` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `nome_restaurante` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `refeicao` tinyint(4) DEFAULT NULL, `resumo_visita` text COLLATE utf8_unicode_ci, `valor` decimal(15,2) DEFAULT NULL, `motivo_gasto` text COLLATE utf8_unicode_ci, `tipo_diario` tinyint(4) DEFAULT NULL, `anexo` varchar(150) COLLATE utf8_unicode_ci DEFAULT NULL, `excluido` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `diario_rota_id` (`diario_rota_id`,`corretor_id`), KEY `supervisor_id` (`supervisor_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_digisac_chamados' CREATE TABLE `tb_digisac_chamados` ( `id` int(11) NOT NULL AUTO_INCREMENT, `data_consulta` timestamp NULL DEFAULT CURRENT_TIMESTAMP, `contato_id` varchar(150) NOT NULL DEFAULT '', `contato_nome` varchar(100) DEFAULT NULL, `contato_fone` varchar(13) DEFAULT NULL, `chave` varchar(100) DEFAULT NULL, `finalizado` tinyint(4) DEFAULT '0', `excluido` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- Create syntax for TABLE 'tb_emails_configuracao' CREATE TABLE `tb_emails_configuracao` ( `id` int(11) NOT NULL AUTO_INCREMENT, `tipo` varchar(40) COLLATE utf8_unicode_ci NOT NULL, `email` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `nome` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `excluido` tinyint(2) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_empresas' CREATE TABLE `tb_empresas` ( `id` int(11) NOT NULL AUTO_INCREMENT, `nome` varchar(255) CHARACTER SET latin1 NOT NULL, `razao_social` varchar(255) CHARACTER SET latin1 DEFAULT NULL, `cnpj` varchar(19) CHARACTER SET latin1 DEFAULT NULL, `data_cadastro` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `responsavel` varchar(100) CHARACTER SET latin1 DEFAULT NULL, `cpf_responsavel` varchar(14) CHARACTER SET latin1 DEFAULT NULL, `cep` varchar(8) CHARACTER SET latin1 DEFAULT NULL, `endereco` varchar(255) CHARACTER SET latin1 DEFAULT NULL, `bairro` varchar(100) CHARACTER SET latin1 DEFAULT NULL, `cidade` varchar(100) CHARACTER SET latin1 DEFAULT NULL, `uf` char(2) CHARACTER SET latin1 DEFAULT NULL, `complemento` varchar(255) CHARACTER SET latin1 DEFAULT NULL, `numero` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, `email` varchar(255) CHARACTER SET latin1 DEFAULT NULL, `celular` varchar(14) CHARACTER SET latin1 DEFAULT NULL, `fax` varchar(14) CHARACTER SET latin1 DEFAULT NULL, `fone` varchar(14) CHARACTER SET latin1 DEFAULT NULL, `obs` text CHARACTER SET latin1, `codigo_promotora` varchar(20) CHARACTER SET latin1 DEFAULT NULL, `host` varchar(100) CHARACTER SET latin1 DEFAULT NULL, `login` varchar(30) CHARACTER SET latin1 DEFAULT NULL, `senha` varchar(30) CHARACTER SET latin1 DEFAULT NULL, `meta` decimal(15,2) DEFAULT NULL, `tipo` varchar(50) CHARACTER SET latin1 NOT NULL DEFAULT 'EMPRESA', `performance` decimal(15,2) DEFAULT NULL, `excluido` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `tipo` (`tipo`,`excluido`) ) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_empresas_ftps' CREATE TABLE `tb_empresas_ftps` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `banco_id` int(11) NOT NULL, `codigo_promotora` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `host` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `login` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL, `senha` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `excluido` tinyint(4) NOT NULL DEFAULT '0', `empresa_id` int(11) NOT NULL, PRIMARY KEY (`id`), KEY `empresa_id` (`empresa_id`), KEY `banco_id` (`banco_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_enderecos_corretor' CREATE TABLE `tb_enderecos_corretor` ( `id` int(11) NOT NULL AUTO_INCREMENT, `corretor_id` int(11) NOT NULL, `endereco` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `bairro` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `cidade` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `uf` varchar(3) COLLATE utf8_unicode_ci NOT NULL, `complemento` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `numero` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `cep` varchar(255) COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_espelho_importacao' CREATE TABLE `tb_espelho_importacao` ( `id` int(11) NOT NULL AUTO_INCREMENT, `contrato_id` int(11) NOT NULL, `data_importacao` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `usuario` varchar(50) COLLATE utf8_unicode_ci NOT NULL, `arquivo` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `linha` text COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`id`), KEY `tb_espelho_importacao_contrato_id_index` (`contrato_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_esteira_anti_fraude_historico' CREATE TABLE `tb_esteira_anti_fraude_historico` ( `id` int(11) NOT NULL AUTO_INCREMENT, `contrato_id` int(11) DEFAULT NULL, `nome_cliente` varchar(150) DEFAULT NULL, `cpf_cliente` varchar(14) DEFAULT NULL, `numero_protocolo` varchar(20) DEFAULT NULL, `data_cadastro` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP, `motivo_fraude` varchar(255) DEFAULT NULL, `usuario_fraude` int(11) DEFAULT NULL, `status` tinyint(2) DEFAULT NULL, `excluido` tinyint(1) DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- Create syntax for TABLE 'tb_esteira_contratos' CREATE TABLE `tb_esteira_contratos` ( `id` int(11) NOT NULL AUTO_INCREMENT, `cpf_corretor` varchar(14) COLLATE utf8_unicode_ci DEFAULT NULL, `cpf_cliente` varchar(14) COLLATE utf8_unicode_ci DEFAULT NULL, `nome_cliente` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, `banco` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `valor` decimal(15,2) DEFAULT NULL, `anexo` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `aprovado` tinyint(4) DEFAULT NULL, `numero_proposta` varchar(20) CHARACTER SET latin1 NOT NULL, `data_cadastro` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `digitador` varchar(45) CHARACTER SET latin1 DEFAULT NULL, `excluido` tinyint(4) DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_extratos' CREATE TABLE `tb_extratos` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `conta_id` int(11) NOT NULL, `data_importacao` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `trn_type` varchar(50) COLLATE utf8_unicode_ci NOT NULL, `dt_posted` date NOT NULL, `trn_amt` decimal(15,2) NOT NULL, `fit_id` varchar(20) COLLATE utf8_unicode_ci NOT NULL, `check_num` varchar(20) COLLATE utf8_unicode_ci NOT NULL, `payeeid` int(11) DEFAULT '0', `memo` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `importado` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_faixa_valores' CREATE TABLE `tb_faixa_valores` ( `id` int(11) NOT NULL AUTO_INCREMENT, `percentual_de` decimal(15,2) NOT NULL, `percentual_a` decimal(15,2) NOT NULL, `comissao` decimal(15,3) NOT NULL, `excluido` tinyint(2) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_falha_importacao' CREATE TABLE `tb_falha_importacao` ( `id` int(11) NOT NULL AUTO_INCREMENT, `numero_contrato` varchar(20) CHARACTER SET latin1 DEFAULT NULL, `tabela` varchar(20) CHARACTER SET latin1 DEFAULT NULL, `cliente` varchar(100) CHARACTER SET latin1 DEFAULT NULL, `cpf` varchar(45) CHARACTER SET latin1 DEFAULT NULL, `valor` decimal(15,2) DEFAULT NULL, `prazo` int(11) DEFAULT NULL, `codigo_vendedor` varchar(45) CHARACTER SET latin1 DEFAULT NULL, `codigo_atendente` varchar(45) CHARACTER SET latin1 DEFAULT NULL, `motivo` varchar(255) CHARACTER SET latin1 DEFAULT NULL, `banco_id` int(11) DEFAULT NULL, `arquivo` varchar(45) CHARACTER SET latin1 DEFAULT NULL, `excluido` tinyint(4) NOT NULL DEFAULT '0', `data_falha` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_folha_ponto' CREATE TABLE `tb_folha_ponto` ( `id` int(11) NOT NULL AUTO_INCREMENT, `funcionario_id` int(11) NOT NULL, `data_ponto` date NOT NULL, `chegada_trabalho` varchar(8) COLLATE utf8_unicode_ci DEFAULT NULL, `saida_intervalo` varchar(8) COLLATE utf8_unicode_ci DEFAULT NULL, `retorno_intervalo` varchar(8) COLLATE utf8_unicode_ci DEFAULT NULL, `saida_trabalho` varchar(8) COLLATE utf8_unicode_ci DEFAULT NULL, `entrada_hora_extra` varchar(8) COLLATE utf8_unicode_ci DEFAULT NULL, `saida_hora_extra` varchar(8) COLLATE utf8_unicode_ci DEFAULT NULL, `login` varchar(20) COLLATE utf8_unicode_ci NOT NULL, `ip` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `excluido` int(11) DEFAULT '0', `saida_intervalo2` varchar(8) COLLATE utf8_unicode_ci DEFAULT NULL, `retorno_intervalo2` varchar(8) COLLATE utf8_unicode_ci DEFAULT NULL, `saida_intervalo3` varchar(8) COLLATE utf8_unicode_ci DEFAULT NULL, `retorno_intervalo3` varchar(8) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `funcionario_id` (`funcionario_id`), KEY `data_ponto` (`data_ponto`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_folha_ponto_folgas' CREATE TABLE `tb_folha_ponto_folgas` ( `id` int(11) NOT NULL AUTO_INCREMENT, `funcionario_id` int(11) DEFAULT '0', `data_inicial` date NOT NULL, `data_final` date NOT NULL, `horas` time DEFAULT NULL, `tipo` enum('Data','Hora') COLLATE utf8_unicode_ci DEFAULT NULL, `descricao` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `excluido` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_fornecedores' CREATE TABLE `tb_fornecedores` ( `id` int(11) NOT NULL AUTO_INCREMENT, `nome` varchar(255) CHARACTER SET latin1 NOT NULL, `razao_social` varchar(255) CHARACTER SET latin1 DEFAULT NULL, `cnpj` varchar(19) CHARACTER SET latin1 DEFAULT NULL, `data_cadastro` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `responsavel` varchar(100) CHARACTER SET latin1 DEFAULT NULL, `cpf_responsavel` varchar(14) CHARACTER SET latin1 DEFAULT NULL, `cep` varchar(8) CHARACTER SET latin1 DEFAULT NULL, `endereco` varchar(255) CHARACTER SET latin1 DEFAULT NULL, `bairro` varchar(100) CHARACTER SET latin1 DEFAULT NULL, `cidade` varchar(100) CHARACTER SET latin1 DEFAULT NULL, `uf` char(2) CHARACTER SET latin1 DEFAULT NULL, `complemento` varchar(255) CHARACTER SET latin1 DEFAULT NULL, `email` varchar(255) CHARACTER SET latin1 DEFAULT NULL, `celular` varchar(14) CHARACTER SET latin1 DEFAULT NULL, `fax` varchar(14) CHARACTER SET latin1 DEFAULT NULL, `fone` varchar(14) CHARACTER SET latin1 DEFAULT NULL, `obs` text CHARACTER SET latin1, `banco` varchar(10) CHARACTER SET latin1 DEFAULT NULL, `agencia` varchar(20) CHARACTER SET latin1 DEFAULT NULL, `conta` varchar(20) CHARACTER SET latin1 DEFAULT NULL, `titular` varchar(255) CHARACTER SET latin1 DEFAULT NULL, `cpf_titular` varchar(14) CHARACTER SET latin1 DEFAULT NULL, `tipo_conta` char(2) CHARACTER SET latin1 DEFAULT NULL, `chave_pix` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `tipo` varchar(30) CHARACTER SET latin1 NOT NULL, `data_nascimento` date DEFAULT NULL, `setor_id` int(11) DEFAULT NULL, `data_contratacao` date DEFAULT NULL, `data_desligamento` date DEFAULT NULL, `motivo_desligamento` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL, `modelo_desligamento` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL, `salario_base` decimal(15,2) DEFAULT NULL, `vale_transporte` decimal(15,2) DEFAULT NULL, `vale_alimentacao` decimal(15,2) DEFAULT NULL, `excluido` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_gerente_rota' CREATE TABLE `tb_gerente_rota` ( `id` int(11) NOT NULL AUTO_INCREMENT, `data_cadastro` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `gerente_id` int(11) NOT NULL, `empresa_id` int(11) NOT NULL, `nome` varchar(100) CHARACTER SET latin1 NOT NULL, `cpf` varchar(14) CHARACTER SET latin1 DEFAULT NULL, `rg` varchar(10) CHARACTER SET latin1 DEFAULT NULL, `orgao_expedidor` varchar(20) CHARACTER SET latin1 DEFAULT NULL, `data_nascimento` date DEFAULT NULL, `endereco` varchar(255) CHARACTER SET latin1 DEFAULT NULL, `complemento` varchar(255) CHARACTER SET latin1 DEFAULT NULL, `bairro` varchar(100) CHARACTER SET latin1 DEFAULT NULL, `cidade` varchar(100) CHARACTER SET latin1 DEFAULT NULL, `uf` char(2) CHARACTER SET latin1 DEFAULT NULL, `cep` varchar(8) CHARACTER SET latin1 DEFAULT NULL, `banco` varchar(100) CHARACTER SET latin1 DEFAULT NULL, `agencia` varchar(10) CHARACTER SET latin1 DEFAULT NULL, `conta` varchar(10) CHARACTER SET latin1 DEFAULT NULL, `titular` varchar(100) CHARACTER SET latin1 DEFAULT NULL, `cpf_titular` varchar(14) CHARACTER SET latin1 DEFAULT NULL, `tipo_conta` char(2) CHARACTER SET latin1 DEFAULT NULL, `obs` text CHARACTER SET latin1 NOT NULL, `excluido` tinyint(4) NOT NULL DEFAULT '0', `apelido` varchar(100) CHARACTER SET latin1 DEFAULT NULL, `celular` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL, `email` varchar(100) CHARACTER SET latin1 DEFAULT NULL, `fax` varchar(14) CHARACTER SET latin1 DEFAULT NULL, `site` varchar(255) CHARACTER SET latin1 DEFAULT NULL, `fone` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL, `telefone_comercial` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL, `login` varchar(100) CHARACTER SET latin1 DEFAULT NULL, `senha` varchar(100) CHARACTER SET latin1 DEFAULT NULL, `valor_comissao` decimal(15,2) DEFAULT NULL, `prazo` int(11) DEFAULT NULL, `exibir_ranking` tinyint(4) DEFAULT '0', `receber_email_copia` tinyint(2) DEFAULT '0', `teto_comissao` decimal(15,2) DEFAULT NULL, `ip` varchar(15) CHARACTER SET latin1 DEFAULT NULL, `token_reset_senha` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, `data_request_reset` date DEFAULT NULL, PRIMARY KEY (`id`), KEY `gerente_id` (`gerente_id`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_gerentes' CREATE TABLE `tb_gerentes` ( `id` int(11) NOT NULL AUTO_INCREMENT, `data_cadastro` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `empresa_id` int(11) DEFAULT NULL, `tipo` varchar(50) NOT NULL DEFAULT 'EMPRESA', `nome` varchar(100) NOT NULL, `cpf` varchar(14) DEFAULT NULL, `rg` varchar(10) DEFAULT NULL, `orgao_expedidor` varchar(20) DEFAULT NULL, `data_nascimento` date DEFAULT NULL, `endereco` varchar(255) DEFAULT NULL, `complemento` varchar(255) DEFAULT NULL, `bairro` varchar(100) DEFAULT NULL, `cidade` varchar(100) DEFAULT NULL, `uf` char(2) DEFAULT NULL, `cep` varchar(8) DEFAULT NULL, `banco` varchar(100) DEFAULT NULL, `agencia` varchar(10) DEFAULT NULL, `conta` varchar(10) DEFAULT NULL, `titular` varchar(100) DEFAULT NULL, `cpf_titular` varchar(14) DEFAULT NULL, `tipo_conta` char(2) DEFAULT NULL, `obs` text NOT NULL, `excluido` tinyint(4) NOT NULL DEFAULT '0', `apelido` varchar(100) DEFAULT NULL, `celular` varchar(14) DEFAULT NULL, `email` varchar(100) DEFAULT NULL, `fax` varchar(14) DEFAULT NULL, `site` varchar(255) DEFAULT NULL, `fone` varchar(14) DEFAULT NULL, `telefone_comercial` varchar(14) DEFAULT NULL, `twitter` varchar(100) DEFAULT NULL, `login` varchar(100) DEFAULT NULL, `senha` varchar(100) DEFAULT NULL, `valor_comissao` decimal(15,2) DEFAULT NULL, `exibir_ranking` tinyint(4) DEFAULT '0', `receber_email_copia` tinyint(2) DEFAULT '0', `ip` varchar(15) DEFAULT NULL, `token_reset_senha` varchar(32) DEFAULT NULL, `data_request_reset` date DEFAULT NULL, PRIMARY KEY (`id`), KEY `tipo` (`tipo`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; -- Create syntax for TABLE 'tb_gerentes_convenios' CREATE TABLE `tb_gerentes_convenios` ( `id` int(11) NOT NULL AUTO_INCREMENT, `gerente_id` int(11) NOT NULL, `convenio_id` int(11) NOT NULL, `codigo` varchar(20) CHARACTER SET latin1 NOT NULL, `excluido` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `gerente_id` (`gerente_id`,`convenio_id`,`excluido`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_gerentes_metas' CREATE TABLE `tb_gerentes_metas` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `gerente_id` int(11) DEFAULT NULL, `gerente_rota_id` int(11) DEFAULT NULL, `banco_id` int(11) DEFAULT NULL, `data_inicial` date NOT NULL, `data_final` date NOT NULL, `meta` decimal(15,2) unsigned NOT NULL, `excluido` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `gerente_id` (`gerente_id`), KEY `gerente_rota_id` (`gerente_rota_id`), KEY `banco_id` (`banco_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_gerentes_metas_status' CREATE TABLE `tb_gerentes_metas_status` ( `id` int(11) NOT NULL AUTO_INCREMENT, `gerente_meta_id` int(11) NOT NULL, `status_proposta` int(11) NOT NULL, `excluido` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `status_proposta` (`status_proposta`), KEY `gerente_meta_id` (`gerente_meta_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_grupos_usuarios' CREATE TABLE `tb_grupos_usuarios` ( `id` int(11) NOT NULL AUTO_INCREMENT, `nome` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `bloquear` tinyint(2) NOT NULL DEFAULT '0', `exibir_operador` tinyint(2) NOT NULL DEFAULT '0', `exibir_corretor` tinyint(2) NOT NULL DEFAULT '0', `forma_equipe` tinyint(2) NOT NULL DEFAULT '0', `excluido` tinyint(4) NOT NULL, `email` varchar(100) CHARACTER SET latin1 DEFAULT NULL, PRIMARY KEY (`id`), KEY `nome` (`nome`,`excluido`) ) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_historico_pendencias' CREATE TABLE `tb_historico_pendencias` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `data_historico` datetime DEFAULT NULL, `descricao` text COLLATE utf8_unicode_ci, `digitador` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `excluido` tinyint(4) NOT NULL DEFAULT '0', `contrato_id` int(11) NOT NULL, `resolvida` int(11) NOT NULL DEFAULT '0', `resolvida_por` varchar(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `resolvida_em` datetime DEFAULT NULL, PRIMARY KEY (`id`), KEY `contrato_id` (`contrato_id`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_importacao_banco_async' CREATE TABLE `tb_importacao_banco_async` ( `id` int(11) NOT NULL AUTO_INCREMENT, `banco_id` int(11) DEFAULT NULL, `layout_banco` int(11) DEFAULT NULL, `subestabelecido_id` int(11) DEFAULT NULL, `qtd_registros` int(12) DEFAULT NULL, `qtd_importados` int(12) DEFAULT '0', `qtd_nao_importados` int(12) DEFAULT '0', `execucao` int(12) DEFAULT '1', `arquivo_origem` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `arquivo_async` varchar(250) COLLATE utf8_unicode_ci DEFAULT NULL, `data_inicio` datetime NOT NULL, `data_fim` datetime DEFAULT NULL, `params` text COLLATE utf8_unicode_ci, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_lancamentos' CREATE TABLE `tb_lancamentos` ( `id` int(11) NOT NULL AUTO_INCREMENT, `empresa_id` int(11) NOT NULL, `categoria_id` int(11) NOT NULL, `conta_id` int(11) NOT NULL, `forma_pagamento_id` int(11) DEFAULT NULL, `fornecedor_id` int(11) DEFAULT NULL, `corretor_id` int(11) DEFAULT NULL, `funcionario_id` int(11) DEFAULT NULL, `rota_id` int(11) DEFAULT NULL, `diario_rota_id` int(11) DEFAULT NULL, `diario_tipo_id` int(11) DEFAULT NULL, `status_viagem` tinyint(4) DEFAULT '0', `supervisor_id` int(11) DEFAULT NULL, `data_lancamento` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `descricao` varchar(100) CHARACTER SET latin1 NOT NULL, `valor` decimal(15,2) DEFAULT NULL, `data_vencimento` date DEFAULT NULL, `valor_pago` decimal(15,2) DEFAULT NULL, `data_pagamento` date DEFAULT NULL, `obs` text CHARACTER SET latin1, `usuario_baixa` varchar(100) CHARACTER SET latin1 DEFAULT NULL, `data_baixa` datetime DEFAULT NULL, `tipo` varchar(20) CHARACTER SET latin1 NOT NULL, `compor_saldo` tinyint(4) DEFAULT '1', `numero_documento` varchar(50) CHARACTER SET latin1 DEFAULT NULL, `id_pai` int(11) DEFAULT NULL, `setor` varchar(100) CHARACTER SET latin1 DEFAULT NULL, `subsetor` varchar(100) CHARACTER SET latin1 DEFAULT NULL, `excluido` tinyint(4) NOT NULL DEFAULT '0', `transferencia` tinyint(2) DEFAULT '0', `conciliacao` tinyint(4) DEFAULT '0', `resumo_diario` text COLLATE utf8_unicode_ci, `anexo` varchar(255) CHARACTER SET latin1 DEFAULT NULL, `competencia` varchar(7) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `empresa_id` (`empresa_id`), KEY `categoria_id` (`categoria_id`), KEY `conta_id` (`conta_id`), KEY `forma_pagamento_id` (`forma_pagamento_id`), KEY `fornecedor_id` (`fornecedor_id`), KEY `corretor_id` (`corretor_id`), KEY `data_vencimento` (`data_vencimento`), KEY `data_pagamento` (`data_pagamento`), KEY `compor_saldo` (`compor_saldo`), KEY `tipo` (`tipo`), KEY `excluido` (`excluido`), KEY `setor` (`setor`), KEY `subsetor` (`subsetor`), KEY `diario_rota_id` (`diario_rota_id`), KEY `supervisor_id` (`supervisor_id`), KEY `diario_tipo_id` (`diario_tipo_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_layout_banco' CREATE TABLE `tb_layout_banco` ( `id` int(11) NOT NULL AUTO_INCREMENT, `descricao` varchar(200) COLLATE utf8_unicode_ci NOT NULL, `banco_id` int(11) NOT NULL, `layout_comissao` int(11) DEFAULT '0', `excluido` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `banco_id` (`banco_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_layout_banco_letras' CREATE TABLE `tb_layout_banco_letras` ( `id` int(11) NOT NULL AUTO_INCREMENT, `campo` varchar(200) COLLATE utf8_unicode_ci NOT NULL, `letra` varchar(20) COLLATE utf8_unicode_ci NOT NULL, `atualizar_campo` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL, `layout_id` int(11) NOT NULL, `excluido` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `layout_id` (`layout_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_layouts_arquivo_sincronizacao' CREATE TABLE `tb_layouts_arquivo_sincronizacao` ( `id` int(11) NOT NULL AUTO_INCREMENT, `nome` varchar(50) COLLATE utf8_unicode_ci NOT NULL, `banco_id` int(11) NOT NULL, `layout_id` int(11) NOT NULL, `excluido` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `banco_id` (`banco_id`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_log' CREATE TABLE `tb_log` ( `id` int(11) NOT NULL AUTO_INCREMENT, `data_mudanca` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `nome_usuario` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `campo` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `tabela` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `chave` int(11) DEFAULT NULL, `alteracao` text COLLATE utf8_unicode_ci NOT NULL, `clausula_where` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `origem` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `ip` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `idx_chave_tabela` (`chave`,`tabela`) USING BTREE, KEY `data_mudanca` (`data_mudanca`), KEY `clausula_where` (`clausula_where`), KEY `origem` (`origem`) ) ENGINE=InnoDB AUTO_INCREMENT=18450 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_mensagens' CREATE TABLE `tb_mensagens` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `remetente_id` int(11) NOT NULL, `destinatario_id` int(11) DEFAULT NULL, `assunto` varchar(140) COLLATE utf8_unicode_ci DEFAULT NULL, `supervisor_id` int(11) DEFAULT NULL, `anexo` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `mensagem` text COLLATE utf8_unicode_ci NOT NULL, `data_envio` datetime NOT NULL, `data_final` date NOT NULL, `excluido` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `remetente_id` (`remetente_id`,`destinatario_id`), KEY `supervisor_id` (`supervisor_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_minerador_acesso' CREATE TABLE `tb_minerador_acesso` ( `id` int(11) NOT NULL AUTO_INCREMENT, `banco` varchar(50) COLLATE utf8_unicode_ci NOT NULL, `usuario` varchar(50) COLLATE utf8_unicode_ci NOT NULL, `senha` varchar(50) COLLATE utf8_unicode_ci NOT NULL, `agente` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `disponivel` tinyint(1) NOT NULL DEFAULT '1', `excluido` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_notificacoes_agendamentos' CREATE TABLE `tb_notificacoes_agendamentos` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `data_agendada` date DEFAULT NULL, `celular` varchar(11) COLLATE utf8_unicode_ci DEFAULT NULL, `mensagem` text COLLATE utf8_unicode_ci, `tipo` enum('SMS','WHATSAPP') COLLATE utf8_unicode_ci DEFAULT 'SMS', `data_envio` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY `data_agendada` (`data_agendada`), KEY `data_envio` (`data_envio`) ) ENGINE=InnoDB AUTO_INCREMENT=6173 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_oportunidades_enviadas' CREATE TABLE `tb_oportunidades_enviadas` ( `id` int(11) NOT NULL AUTO_INCREMENT, `cliente_id` int(11) NOT NULL, `tipo_mensagem` varchar(50) NOT NULL, `data_envio` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `usuario_envio` varchar(50) NOT NULL, PRIMARY KEY (`id`), KEY `tb_oportunidades_enviadas_cliente_fk` (`cliente_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- Create syntax for TABLE 'tb_oportunidades_negocios_filtro' CREATE TABLE `tb_oportunidades_negocios_filtro` ( `id` int(11) NOT NULL AUTO_INCREMENT, `descricao` varchar(50) COLLATE utf8_unicode_ci NOT NULL, `margem_de` float(10,2) DEFAULT NULL, `margem_cartao_de` float(10,2) DEFAULT NULL, `parcela_minima` float(10,2) DEFAULT NULL, `possui_telefone` tinyint(2) DEFAULT NULL, `possui_cartao` tinyint(2) DEFAULT NULL, `faixa_etaria_de` int(11) DEFAULT NULL, `faixa_etaria_ate` int(11) DEFAULT NULL, `especies_invalidas` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `limite_higienizar` int(11) DEFAULT NULL, `excluido` tinyint(2) DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_oportunidades_negocios_filtro_corretores' CREATE TABLE `tb_oportunidades_negocios_filtro_corretores` ( `corretor_id` int(11) NOT NULL, `tb_oportunidades_negocios_filtro_id` int(11) NOT NULL, KEY `corretor_id` (`corretor_id`), KEY `tb_oportunidades_negocios_filtro_id` (`tb_oportunidades_negocios_filtro_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_orgaos' CREATE TABLE `tb_orgaos` ( `id` int(11) NOT NULL AUTO_INCREMENT, `descricao` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `excluido` tinyint(2) DEFAULT '0', PRIMARY KEY (`id`), KEY `orgao` (`excluido`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_pacotes_multibr' CREATE TABLE `tb_pacotes_multibr` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `nome` varchar(30) COLLATE utf8_unicode_ci NOT NULL, `valor` decimal(15,2) NOT NULL, `creditos` int(10) unsigned NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `creditos` (`creditos`), UNIQUE KEY `nome` (`nome`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_pendencias_regularizar' CREATE TABLE `tb_pendencias_regularizar` ( `id` int(11) NOT NULL AUTO_INCREMENT, `contrato_id` int(11) NOT NULL, `data_cadastro` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `anexo` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `tipo_documento` int(11) NOT NULL, `validado` tinyint(4) NOT NULL DEFAULT '0', `aceito` tinyint(4) NOT NULL DEFAULT '0', `motivo` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `usuario_abertura` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `usuario_validacao` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `tipo` int(11) DEFAULT NULL, `descricao` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, `contrato_pendencia_id` int(11) DEFAULT NULL, `excluido` tinyint(4) NOT NULL, PRIMARY KEY (`id`), KEY `contrato_id` (`contrato_id`), KEY `excluido` (`excluido`), KEY `usuario_abertura` (`usuario_abertura`), KEY `usuario_validacao` (`usuario_validacao`), KEY `aceito` (`aceito`), KEY `tipo_documento` (`tipo_documento`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_percentual_supervisor' CREATE TABLE `tb_percentual_supervisor` ( `id` int(11) NOT NULL AUTO_INCREMENT, `gerente_id` int(11) NOT NULL, `percentual_de` decimal(15,6) NOT NULL, `percentual_a` decimal(15,6) NOT NULL, `comissao` decimal(15,6) NOT NULL, `banco_id` int(11) NOT NULL, `tabela_id` int(11) NOT NULL, `convenio_id` int(11) NOT NULL, `tipo_produto` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `prazo` int(11) NOT NULL, `data_inicial` date NOT NULL, `data_final` date DEFAULT NULL, `excluido` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `excluido` (`excluido`), KEY `gerente_id` (`gerente_id`), KEY `banco_id` (`banco_id`,`tabela_id`,`convenio_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_performance' CREATE TABLE `tb_performance` ( `id` int(11) NOT NULL AUTO_INCREMENT, `banco_id` int(11) NOT NULL, `convenio_id` int(11) NOT NULL, `percentual` decimal(15,0) NOT NULL, `excluido` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `banco` (`banco_id`,`convenio_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_permissoes' CREATE TABLE `tb_permissoes` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `resource_id` int(11) NOT NULL, `grupo_id` int(11) NOT NULL, `allow` tinyint(1) NOT NULL DEFAULT '0', `excluido` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `resource_id` (`resource_id`,`grupo_id`), KEY `grupo_id` (`grupo_id`) ) ENGINE=InnoDB AUTO_INCREMENT=9424 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_produtos' CREATE TABLE `tb_produtos` ( `id` int(11) NOT NULL AUTO_INCREMENT, `codigo` varchar(50) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', `descricao` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `tipo` varchar(40) COLLATE utf8_unicode_ci DEFAULT 'NOVO', `teto_producao` decimal(15,2) DEFAULT '0.00', `excluido` tinyint(4) NOT NULL DEFAULT '0', `banco_id` int(11) DEFAULT NULL, PRIMARY KEY (`id`), KEY `codigo` (`codigo`,`descricao`,`excluido`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_produtos_comissoes' CREATE TABLE `tb_produtos_comissoes` ( `id` int(11) NOT NULL AUTO_INCREMENT, `produto_id` int(11) NOT NULL, `convenio_id` int(11) NOT NULL, `tabela_id` int(11) NOT NULL, `excluido` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `banco_id` (`produto_id`), KEY `convenio_id` (`convenio_id`), KEY `tabela_id` (`tabela_id`), KEY `excuido` (`excluido`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_produtos_metas_status' CREATE TABLE `tb_produtos_metas_status` ( `id` int(11) NOT NULL AUTO_INCREMENT, `produto_id` int(11) NOT NULL, `status_proposta` int(11) NOT NULL, `excluido` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `status_proposta` (`status_proposta`), KEY `gerente_meta_id` (`produto_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_propostas_documentos' CREATE TABLE `tb_propostas_documentos` ( `id` int(11) NOT NULL AUTO_INCREMENT, `contrato_id` int(11) NOT NULL, `descricao` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `anexo` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `excluido` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `excluido` (`excluido`), KEY `contrato_id` (`contrato_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_prospectos_contatos' CREATE TABLE `tb_prospectos_contatos` ( `id` int(11) NOT NULL AUTO_INCREMENT, `prospecto_id` int(11) NOT NULL, `usuario_id` int(11) NOT NULL, `data_ocorrencia` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `classificacao` int(11) NOT NULL, `data_retorno` date DEFAULT NULL, `motivo` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `comentario` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `nota` int(11) DEFAULT NULL, `corretor_id` int(11) DEFAULT NULL, `contrato_id` int(11) NOT NULL DEFAULT '0', `excluido` tinyint(4) NOT NULL, PRIMARY KEY (`id`), KEY `cliente_id` (`prospecto_id`,`data_ocorrencia`,`classificacao`,`data_retorno`,`excluido`,`usuario_id`), KEY `tb_prospectos_contatos_contrato_id_index` (`contrato_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_protocolo_contrato' CREATE TABLE `tb_protocolo_contrato` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `protocolo_id` int(11) NOT NULL, `contrato_id` int(11) NOT NULL, `valor` decimal(15,2) NOT NULL, `situacao` varchar(25) COLLATE utf8_unicode_ci DEFAULT NULL, `excluido` tinyint(4) NOT NULL DEFAULT '0', `percentual` decimal(15,2) DEFAULT '0.00', `valor_fixo_corretor` decimal(15,2) DEFAULT NULL, `percentual_bonus` decimal(15,2) DEFAULT '0.00', `base_comissao` decimal(15,2) DEFAULT '0.00', `base_bonus` decimal(15,2) DEFAULT '0.00', PRIMARY KEY (`id`), KEY `protocolo_id` (`protocolo_id`), KEY `contrato_id` (`contrato_id`), KEY `excluido` (`excluido`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_protocolo_pagamento' CREATE TABLE `tb_protocolo_pagamento` ( `id` int(11) NOT NULL AUTO_INCREMENT, `corretor_id` int(11) NOT NULL, `data_baixa` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `data_pagamento` date NOT NULL, `comentario` text CHARACTER SET latin1, `desconto` decimal(15,2) DEFAULT NULL, `acrescimo` decimal(15,2) DEFAULT NULL, `forma_pagamento_id` int(11) DEFAULT NULL, `data_quitacao` date DEFAULT NULL, `comprovante_pagamento` varchar(255) CHARACTER SET latin1 DEFAULT NULL, `excluido` tinyint(4) NOT NULL DEFAULT '0', `update_manual` varchar(255) CHARACTER SET latin1 NOT NULL, `banco` varchar(20) CHARACTER SET latin1 DEFAULT NULL, `agencia` varchar(20) CHARACTER SET latin1 DEFAULT NULL, `conta` varchar(20) CHARACTER SET latin1 DEFAULT NULL, `tipo_conta` varchar(2) CHARACTER SET latin1 DEFAULT NULL, `chave_pix` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `liberado_pagamento` tinyint(4) NOT NULL DEFAULT '0', `conta_id` int(11) DEFAULT NULL, `descontar_taxa_transf` tinyint(4) DEFAULT '0', `numero_remessa` int(11) DEFAULT NULL, `codigo_remessa` int(11) DEFAULT NULL, `gerado_remessa` tinyint(4) DEFAULT '0', `taxa_transferencia_banco` decimal(15,2) DEFAULT '0.00', PRIMARY KEY (`id`), KEY `corretor_id` (`corretor_id`), KEY `excluido` (`excluido`), KEY `conta_id` (`conta_id`), KEY `data_pagamento` (`data_pagamento`), KEY `a_liberar` (`data_quitacao`,`liberado_pagamento`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_protocolo_pagamento_gerente' CREATE TABLE `tb_protocolo_pagamento_gerente` ( `id` int(11) NOT NULL AUTO_INCREMENT, `gerente_id` int(11) NOT NULL, `data_baixa` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `data_pagamento` date NOT NULL, `comentario` text CHARACTER SET latin1, `desconto` decimal(15,2) DEFAULT NULL, `acrescimo` decimal(15,2) DEFAULT NULL, `excluido` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `gerente_id` (`gerente_id`), KEY `excluido` (`excluido`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_protocolo_pagamento_gerente_itens' CREATE TABLE `tb_protocolo_pagamento_gerente_itens` ( `id` int(11) NOT NULL AUTO_INCREMENT, `protocolo_id` int(11) NOT NULL, `contrato_id` int(11) NOT NULL, PRIMARY KEY (`id`), KEY `protocolo_id` (`protocolo_id`), KEY `contrato_id` (`contrato_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_protocolo_pagamento_supervisor' CREATE TABLE `tb_protocolo_pagamento_supervisor` ( `id` int(11) NOT NULL AUTO_INCREMENT, `supervisor_id` int(11) NOT NULL, `data_baixa` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `data_pagamento` date NOT NULL, `comentario` text CHARACTER SET latin1, `desconto` decimal(15,2) DEFAULT NULL, `acrescimo` decimal(15,2) DEFAULT NULL, `excluido` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `supervisor_id` (`supervisor_id`), KEY `excluido` (`excluido`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_protocolo_pagamento_supervisor_itens' CREATE TABLE `tb_protocolo_pagamento_supervisor_itens` ( `id` int(11) NOT NULL AUTO_INCREMENT, `protocolo_id` int(11) NOT NULL, `contrato_id` int(11) NOT NULL, `valor_comissao` decimal(15,2) NOT NULL, `excluido` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `protocolo_id` (`protocolo_id`), KEY `contrato_id` (`contrato_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_protocolo_valor_recuperado' CREATE TABLE `tb_protocolo_valor_recuperado` ( `id` int(11) NOT NULL AUTO_INCREMENT, `protocolo_id` int(11) NOT NULL, `valor_a_recuperar_id` varchar(45) COLLATE utf8_unicode_ci NOT NULL, `valor` decimal(15,2) NOT NULL, `excluido` varchar(45) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_recebimento_contratos' CREATE TABLE `tb_recebimento_contratos` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `contrato_id` int(11) NOT NULL, `data_recebimento_comissao` date DEFAULT NULL, `parcelas` int(11) NOT NULL, `comissao_empresa` decimal(15,2) NOT NULL, `rco` decimal(15,2) DEFAULT NULL, `excluido` tinyint(1) NOT NULL DEFAULT '0', `data_saldo` date NOT NULL, `valor_lancamento` decimal(15,2) DEFAULT '0.00', `tipo_remuneracao` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL, `natureza` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, `codigo_tipo_pagamento` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, `descricao` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `valor_comissao_empresa` decimal(15,2) DEFAULT NULL, `importacao_manual` tinyint(3) DEFAULT '0', `valor_comissao_pmt` decimal(15,2) DEFAULT NULL, `tipo_registro_pan` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `base_comissao` decimal(10,2) DEFAULT NULL, PRIMARY KEY (`id`), KEY `excluido` (`excluido`), KEY `contrato_id` (`contrato_id`), KEY `natureza` (`natureza`), KEY `codigo_tipo_pagamento` (`codigo_tipo_pagamento`), KEY `contrato_id_2` (`contrato_id`,`data_saldo`,`valor_lancamento`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_resources' CREATE TABLE `tb_resources` ( `id` int(11) NOT NULL AUTO_INCREMENT, `descricao` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `resource` varchar(45) COLLATE utf8_unicode_ci NOT NULL, `privilege` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `excluido` tinyint(4) NOT NULL DEFAULT '0', `extra` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Não corresponde a um controller/action', PRIMARY KEY (`id`), UNIQUE KEY `UNIQUE` (`resource`,`privilege`) ) ENGINE=InnoDB AUTO_INCREMENT=1236 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_retencao_portabilidade' CREATE TABLE `tb_retencao_portabilidade` ( `id` int(11) NOT NULL AUTO_INCREMENT, `contrato_id` int(11) DEFAULT NULL, `cpf_cliente` varchar(14) DEFAULT NULL, `numero_contrato` varchar(20) DEFAULT NULL, `numero_ade` varchar(20) DEFAULT NULL, `banco_id` int(11) NOT NULL, `saldo` decimal(15,2) DEFAULT NULL, `data_maxima_retencao` date DEFAULT NULL, `estimativa_troco1` decimal(15,2) DEFAULT NULL, `estimativa_troco2` decimal(15,2) DEFAULT NULL, `estimativa_oferta` decimal(15,2) DEFAULT NULL, `matricula` varchar(50) DEFAULT NULL, `codigo_convenio` varchar(255) DEFAULT NULL, `convenio` varchar(100) DEFAULT NULL, `parcela` decimal(15,2) DEFAULT NULL, `qtd_parcelas` int(4) DEFAULT NULL, `taxa_atual` varchar(20) DEFAULT NULL, `taxa_concorrencia` varchar(20) DEFAULT NULL, `nome_cliente` varchar(100) DEFAULT NULL, `qtd_parcelas_abertas` int(4) DEFAULT NULL, `cidade` varchar(100) DEFAULT NULL, `banco` varchar(100) DEFAULT NULL, `uf` varchar(2) DEFAULT NULL, `idade` int(2) DEFAULT NULL, `data_nascimento` date DEFAULT NULL, `codigo_loja` varchar(20) DEFAULT NULL, `corretor_id` int(11) DEFAULT NULL, `digitador` varchar(100) DEFAULT NULL, `nome_loja` varchar(100) DEFAULT NULL, `fone1` varchar(20) DEFAULT NULL, `fone2` varchar(20) DEFAULT NULL, `fone3` varchar(20) DEFAULT NULL, `fone4` varchar(20) DEFAULT NULL, `fone5` varchar(20) DEFAULT NULL, `data_recebimento` date DEFAULT NULL, `situacao` tinyint(2) DEFAULT '0', `excluido` tinyint(2) DEFAULT '0', PRIMARY KEY (`id`), KEY `contrato` (`contrato_id`) USING BTREE, KEY `corretor` (`corretor_id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- Create syntax for TABLE 'tb_rota_token' CREATE TABLE `tb_rota_token` ( `id` int(11) NOT NULL AUTO_INCREMENT, `token` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `rota_id` int(11) NOT NULL, `empresa_id` int(11) NOT NULL, `data_validade` datetime DEFAULT NULL, `excluido` tinyint(2) DEFAULT '0', PRIMARY KEY (`id`), KEY `rota_id` (`rota_id`), KEY `empresa_id` (`empresa_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_rotas' CREATE TABLE `tb_rotas` ( `id` int(11) NOT NULL AUTO_INCREMENT, `nome` varchar(100) CHARACTER SET latin1 NOT NULL, `gerente_id` int(11) NOT NULL, `excluido` tinyint(4) NOT NULL DEFAULT '0', `valor_hospedagem` decimal(15,2) DEFAULT NULL, `valor_refeicao` decimal(15,2) DEFAULT NULL, `valor_combustivel` decimal(15,2) DEFAULT NULL, `consumo_veiculo` decimal(15,2) DEFAULT NULL, PRIMARY KEY (`id`), KEY `excluido` (`excluido`), KEY `gerente_id` (`gerente_id`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_roteiros_operacionais' CREATE TABLE `tb_roteiros_operacionais` ( `id` int(11) NOT NULL AUTO_INCREMENT, `grupo_id` int(11) NOT NULL, `arquivo` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `descricao` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `link` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `banco_id` int(11) DEFAULT NULL, `url` varchar(150) COLLATE utf8_unicode_ci DEFAULT NULL, `ext` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL, `excluido` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `banco_id` (`banco_id`), KEY `grupo_id` (`grupo_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_secretarias' CREATE TABLE `tb_secretarias` ( `id` int(11) NOT NULL AUTO_INCREMENT, `orgao_id` int(11) DEFAULT NULL, `descricao` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `excluido` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `orgao` (`orgao_id`,`excluido`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_setores' CREATE TABLE `tb_setores` ( `id` int(11) NOT NULL AUTO_INCREMENT, `nome` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `setor_pai` int(11) NOT NULL DEFAULT '0', `excluido` tinyint(4) NOT NULL, PRIMARY KEY (`id`), KEY `excluido` (`excluido`), KEY `setor_pai` (`setor_pai`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_simulacao_aberta' CREATE TABLE `tb_simulacao_aberta` ( `id` int(11) NOT NULL AUTO_INCREMENT, `cliente_id` bigint(20) NOT NULL, `tipo_simulacao` varchar(50) NOT NULL, `banco_id` int(11) DEFAULT NULL, `tipo_valor` varchar(10) NOT NULL, `valor` decimal(15,2) NOT NULL, `convenio_id` int(11) NOT NULL, `prazo` int(11) NOT NULL DEFAULT '0', `data_simulacao` timestamp NULL DEFAULT CURRENT_TIMESTAMP, `utm_source` varchar(50) DEFAULT NULL, `utm_medium` varchar(50) DEFAULT NULL, `utm_campaign` varchar(100) DEFAULT NULL, `utm_content` varchar(100) DEFAULT NULL, `utm_term` varchar(100) DEFAULT NULL, `http_referer` varchar(255) DEFAULT NULL, `corretor_id` int(11) DEFAULT NULL, `excluido` tinyint(4) DEFAULT '0', PRIMARY KEY (`id`), KEY `tb_simulacao_aberta_tb_callcenter_base_id_fk` (`cliente_id`), KEY `tb_simulacao_aberta_tb_convenios_id_fk` (`convenio_id`), KEY `corretor_id` (`corretor_id`) ) ENGINE=InnoDB AUTO_INCREMENT=1641 DEFAULT CHARSET=utf8; -- Create syntax for TABLE 'tb_simulacao_aberta_acessos' CREATE TABLE `tb_simulacao_aberta_acessos` ( `id` int(11) NOT NULL AUTO_INCREMENT, `simulacao_id` int(11) NOT NULL, `data_acesso` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`), KEY `tb_simulacao_acessos_tb_simulacao_aberta_id_fk` (`simulacao_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- Create syntax for TABLE 'tb_simulacao_aberta_bancos' CREATE TABLE `tb_simulacao_aberta_bancos` ( `id` int(11) NOT NULL AUTO_INCREMENT, `simulacao_id` int(11) NOT NULL, `banco_id` int(11) NOT NULL, `prazo` int(11) DEFAULT NULL, `valor_credito` decimal(15,2) NOT NULL, `valor_parcela` decimal(15,2) NOT NULL, `atendimento_realizado` tinyint(4) NOT NULL DEFAULT '0', `excluido` tinyint(4) DEFAULT '0', PRIMARY KEY (`id`), KEY `tb_simulacao_aberta_bancos_tb_bancos_id_fk` (`banco_id`), KEY `tb_simulacao_aberta_bancos_tb_simulacao_aberta_id_fk` (`simulacao_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- Create syntax for TABLE 'tb_simulacao_aberta_solicitacoes' CREATE TABLE `tb_simulacao_aberta_solicitacoes` ( `id` int(11) NOT NULL AUTO_INCREMENT, `simulacao_id` int(11) NOT NULL, `simulacao_banco_id` int(11) NOT NULL, `data_solicitacao` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`), KEY `tb_simulacao_aberta_solicitacoes_tb_simulacao_aberta_id_fk` (`simulacao_id`), KEY `tb_simulacao_solicitacoes_tb_simulacao_bancos_id_fk` (`simulacao_banco_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- Create syntax for TABLE 'tb_sinc_yuppies' CREATE TABLE `tb_sinc_yuppies` ( `id` int(11) NOT NULL AUTO_INCREMENT, `corretor_id` int(11) NOT NULL, `token` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `dominio` varchar(50) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'https://sistemayuppie.com.br/', `sistema` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `ultima_sincronizacao` datetime DEFAULT NULL, `subestabelecido_id` int(11) DEFAULT '0', `excluido` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_solicitacao_pac' CREATE TABLE `tb_solicitacao_pac` ( `id` int(11) NOT NULL AUTO_INCREMENT, `data_cadastro` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `nome` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `endereco` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `numero` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL, `cidade` varchar(120) COLLATE utf8_unicode_ci DEFAULT NULL, `bairro` varchar(120) COLLATE utf8_unicode_ci DEFAULT NULL, `uf` char(2) COLLATE utf8_unicode_ci DEFAULT NULL, `cep` varchar(8) COLLATE utf8_unicode_ci DEFAULT NULL, `email` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `celular` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL, `fone` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL, `qtd_contratos` int(11) DEFAULT NULL, `atendido` tinyint(2) DEFAULT '0', `codigo_pac` varchar(140) COLLATE utf8_unicode_ci DEFAULT NULL, `codigo_rastreamento` varchar(140) COLLATE utf8_unicode_ci DEFAULT NULL, `excluido` tinyint(2) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_solicitacao_recurso' CREATE TABLE `tb_solicitacao_recurso` ( `id` int(11) NOT NULL AUTO_INCREMENT, `empresa_id` int(11) NOT NULL, `usuario` int(11) DEFAULT NULL, `tipo_usuario` varchar(20) COLLATE utf8_unicode_ci DEFAULT 'usuario', `cpf_cnpj` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL, `forma_pagamento_id` int(11) DEFAULT NULL, `favorecido` varchar(80) COLLATE utf8_unicode_ci DEFAULT NULL, `valor` decimal(15,2) DEFAULT NULL, `valor_pago` decimal(15,2) DEFAULT NULL, `tipo_pagamento` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `data_solicitacao` date NOT NULL, `banco` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `agencia` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `conta` int(11) DEFAULT NULL, `tipo_conta` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `descricao` text COLLATE utf8_unicode_ci, `usuario_aprovacao` int(11) DEFAULT NULL, `data_aprovacao` date DEFAULT NULL, `data_pagamento` date DEFAULT NULL, `data_cancelamento` date DEFAULT NULL, `usuario_cancelamento` int(11) DEFAULT NULL, `motivo_cancelamento` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `usuario_pagamento` int(11) DEFAULT NULL, `prazo` date DEFAULT NULL, `rota_id` int(11) NOT NULL, `periodo_de` date NOT NULL, `periodo_a` date NOT NULL, `excluido` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `empresa_id` (`empresa_id`,`usuario`,`cpf_cnpj`,`forma_pagamento_id`,`banco`,`usuario_cancelamento`,`usuario_pagamento`), KEY `usuario_aprovacao` (`usuario_aprovacao`), KEY `tipo_usuario` (`tipo_usuario`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_tabelas' CREATE TABLE `tb_tabelas` ( `id` int(11) NOT NULL AUTO_INCREMENT, `parent_id` int(11) DEFAULT NULL, `convenio_id` int(11) DEFAULT NULL, `banco_id` int(11) DEFAULT NULL, `codigo` varchar(20) CHARACTER SET latin1 DEFAULT NULL, `nome` varchar(100) CHARACTER SET latin1 NOT NULL, `campanha` tinyint(4) DEFAULT '0', `produto` varchar(20) CHARACTER SET latin1 DEFAULT NULL, `data_cadastro` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `importacao` tinyint(4) DEFAULT '0', `tabela_desativada` tinyint(1) DEFAULT '0', `data_desativacao` date DEFAULT NULL, `excluido` tinyint(4) NOT NULL DEFAULT '0', `tipo_formalizacao` int(11) DEFAULT '0', `informacao_adicional` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `nome` (`nome`,`excluido`), KEY `convenio_id` (`convenio_id`), KEY `produto` (`produto`), KEY `parent_id` (`parent_id`), KEY `banco_id` (`banco_id`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_tabelas_fatores' CREATE TABLE `tb_tabelas_fatores` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `banco_id` int(11) NOT NULL, `tabela_id` int(11) NOT NULL, `convenio_id` int(11) NOT NULL, `tipo` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, `prazo` int(10) unsigned NOT NULL, `fator` double NOT NULL, `dia` int(10) unsigned DEFAULT NULL, `limite_saque` decimal(5,2) DEFAULT '0.00', `excluido` int(1) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `excluido` (`excluido`), KEY `banco_id` (`banco_id`), KEY `tabela_id` (`tabela_id`), KEY `convenio_id` (`convenio_id`), KEY `tipo` (`tipo`), KEY `prazo` (`prazo`), KEY `dia` (`dia`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_termo_responsabilidade' CREATE TABLE `tb_termo_responsabilidade` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `descricao` varchar(60) COLLATE utf8_unicode_ci DEFAULT NULL, `texto` text COLLATE utf8_unicode_ci NOT NULL, `excluido` tinyint(1) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `descricao` (`descricao`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_tipos' CREATE TABLE `tb_tipos` ( `id` int(11) NOT NULL AUTO_INCREMENT, `descricao` varchar(100) COLLATE utf8_unicode_ci NOT NULL, `tipo` varchar(50) COLLATE utf8_unicode_ci NOT NULL, `codigo` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `parent_id` int(11) DEFAULT NULL, `bloquear` tinyint(2) NOT NULL DEFAULT '0', `excluido` tinyint(4) NOT NULL DEFAULT '0', `desativar_cliente_callcenter` tinyint(3) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `excluido` (`excluido`), KEY `codigo` (`codigo`), KEY `descricao` (`descricao`,`tipo`), KEY `parent_id` (`parent_id`), KEY `desativar_cliente_callcenter` (`desativar_cliente_callcenter`), KEY `desativar_cliente_callcenter_2` (`desativar_cliente_callcenter`), KEY `descricao_2` (`descricao`) ) ENGINE=InnoDB AUTO_INCREMENT=610 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_tipos_produtos' CREATE TABLE `tb_tipos_produtos` ( `id` int(11) NOT NULL AUTO_INCREMENT, `descricao` varchar(100) CHARACTER SET latin1 DEFAULT NULL, `teto_producao` decimal(15,2) DEFAULT '0.00', `excluido` tinyint(2) DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_tipos_produtos_metas_status' CREATE TABLE `tb_tipos_produtos_metas_status` ( `id` int(11) NOT NULL AUTO_INCREMENT, `tipo_produto_id` int(11) NOT NULL, `status_proposta` int(11) NOT NULL, `excluido` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `status_proposta` (`status_proposta`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_usuarios' CREATE TABLE `tb_usuarios` ( `id` int(11) NOT NULL AUTO_INCREMENT, `grupo_id` int(11) NOT NULL, `empresa_id` int(11) NOT NULL, `corretor_id` int(11) DEFAULT NULL, `funcionario_id` int(11) DEFAULT '0', `nome` varchar(100) CHARACTER SET latin1 DEFAULT NULL, `email` varchar(100) CHARACTER SET latin1 DEFAULT NULL, `login` varchar(50) CHARACTER SET latin1 NOT NULL, `senha` varchar(100) CHARACTER SET latin1 NOT NULL, `ip` varchar(15) CHARACTER SET latin1 DEFAULT NULL, `ramal_numero` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, `ramal_login` varchar(20) CHARACTER SET latin1 DEFAULT NULL, `ramal_senha` varchar(20) CHARACTER SET latin1 DEFAULT NULL, `ramal_status` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `excluido` int(11) NOT NULL, `hora_inicio` varchar(5) CHARACTER SET latin1 NOT NULL DEFAULT '08:00', `hora_fim` varchar(5) CHARACTER SET latin1 NOT NULL DEFAULT '18:00', `dias` varchar(13) CHARACTER SET latin1 NOT NULL, `receber_email_copia` tinyint(2) DEFAULT '0', `email_copia` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `parent_corretor` int(11) DEFAULT NULL, `bater_ponto` int(11) DEFAULT '0', `assuntos_chamado` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `assuntos_proposta` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `assuntos_simulacao` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `discador_id` int(11) DEFAULT NULL, `desativado` tinyint(2) DEFAULT '0', `token_reset_senha` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, `data_request_reset` date DEFAULT NULL, PRIMARY KEY (`id`), KEY `parent_corretor` (`parent_corretor`), KEY `excluido` (`excluido`), KEY `grupo_id` (`grupo_id`), KEY `empresa_id` (`empresa_id`), KEY `corretor_id` (`corretor_id`), KEY `login` (`login`,`senha`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_usuarios_equipe' CREATE TABLE `tb_usuarios_equipe` ( `id` int(11) NOT NULL AUTO_INCREMENT, `usuario_id` int(11) NOT NULL, `supervisor_id` int(11) NOT NULL, `corretor_id` int(11) NOT NULL, `data_cadastro` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `excluido` tinyint(2) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `usuario_id` (`usuario_id`,`supervisor_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_usuarios_rede_atendimento' CREATE TABLE `tb_usuarios_rede_atendimento` ( `id` int(11) NOT NULL AUTO_INCREMENT, `usuario_id` int(11) NOT NULL, `supervisor_id` int(11) NOT NULL, `corretor_id` int(11) NOT NULL, `data_cadastro` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `excluido` tinyint(2) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `usuario_id` (`usuario_id`,`supervisor_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_valores_a_recuperar' CREATE TABLE `tb_valores_a_recuperar` ( `id` int(11) NOT NULL AUTO_INCREMENT, `contrato_id` int(11) NOT NULL, `valor` decimal(15,2) NOT NULL, `excluido` varchar(45) CHARACTER SET latin1 NOT NULL DEFAULT '0', `motivo` mediumtext CHARACTER SET latin1 NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tb_visitas_rota' CREATE TABLE `tb_visitas_rota` ( `id` int(11) NOT NULL AUTO_INCREMENT, `rota_id` int(11) NOT NULL, `corretor_id` int(11) NOT NULL, `cidade` varchar(45) CHARACTER SET latin1 DEFAULT NULL, `uf` varchar(45) CHARACTER SET latin1 DEFAULT NULL, `resumo` text COLLATE utf8_unicode_ci, `data` date DEFAULT NULL, `excluido` tinyint(4) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for TABLE 'tmp_import_callcenter' CREATE TABLE `tmp_import_callcenter` ( `nome` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `matricula` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `cpf` varchar(18) COLLATE utf8_unicode_ci DEFAULT NULL, `data_nascimento` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `endereco` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `numero` int(11) DEFAULT NULL, `complemento` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `bairro` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `cidade` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `uf` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `cep` varchar(8) COLLATE utf8_unicode_ci DEFAULT NULL, `email1` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `email2` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `email3` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `ddd1` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, `telefone1` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `ddd2` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, `telefone2` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `ddd3` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, `telefone3` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `ddd4` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, `telefone4` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `ddd5` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, `telefone5` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `ddd6` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, `telefone6` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `ddd7` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, `telefone7` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `ddd8` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, `telefone8` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `ddd9` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, `telefone9` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `ddd10` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL, `telefone10` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `banco_emprestimo` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `qtd_parcelas` int(11) DEFAULT NULL, `valor_parcela` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `digito_cpf` varchar(2) COLLATE utf8_unicode_ci DEFAULT NULL, `margem_livre` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `valor_saque` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `senha_contra_cheque` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `valor_beneficio` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `banco_beneficio` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `orgao` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, `inicio_contrato` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `termino_contrato` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `numero_contrato` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `valor_emprestimo` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `especie` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `sigla_upg` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, `cargo` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, `qtd_parcelas_pagas` int(11) DEFAULT NULL, `taxa` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `data_quitacao` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `saldo` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `empregador` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, `promotora` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, `gerente` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, `descricao_cbo` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, `comentario` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `secretaria` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `razao_social` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `nome_responsavel` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `cpf_responsavel` varchar(18) COLLATE utf8_unicode_ci DEFAULT NULL, `tipo_pessoa` varchar(10) COLLATE utf8_unicode_ci DEFAULT 'fisica', `margem_bens_duraveis` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, `rg` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL, `nome_mae` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `nome_pai` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `dib` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- Create syntax for VIEW 'vw_afiliados' CREATE VIEW `vw_afiliados` AS SELECT `tb_corretores`.`id` AS `id`, `tb_corretores`.`data_cadastro` AS `data_cadastro`, `tb_corretores`.`data_ultima_atualizacao` AS `data_ultima_atualizacao`, `tb_corretores`.`empresa_id` AS `empresa_id`, `tb_corretores`.`tipo` AS `tipo`, `tb_corretores`.`rota_id` AS `rota_id`, `tb_corretores`.`nome` AS `nome`, `tb_corretores`.`cpf` AS `cpf`, `tb_corretores`.`rg` AS `rg`, `tb_corretores`.`orgao_expedidor` AS `orgao_expedidor`, `tb_corretores`.`data_nascimento` AS `data_nascimento`, `tb_corretores`.`endereco` AS `endereco`, `tb_corretores`.`numero` AS `numero`, `tb_corretores`.`complemento` AS `complemento`, `tb_corretores`.`bairro` AS `bairro`, `tb_corretores`.`cidade` AS `cidade`, `tb_corretores`.`uf` AS `uf`, `tb_corretores`.`cep` AS `cep`, `tb_corretores`.`banco` AS `banco`, `tb_corretores`.`agencia` AS `agencia`, `tb_corretores`.`conta` AS `conta`, `tb_corretores`.`titular` AS `titular`, `tb_corretores`.`cpf_titular` AS `cpf_titular`, `tb_corretores`.`tipo_conta` AS `tipo_conta`, `tb_corretores`.`chave_pix` AS `chave_pix`, `tb_corretores`.`dados_banco_alterado` AS `dados_banco_alterado`, `tb_corretores`.`obs` AS `obs`, `tb_corretores`.`nome_mae` AS `nome_mae`, `tb_corretores`.`apelido` AS `apelido`, `tb_corretores`.`celular` AS `celular`, `tb_corretores`.`email` AS `email`, `tb_corretores`.`fax` AS `fax`, `tb_corretores`.`site` AS `site`, `tb_corretores`.`telefone_residencial` AS `telefone_residencial`, `tb_corretores`.`telefone_comercial` AS `telefone_comercial`, `tb_corretores`.`twitter` AS `twitter`, `tb_corretores`.`grupo_comissao` AS `grupo_comissao`, `tb_corretores`.`login` AS `login`, `tb_corretores`.`senha` AS `senha`, `tb_corretores`.`prazo_fisico` AS `prazo_fisico`, `tb_corretores`.`bloquear_pagamento` AS `bloquear_pagamento`, `tb_corretores`.`motivo` AS `motivo`, `tb_corretores`.`corretor_desativado` AS `corretor_desativado`, `tb_corretores`.`obedecer_id` AS `obedecer_id`, `tb_corretores`.`mudar_senha` AS `mudar_senha`, `tb_corretores`.`data_alteracao_senha` AS `data_alteracao_senha`, `tb_corretores`.`descontar_taxa_transf` AS `descontar_taxa_transf`, `tb_corretores`.`token_aplicativo` AS `token_aplicativo`, `tb_corretores`.`acesso_aplicativo` AS `acesso_aplicativo`, `tb_corretores`.`att_dados_corretor` AS `att_dados_corretor`, `tb_corretores`.`id_mobile_token` AS `id_mobile_token`, `tb_corretores`.`acesso_temporario` AS `acesso_temporario`, `tb_corretores`.`data_temporario_app` AS `data_temporario_app`, `tb_corretores`.`permitir_sinc_yuppies` AS `permitir_sinc_yuppies`, `tb_corretores`.`token_sinc_yuppies` AS `token_sinc_yuppies`, `tb_corretores`.`ip` AS `ip`, `tb_corretores`.`nivel_esteira` AS `nivel_esteira`, `tb_corretores`.`tipo_venda` AS `tipo_venda`, `tb_corretores`.`excluido` AS `excluido`, `tb_corretores`.`dias_bloqueio_producao` AS `dias_bloqueio_producao`, `tb_corretores`.`percentual_corte` AS `percentual_corte`, `tb_corretores`.`potencial_venda` AS `potencial_venda`, `tb_corretores`.`numero_certificado` AS `numero_certificado`, `tb_corretores`.`validade_certificado` AS `validade_certificado`, `tb_corretores`.`token_reset_senha` AS `token_reset_senha`, `tb_corretores`.`data_request_reset` AS `data_request_reset`, `tb_corretores`.`status_cadastro` AS `status_cadastro`, `tb_corretores`.`automatizacao_oportunidades_negocios` AS `automatizacao_oportunidades_negocios`, `tb_corretores`.`oportunidades_negocios_filtro_id` AS `oportunidades_negocios_filtro_id`, `tb_corretores`.`grupo_acesso` AS `grupo_acesso` FROM `tb_corretores` where ((`tb_corretores`.`grupo_acesso` = 4) and (`tb_corretores`.`excluido` <> 1)); -- Create syntax for VIEW 'vw_clientes' CREATE VIEW `vw_clientes` AS SELECT `tb_clientes`.`id` AS `id`, `tb_clientes`.`empresa_id` AS `empresa_id`, `tb_clientes`.`nome` AS `nome`, `tb_clientes`.`cpf` AS `cpf`, `tb_clientes`.`rg` AS `rg`, `tb_clientes`.`orgao_expedidor` AS `orgao_expedidor`, `tb_clientes`.`data_nascimento` AS `data_nascimento`, `tb_clientes`.`nome_pai` AS `nome_pai`, `tb_clientes`.`nome_mae` AS `nome_mae`, `tb_clientes`.`conjuge` AS `conjuge`, `tb_clientes`.`endereco` AS `endereco`, `tb_clientes`.`complemento` AS `complemento`, `tb_clientes`.`bairro` AS `bairro`, `tb_clientes`.`cidade` AS `cidade`, `tb_clientes`.`uf` AS `uf`, `tb_clientes`.`cep` AS `cep`, `tb_clientes`.`email` AS `email`, `tb_clientes`.`celular` AS `celular`, `tb_clientes`.`fax` AS `fax`, `tb_clientes`.`fone` AS `fone`, `tb_clientes`.`telefone_comercial` AS `telefone_comercial`, `tb_clientes`.`obs` AS `obs`, `tb_clientes`.`excluido` AS `excluido` FROM `tb_clientes` where (`tb_clientes`.`excluido` <> 1); -- Create syntax for VIEW 'vw_comissoes' CREATE VIEW `vw_comissoes` AS SELECT `tb_comissoes`.`id` AS `id`, `tb_comissoes`.`empresa_id` AS `empresa_id`, `tb_comissoes`.`corretor_id` AS `corretor_id`, `tb_comissoes`.`contrato_id` AS `contrato_id`, `tb_comissoes`.`data_pagamento` AS `data_pagamento`, `tb_comissoes`.`data_cadastro` AS `data_cadastro`, `tb_comissoes`.`obs` AS `obs`, `tb_comissoes`.`excluido` AS `excluido` FROM `tb_comissoes` where (`tb_comissoes`.`excluido` <> 1); -- Create syntax for VIEW 'vw_convenios' CREATE VIEW `vw_convenios` AS SELECT `tb_convenios`.`id` AS `id`, `tb_convenios`.`nome` AS `nome`, `tb_convenios`.`excluido` AS `excluido` FROM `tb_convenios` where (`tb_convenios`.`excluido` <> 1); -- Create syntax for VIEW 'vw_corretores' CREATE VIEW `vw_corretores` AS SELECT `tb_corretores`.`id` AS `id`, `tb_corretores`.`data_cadastro` AS `data_cadastro`, `tb_corretores`.`empresa_id` AS `empresa_id`, `tb_corretores`.`tipo` AS `tipo`, `tb_corretores`.`rota_id` AS `rota_id`, `tb_corretores`.`nome` AS `nome`, `tb_corretores`.`cpf` AS `cpf`, `tb_corretores`.`rg` AS `rg`, `tb_corretores`.`orgao_expedidor` AS `orgao_expedidor`, `tb_corretores`.`data_nascimento` AS `data_nascimento`, `tb_corretores`.`endereco` AS `endereco`, `tb_corretores`.`complemento` AS `complemento`, `tb_corretores`.`bairro` AS `bairro`, `tb_corretores`.`cidade` AS `cidade`, `tb_corretores`.`uf` AS `uf`, `tb_corretores`.`cep` AS `cep`, `tb_corretores`.`banco` AS `banco`, `tb_corretores`.`agencia` AS `agencia`, `tb_corretores`.`conta` AS `conta`, `tb_corretores`.`titular` AS `titular`, `tb_corretores`.`cpf_titular` AS `cpf_titular`, `tb_corretores`.`tipo_conta` AS `tipo_conta`, `tb_corretores`.`obs` AS `obs`, `tb_corretores`.`excluido` AS `excluido`, `tb_corretores`.`apelido` AS `apelido`, `tb_corretores`.`celular` AS `celular`, `tb_corretores`.`email` AS `email`, `tb_corretores`.`fax` AS `fax`, `tb_corretores`.`site` AS `site`, `tb_corretores`.`telefone_residencial` AS `telefone_residencial`, `tb_corretores`.`telefone_comercial` AS `telefone_comercial`, `tb_corretores`.`twitter` AS `twitter`, `tb_corretores`.`login` AS `login`, `tb_corretores`.`ip` AS `ip`,(case when (`tb_corretores`.`bloquear_pagamento` > 0) then 1 when ((`tb_corretores`.`dias_bloqueio_producao` > 0) and (max(`tb_contratos`.`data_emissao`) < (select (curdate() - interval `tb_corretores`.`dias_bloqueio_producao` day)))) then 1 when ((`tb_corretores`.`dias_bloqueio_producao` > 0) and isnull(`tb_contratos`.`data_emissao`) and (`tb_corretores`.`data_cadastro` < (select (curdate() - interval `tb_corretores`.`dias_bloqueio_producao` day)))) then 1 else 0 end) AS `bloquear_pagamento`, `tb_corretores`.`numero_certificado` AS `numero_certificado`, `tb_corretores`.`validade_certificado` AS `validade_certificado` FROM (`tb_corretores` left join `tb_contratos` on(((`tb_corretores`.`id` = `tb_contratos`.`corretor_id`) and (`tb_contratos`.`excluido` <> 1)))) where (`tb_corretores`.`excluido` <> 1) group by `tb_corretores`.`id`; -- Create syntax for VIEW 'vw_corretores_entrada' CREATE VIEW `vw_corretores_entrada` AS SELECT `tb_corretores`.`id` AS `id`, `tb_corretores`.`data_cadastro` AS `data_cadastro`, `tb_corretores`.`data_ultima_atualizacao` AS `data_ultima_atualizacao`, `tb_corretores`.`empresa_id` AS `empresa_id`, `tb_corretores`.`tipo` AS `tipo`, `tb_corretores`.`rota_id` AS `rota_id`, `tb_corretores`.`nome` AS `nome`, `tb_corretores`.`cpf` AS `cpf`, `tb_corretores`.`rg` AS `rg`, `tb_corretores`.`orgao_expedidor` AS `orgao_expedidor`, `tb_corretores`.`data_nascimento` AS `data_nascimento`, `tb_corretores`.`endereco` AS `endereco`, `tb_corretores`.`numero` AS `numero`, `tb_corretores`.`complemento` AS `complemento`, `tb_corretores`.`bairro` AS `bairro`, `tb_corretores`.`cidade` AS `cidade`, `tb_corretores`.`uf` AS `uf`, `tb_corretores`.`cep` AS `cep`, `tb_corretores`.`banco` AS `banco`, `tb_corretores`.`agencia` AS `agencia`, `tb_corretores`.`conta` AS `conta`, `tb_corretores`.`titular` AS `titular`, `tb_corretores`.`cpf_titular` AS `cpf_titular`, `tb_corretores`.`tipo_conta` AS `tipo_conta`, `tb_corretores`.`chave_pix` AS `chave_pix`, `tb_corretores`.`dados_banco_alterado` AS `dados_banco_alterado`, `tb_corretores`.`obs` AS `obs`, `tb_corretores`.`nome_mae` AS `nome_mae`, `tb_corretores`.`apelido` AS `apelido`, `tb_corretores`.`celular` AS `celular`, `tb_corretores`.`email` AS `email`, `tb_corretores`.`fax` AS `fax`, `tb_corretores`.`site` AS `site`, `tb_corretores`.`telefone_residencial` AS `telefone_residencial`, `tb_corretores`.`telefone_comercial` AS `telefone_comercial`, `tb_corretores`.`twitter` AS `twitter`, `tb_corretores`.`grupo_comissao` AS `grupo_comissao`, `tb_corretores`.`login` AS `login`, `tb_corretores`.`senha` AS `senha`, `tb_corretores`.`prazo_fisico` AS `prazo_fisico`, `tb_corretores`.`bloquear_pagamento` AS `bloquear_pagamento`, `tb_corretores`.`motivo` AS `motivo`, `tb_corretores`.`corretor_desativado` AS `corretor_desativado`, `tb_corretores`.`obedecer_id` AS `obedecer_id`, `tb_corretores`.`mudar_senha` AS `mudar_senha`, `tb_corretores`.`data_alteracao_senha` AS `data_alteracao_senha`, `tb_corretores`.`descontar_taxa_transf` AS `descontar_taxa_transf`, `tb_corretores`.`token_aplicativo` AS `token_aplicativo`, `tb_corretores`.`acesso_aplicativo` AS `acesso_aplicativo`, `tb_corretores`.`att_dados_corretor` AS `att_dados_corretor`, `tb_corretores`.`id_mobile_token` AS `id_mobile_token`, `tb_corretores`.`acesso_temporario` AS `acesso_temporario`, `tb_corretores`.`data_temporario_app` AS `data_temporario_app`, `tb_corretores`.`permitir_sinc_yuppies` AS `permitir_sinc_yuppies`, `tb_corretores`.`token_sinc_yuppies` AS `token_sinc_yuppies`, `tb_corretores`.`ip` AS `ip`, `tb_corretores`.`nivel_esteira` AS `nivel_esteira`, `tb_corretores`.`tipo_venda` AS `tipo_venda`, `tb_corretores`.`excluido` AS `excluido`, `tb_corretores`.`dias_bloqueio_producao` AS `dias_bloqueio_producao`, `tb_corretores`.`percentual_corte` AS `percentual_corte`, `tb_corretores`.`potencial_venda` AS `potencial_venda`, `tb_corretores`.`numero_certificado` AS `numero_certificado`, `tb_corretores`.`validade_certificado` AS `validade_certificado`, `tb_corretores`.`token_reset_senha` AS `token_reset_senha`, `tb_corretores`.`data_request_reset` AS `data_request_reset`, `tb_corretores`.`status_cadastro` AS `status_cadastro`, `tb_corretores`.`automatizacao_oportunidades_negocios` AS `automatizacao_oportunidades_negocios`, `tb_corretores`.`oportunidades_negocios_filtro_id` AS `oportunidades_negocios_filtro_id`, `tb_corretores`.`grupo_acesso` AS `grupo_acesso` FROM `tb_corretores` where ((`tb_corretores`.`grupo_acesso` = 1) and (`tb_corretores`.`excluido` <> 1)); -- Create syntax for VIEW 'vw_empresas' CREATE VIEW `vw_empresas` AS SELECT `tb_empresas`.`id` AS `id`, `tb_empresas`.`nome` AS `nome`, `tb_empresas`.`razao_social` AS `razao_social`, `tb_empresas`.`cnpj` AS `cnpj`, `tb_empresas`.`data_cadastro` AS `data_cadastro`, `tb_empresas`.`responsavel` AS `responsavel`, `tb_empresas`.`cpf_responsavel` AS `cpf_responsavel`, `tb_empresas`.`cep` AS `cep`, `tb_empresas`.`endereco` AS `endereco`, `tb_empresas`.`bairro` AS `bairro`, `tb_empresas`.`cidade` AS `cidade`, `tb_empresas`.`uf` AS `uf`, `tb_empresas`.`complemento` AS `complemento`, `tb_empresas`.`email` AS `email`, `tb_empresas`.`celular` AS `celular`, `tb_empresas`.`fax` AS `fax`, `tb_empresas`.`fone` AS `fone`, `tb_empresas`.`obs` AS `obs`, `tb_empresas`.`excluido` AS `excluido` FROM `tb_empresas` where (`tb_empresas`.`excluido` <> 1); -- Create syntax for VIEW 'vw_fornecedores' CREATE VIEW `vw_fornecedores` AS SELECT `tb_fornecedores`.`id` AS `id`, `tb_fornecedores`.`nome` AS `nome`, `tb_fornecedores`.`razao_social` AS `razao_social`, `tb_fornecedores`.`cnpj` AS `cnpj`, `tb_fornecedores`.`data_cadastro` AS `data_cadastro`, `tb_fornecedores`.`responsavel` AS `responsavel`, `tb_fornecedores`.`cpf_responsavel` AS `cpf_responsavel`, `tb_fornecedores`.`cep` AS `cep`, `tb_fornecedores`.`endereco` AS `endereco`, `tb_fornecedores`.`bairro` AS `bairro`, `tb_fornecedores`.`cidade` AS `cidade`, `tb_fornecedores`.`uf` AS `uf`, `tb_fornecedores`.`complemento` AS `complemento`, `tb_fornecedores`.`email` AS `email`, `tb_fornecedores`.`celular` AS `celular`, `tb_fornecedores`.`fax` AS `fax`, `tb_fornecedores`.`fone` AS `fone`, `tb_fornecedores`.`obs` AS `obs`, `tb_fornecedores`.`excluido` AS `excluido` FROM `tb_fornecedores` where (`tb_fornecedores`.`excluido` <> 1); -- Create syntax for VIEW 'vw_lancamentos' CREATE VIEW `vw_lancamentos` AS SELECT `tb_lancamentos`.`id` AS `id`, `tb_lancamentos`.`empresa_id` AS `empresa_id`, `tb_lancamentos`.`categoria_id` AS `categoria_id`, `tb_lancamentos`.`conta_id` AS `conta_id`, `tb_lancamentos`.`forma_pagamento_id` AS `forma_pagamento_id`, `tb_lancamentos`.`fornecedor_id` AS `fornecedor_id`, `tb_lancamentos`.`corretor_id` AS `corretor_id`, `tb_lancamentos`.`data_lancamento` AS `data_lancamento`, `tb_lancamentos`.`descricao` AS `descricao`, `tb_lancamentos`.`valor` AS `valor`, `tb_lancamentos`.`data_vencimento` AS `data_vencimento`, `tb_lancamentos`.`valor_pago` AS `valor_pago`, `tb_lancamentos`.`data_pagamento` AS `data_pagamento`, `tb_lancamentos`.`obs` AS `obs`, `tb_lancamentos`.`usuario_baixa` AS `usuario_baixa`, `tb_lancamentos`.`data_baixa` AS `data_baixa`, `tb_lancamentos`.`tipo` AS `tipo`, `tb_lancamentos`.`excluido` AS `excluido` FROM `tb_lancamentos` where (`tb_lancamentos`.`excluido` <> 1); -- Create syntax for VIEW 'vw_protocolos_pagamento' CREATE VIEW `vw_protocolos_pagamento` AS SELECT `tb_protocolo_pagamento`.`id` AS `id`, `tb_protocolo_pagamento`.`corretor_id` AS `corretor_id`, `tb_protocolo_pagamento`.`data_baixa` AS `data_baixa`, `tb_protocolo_pagamento`.`data_pagamento` AS `data_pagamento`, `tb_protocolo_pagamento`.`comentario` AS `comentario`, `tb_protocolo_pagamento`.`desconto` AS `desconto`, `tb_protocolo_pagamento`.`acrescimo` AS `acrescimo`, `tb_protocolo_pagamento`.`excluido` AS `excluido` FROM `tb_protocolo_pagamento` where (`tb_protocolo_pagamento`.`excluido` <> 1); -- Create syntax for VIEW 'vw_rotas' CREATE VIEW `vw_rotas` AS SELECT `tb_rotas`.`id` AS `id`, `tb_rotas`.`nome` AS `nome`, `tb_rotas`.`gerente_id` AS `gerente_id`, `tb_rotas`.`excluido` AS `excluido` FROM `tb_rotas` where (`tb_rotas`.`excluido` <> 1); -- Create syntax for VIEW 'vw_tabelas' CREATE VIEW `vw_tabelas` AS SELECT `tb_tabelas`.`id` AS `id`, `tb_tabelas`.`nome` AS `nome`, `tb_tabelas`.`campanha` AS `campanha`, `tb_tabelas`.`excluido` AS `excluido` FROM `tb_tabelas` where (`tb_tabelas`.`excluido` <> 1); -- Create syntax for VIEW 'vw_tipos' CREATE VIEW `vw_tipos` AS SELECT `tb_tipos`.`id` AS `id`, `tb_tipos`.`descricao` AS `descricao`, `tb_tipos`.`tipo` AS `tipo`, `tb_tipos`.`codigo` AS `codigo`, `tb_tipos`.`excluido` AS `excluido` FROM `tb_tipos` where (`tb_tipos`.`excluido` <> 1); -- Create syntax for VIEW 'vw_usuarios' CREATE VIEW `vw_usuarios` AS SELECT `u`.`id` AS `id`, `u`.`grupo_id` AS `grupo_id`, `u`.`empresa_id` AS `empresa_id`, `u`.`corretor_id` AS `corretor_id`, `u`.`funcionario_id` AS `funcionario_id`, `u`.`nome` AS `nome`, `u`.`email` AS `email`, `u`.`login` AS `login`, `u`.`senha` AS `senha`, `u`.`ip` AS `ip`, `u`.`ramal_numero` AS `ramal_numero`, `u`.`ramal_login` AS `ramal_login`, `u`.`ramal_senha` AS `ramal_senha`, `u`.`ramal_status` AS `ramal_status`, `u`.`excluido` AS `excluido`, `u`.`hora_inicio` AS `hora_inicio`, `u`.`hora_fim` AS `hora_fim`, `u`.`dias` AS `dias`, `u`.`receber_email_copia` AS `receber_email_copia`, `u`.`email_copia` AS `email_copia`, `u`.`parent_corretor` AS `parent_corretor`, `u`.`bater_ponto` AS `bater_ponto`, `u`.`assuntos_chamado` AS `assuntos_chamado`, `u`.`assuntos_simulacao` AS `assuntos_simulacao`, `u`.`assuntos_proposta` AS `assuntos_proposta`, `u`.`discador_id` AS `discador_id`, `u`.`desativado` AS `desativado`, `gu`.`nome` AS `grupo`, `gu`.`email` AS `email_grupo`, `gu`.`forma_equipe` AS `forma_equipe` FROM (`tb_usuarios` `u` join `tb_grupos_usuarios` `gu` on((`gu`.`id` = `u`.`grupo_id`))) where ((`gu`.`excluido` <> 1) and (`u`.`excluido` <> 1) and (`u`.`desativado` <> 1));
💾 保存文件
← 返回文件管理器