string(2306) " FROM (SELECT S.IdSecretarias, S.Descricao, CONCAT( (case WHEN S.EndRua is null or S.EndRua = '' then '' else CONCAT('

Endereço: ',S.EndRua,', N.',S.EndNum,' - ',S.EndBairro, '

') end ) , (case WHEN S.Email is null or S.Email = '' then '' else CONCAT('

E-mail: ', S.Email, '

') end ) , (case WHEN COALESCE(S.Tel1, S.Tel2, S.Tel3) is null OR COALESCE(S.Tel1, S.Tel2, S.Tel3) = ' ' then '' ELSE CONCAT('

Telefones: ', INSERT(INSERT(INSERT(COALESCE(S.Tel1, ''), 7, 0, '-'), 1, 0, '(' ), 4, 0, ') ' ), INSERT(INSERT(INSERT(COALESCE(S.Tel2, ''), 7, 0, '-'), 1, 0, '(' ), 4, 0, ') ' ), INSERT(INSERT(INSERT(COALESCE(S.Tel3, ''), 7, 0, '-'), 1, 0, '(' ), 4, 0, ') ' ), COALESCE(telfree, ''), '

') end ), (case WHEN S.RamalSec is null or S.RamalSec = '' then '' else CONCAT('

Ramal: ',S.RamalSec, '

') end), (case WHEN S.HorarioFunciona is null or S.HorarioFunciona = '' then '' else CONCAT('

Horário de Atendimento ao público: ',S.HorarioFunciona, '

') end) ) AS Informacoes, '4' AS NTipo, Longitud, Latitude FROM TabSecretarias S WHERE (S.MostrarSec <> 'N' OR S.MostrarSec <> '') AND (S.DataFim IS null OR S.DataFim > '2024-12-05') UNION ALL SELECT IdSaudeunidade AS IdSecretarias, NomeCompleto AS Descricao, (case WHEN EndRua is null or EndRua = '' then '' else CONCAT(' ',EndRua,', N.',EndNum,' - ',EndBairro) end ) AS Informacaoes, NTipo, Longitude AS Longitud, Latitude FROM tabsaudeunidade) AS CONTATOS "