SELECT
  a.id,
  a.created_at,
  a.usuario_id,
  u.nome AS usuario_nome,
  u.tipo_usuario,
  a.acao,
  a.tabela,
  a.registro_id,
  a.ip_address
FROM auditoria a
LEFT JOIN usuarios u ON u.id = a.usuario_id
WHERE DATE(a.created_at) BETWEEN :data_ini AND :data_fim
ORDER BY a.created_at DESC, a.id DESC