✏️ 正在编辑: 2186.sql
路径:
/srv/systems_dir/yuppiecred/data/database/2186.sql
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
alter table tb_corretores add dias_bloqueio_producao int default 0 NULL; create or replace 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 SUBDATE(CURDATE(), `tb_corretores`.`dias_bloqueio_producao`)) THEN 1 WHEN tb_corretores.dias_bloqueio_producao > 0 AND `data_emissao` IS NULL AND tb_corretores.data_cadastro < (SELECT SUBDATE(CURDATE(), tb_corretores.dias_bloqueio_producao)) THEN 1 ELSE 0 END AS bloquear_pagamento 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`;
💾 保存文件
← 返回文件管理器