2024-12-24 18:02:23 +04:00
|
|
|
SELECT
|
|
|
|
d.*,
|
|
|
|
l.name AS location_name,
|
2025-01-14 21:28:06 +04:00
|
|
|
TRIM(CONCAT(e.last_name, ' ', e.first_name, ' ', e.patronymic)) AS employee_full_name,
|
2024-12-24 18:02:23 +04:00
|
|
|
e.fk_id_department AS department_id,
|
2025-01-14 21:28:06 +04:00
|
|
|
dep.name AS department_name
|
2024-12-24 18:02:23 +04:00
|
|
|
FROM
|
|
|
|
device d
|
|
|
|
JOIN
|
|
|
|
location l ON d.fk_id_location = l.id
|
2025-01-14 21:28:06 +04:00
|
|
|
LEFT JOIN
|
2024-12-24 18:02:23 +04:00
|
|
|
employee e ON d.fk_id_employee = e.id
|
2025-01-14 21:28:06 +04:00
|
|
|
LEFT JOIN
|
2024-12-24 18:02:23 +04:00
|
|
|
department dep ON e.fk_id_department = dep.id;
|