2020-09-25 12:45:00 +00:00
|
|
|
SELECT
|
|
|
|
c.id,
|
|
|
|
c.socialName,
|
|
|
|
c.name,
|
|
|
|
c.fi,
|
|
|
|
a.city,
|
|
|
|
a.postalCode,
|
|
|
|
a.street,
|
|
|
|
a.nickname,
|
|
|
|
p.name AS province,
|
2021-12-22 11:52:14 +00:00
|
|
|
ct.country,
|
|
|
|
IFNULL(c.phone, cc.phone) AS phone
|
2020-09-25 12:45:00 +00:00
|
|
|
FROM claim cl
|
|
|
|
JOIN client c ON c.id = cl.clientFk
|
|
|
|
JOIN account.user u ON u.id = c.id
|
|
|
|
JOIN ticket t ON t.id = cl.ticketFk
|
|
|
|
JOIN address a ON a.id = t.addressFk
|
2021-11-08 06:41:10 +00:00
|
|
|
LEFT JOIN province p ON p.id = a.provinceFk
|
|
|
|
LEFT JOIN autonomy amy ON amy.id = p.autonomyFk
|
|
|
|
LEFT JOIN country ct ON ct.id = amy.countryFk
|
2021-12-22 11:52:14 +00:00
|
|
|
LEFT JOIN clientContact cc ON cc.clientFk = c.id
|
|
|
|
WHERE cl.id = ?
|
|
|
|
LIMIT 1;
|