SELECT 
obj_main.isys_obj__id AS '__id__', 
(SELECT CONCAT("{", isys_cmdb_status__color, "} ", isys_cmdb_status__title) FROM isys_cmdb_status  WHERE obj_main.isys_obj__isys_cmdb_status__id = isys_cmdb_status__id  AND isys_cmdb_status__status = 2   ) 'isys_cmdb_dao_category_g_global__cmdb_status', 
(CONCAT(obj_main.isys_obj__title, ' {', obj_main.isys_obj__id, '}')   ) 'isys_cmdb_dao_category_g_global__title', 
j3.isys_cats_person_list__last_name 'isys_cmdb_dao_category_s_person_master__last_name', 
j3.isys_cats_person_list__first_name 'isys_cmdb_dao_category_s_person_master__first_name', 
(SELECT CONCAT(isys_obj__title, ' {', isys_obj__id, '}')
                                FROM isys_cats_person_list
                                INNER JOIN isys_connection ON isys_connection__id = isys_cats_person_list__isys_connection__id
                                INNER JOIN isys_obj ON isys_obj__id = isys_connection__isys_obj__id  WHERE isys_cats_person_list__isys_obj__id = obj_main.isys_obj__id  AND isys_cats_person_list__status = 2   LIMIT 1) 'isys_cmdb_dao_category_s_person_master__organization', 
j3.isys_cats_person_list__department 'isys_cmdb_dao_category_s_person_master__department', 
j3.isys_cats_person_list__service_designation 'isys_cmdb_dao_category_s_person_master__service_designation', 
j3.isys_cats_person_list__phone_company 'isys_cmdb_dao_category_s_person_master__phone_company', 
(SELECT isys_catg_mail_addresses_list__title  FROM isys_catg_mail_addresses_list  WHERE isys_catg_mail_addresses_list__primary = 1  AND isys_catg_mail_addresses_list__isys_obj__id = obj_main.isys_obj__id  AND isys_catg_mail_addresses_list__status = 2   ) 'isys_cmdb_dao_category_s_person_master__mail', 
j3.isys_cats_person_list__title 'isys_cmdb_dao_category_s_person_login__title', 
(SELECT REPLACE(CONCAT('<ul><li>', GROUP_CONCAT((CASE WHEN isys_cats_person_list__disabled_login = '1' THEN 'LC__UNIVERSAL__YES' WHEN isys_cats_person_list__disabled_login = '0' THEN 'LC__UNIVERSAL__NO' END) SEPARATOR '</li><li>'), '</li></ul>'), '<ul><li></li></ul>', '')
                                FROM isys_cats_person_list  WHERE isys_cats_person_list__isys_obj__id = obj_main.isys_obj__id  AND isys_cats_person_list__status = 2   GROUP BY isys_cats_person_list__isys_obj__id  ) 'isys_cmdb_dao_category_s_person_login__disabled_login', 
(SELECT REPLACE(CONCAT('<ul><li>', GROUP_CONCAT(joined_content.isys_catg_custom_fields_list__field_content SEPARATOR '</li><li>'), '</li></ul>'), '<ul><li></li></ul>', '')
                            FROM isys_catg_custom_fields_list AS root_custom_field
                            LEFT JOIN isys_catg_custom_fields_list AS joined_content
                            ON joined_content.isys_catg_custom_fields_list__data__id = root_custom_field.isys_catg_custom_fields_list__data__id
                            AND joined_content.isys_catg_custom_fields_list__field_key = 'c_17628546009944330'  WHERE root_custom_field.isys_catg_custom_fields_list__status = 2 AND root_custom_field.isys_catg_custom_fields_list__isysgui_catg_custom__id =
                                        (SELECT isysgui_catg_custom__id FROM isysgui_catg_custom WHERE isysgui_catg_custom__const = 'C__CATG__CUSTOM_FIELDS_EIN_UND_AUSTRITTSDATUM') AND root_custom_field.isys_catg_custom_fields_list__field_type = 'commentary'  AND root_custom_field.isys_catg_custom_fields_list__isys_obj__id = obj_main.isys_obj__id  AND root_custom_field.isys_catg_custom_fields_list__status = 2   GROUP BY root_custom_field.isys_catg_custom_fields_list__isys_obj__id  ) 'isys_cmdb_dao_category_g_custom_fields__f_popup_c_17628546009944330', 
(SELECT REPLACE(CONCAT('<ul><li>', GROUP_CONCAT(joined_content.isys_catg_custom_fields_list__field_content SEPARATOR '</li><li>'), '</li></ul>'), '<ul><li></li></ul>', '')
                            FROM isys_catg_custom_fields_list AS root_custom_field
                            LEFT JOIN isys_catg_custom_fields_list AS joined_content
                            ON joined_content.isys_catg_custom_fields_list__data__id = root_custom_field.isys_catg_custom_fields_list__data__id
                            AND joined_content.isys_catg_custom_fields_list__field_key = 'c_17628546009946731'  WHERE root_custom_field.isys_catg_custom_fields_list__status = 2 AND root_custom_field.isys_catg_custom_fields_list__isysgui_catg_custom__id =
                                        (SELECT isysgui_catg_custom__id FROM isysgui_catg_custom WHERE isysgui_catg_custom__const = 'C__CATG__CUSTOM_FIELDS_EIN_UND_AUSTRITTSDATUM') AND root_custom_field.isys_catg_custom_fields_list__field_type = 'commentary'  AND root_custom_field.isys_catg_custom_fields_list__isys_obj__id = obj_main.isys_obj__id  AND root_custom_field.isys_catg_custom_fields_list__status = 2   GROUP BY root_custom_field.isys_catg_custom_fields_list__isys_obj__id  ) 'isys_cmdb_dao_category_g_custom_fields__f_popup_c_17628546009946731', 
(CONCAT(DATE_FORMAT(obj_main.isys_obj__created, '%d.%m.%Y %H:%i:%s'), ' (' , obj_main.isys_obj__created_by, ')')   ) 'isys_cmdb_dao_category_g_global__created', 
(CONCAT(DATE_FORMAT(obj_main.isys_obj__updated, '%d.%m.%Y %H:%i:%s'), ' (' , obj_main.isys_obj__updated_by, ')')   ) 'isys_cmdb_dao_category_g_global__changed', 
(SELECT REPLACE(CONCAT('<ul><li>', GROUP_CONCAT(CONCAT(isys_obj__title, ' {', isys_obj__id, '}') SEPARATOR '</li><li>'), '</li></ul>'), '<ul><li></li></ul>', '')
                         FROM isys_person_2_group
                         INNER JOIN isys_obj ON isys_obj__id = isys_person_2_group__isys_obj__id__group  WHERE isys_person_2_group__isys_obj__id__person = obj_main.isys_obj__id   GROUP BY isys_person_2_group__isys_obj__id__person  ) 'isys_cmdb_dao_category_s_person_assigned_groups__connected_object' 

FROM isys_obj AS obj_main 
LEFT JOIN isys_cats_person_list AS j3 ON j3.isys_cats_person_list__isys_obj__id = obj_main.isys_obj__id AND j3.isys_cats_person_list__status = 2 

WHERE TRUE 
AND obj_main.isys_obj__isys_obj_type__id = 53 
