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', 
obj_main.isys_obj__description 'isys_cmdb_dao_category_g_global__description', 
(SELECT REPLACE(CONCAT('<ul><li>', GROUP_CONCAT(isys_model_manufacturer__title SEPARATOR '</li><li>'), '</li></ul>'), '<ul><li></li></ul>', '') FROM isys_catg_model_list 
                INNER JOIN isys_model_manufacturer ON isys_model_manufacturer__id = isys_catg_model_list__isys_model_manufacturer__id  WHERE isys_catg_model_list__isys_obj__id = obj_main.isys_obj__id  AND isys_catg_model_list__status = 2   GROUP BY isys_catg_model_list__isys_obj__id  ) 'isys_cmdb_dao_category_g_model__manufacturer', 
(SELECT REPLACE(CONCAT('<ul><li>', GROUP_CONCAT(isys_model_title__title SEPARATOR '</li><li>'), '</li></ul>'), '<ul><li></li></ul>', '') FROM isys_catg_model_list 
                INNER JOIN isys_model_title ON isys_model_title__id = isys_catg_model_list__isys_model_title__id  WHERE isys_catg_model_list__isys_obj__id = obj_main.isys_obj__id  AND isys_catg_model_list__status = 2   GROUP BY isys_catg_model_list__isys_obj__id  ) 'isys_cmdb_dao_category_g_model__title', 
(SELECT REPLACE(CONCAT('<ul><li>', GROUP_CONCAT(isys_cats_prt_type__title SEPARATOR '</li><li>'), '</li></ul>'), '<ul><li></li></ul>', '') FROM isys_cats_prt_list 
                INNER JOIN isys_cats_prt_type ON isys_cats_prt_type__id = isys_cats_prt_list__isys_cats_prt_type__id  WHERE isys_cats_prt_list__isys_obj__id = obj_main.isys_obj__id  AND isys_cats_prt_list__status = 2   GROUP BY isys_cats_prt_list__isys_obj__id  ) 'isys_cmdb_dao_category_s_prt__type', 
(SELECT REPLACE(CONCAT('<ul><li>', GROUP_CONCAT(isys_catg_model_list__serial SEPARATOR '</li><li>'), '</li></ul>'), '<ul><li></li></ul>', '') FROM isys_catg_model_list  WHERE isys_catg_model_list__isys_obj__id = obj_main.isys_obj__id  AND isys_catg_model_list__status = 2   GROUP BY isys_catg_model_list__isys_obj__id  ) 'isys_cmdb_dao_category_g_model__serial', 
(SELECT REPLACE(CONCAT('<ul><li>', GROUP_CONCAT((CASE
                              WHEN isys_catg_contact_list__primary_contact > 0 THEN CONCAT(isys_obj__title, ' {', isys_obj__id, '}', ' (LC__CATG__CONTACT_PRIMARY)')
                              ELSE CONCAT(isys_obj__title, ' {', isys_obj__id, '}') END) SEPARATOR '</li><li>'), '</li></ul>'), '<ul><li></li></ul>', '')
                            FROM isys_catg_contact_list
                            INNER JOIN isys_connection ON isys_connection__id = isys_catg_contact_list__isys_connection__id
                            INNER JOIN isys_obj ON isys_obj__id = isys_connection__isys_obj__id AND isys_obj__status = 2  WHERE isys_catg_contact_list__isys_obj__id = obj_main.isys_obj__id  AND isys_catg_contact_list__status = 2   GROUP BY isys_catg_contact_list__isys_obj__id  ) 'isys_cmdb_dao_category_g_contact__contact_list', 
(SELECT REPLACE(CONCAT('<ul><li>', GROUP_CONCAT(CONCAT(isys_obj__title, ' {', isys_obj__id, '} ', "(", IFNULL(DATE_FORMAT(isys_catg_contract_assignment_list__contract_start, '%d.%m.%Y'), IFNULL(DATE_FORMAT(isys_cats_contract_list__start_date, '%d.%m.%Y'), '-')), " - ", IFNULL(DATE_FORMAT(isys_catg_contract_assignment_list__contract_end, '%d.%m.%Y'), IFNULL(DATE_FORMAT(isys_cats_contract_list__end_date, '%d.%m.%Y'), '-')), ")") SEPARATOR '</li><li>'), '</li></ul>'), '<ul><li></li></ul>', '')
                            FROM isys_catg_contract_assignment_list
                            INNER JOIN isys_connection ON isys_connection__id = isys_catg_contract_assignment_list__isys_connection__id
                            INNER JOIN isys_obj ON isys_obj__id = isys_connection__isys_obj__id
                            LEFT JOIN isys_cats_contract_list on isys_cats_contract_list__isys_obj__id = isys_obj__id  WHERE isys_catg_contract_assignment_list__isys_obj__id = obj_main.isys_obj__id  AND isys_catg_contract_assignment_list__status = 2   GROUP BY isys_catg_contract_assignment_list__isys_obj__id  ) 'isys_cmdb_dao_category_g_contract_assignment__connected_contract', 
(SELECT CONCAT(isys_obj__title, ' {', isys_obj__id, '}') FROM isys_catg_location_list
                              INNER JOIN isys_obj ON isys_obj__id = isys_catg_location_list__parentid  WHERE isys_catg_location_list__isys_obj__id = obj_main.isys_obj__id  AND isys_catg_location_list__status = 2   ) 'isys_cmdb_dao_category_g_location__parent', 
(SELECT REPLACE(CONCAT('<ul><li>', GROUP_CONCAT(CONCAT(isys_catg_ip_list__hostname, ".", isys_catg_ip_list__domain) SEPARATOR '</li><li>'), '</li></ul>'), '<ul><li></li></ul>', '')
                              FROM isys_catg_ip_list  WHERE isys_catg_ip_list__hostname != ""  AND isys_catg_ip_list__isys_obj__id = obj_main.isys_obj__id  AND isys_catg_ip_list__status = 2   GROUP BY isys_catg_ip_list__isys_obj__id  ) 'isys_cmdb_dao_category_g_ip__primary_fqdn', 
(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_catg_its_components_list
                            INNER JOIN isys_obj ON isys_obj__id = isys_catg_its_components_list__isys_obj__id
                            INNER JOIN isys_connection ON isys_connection__id = isys_catg_its_components_list__isys_connection__id  WHERE isys_obj.isys_obj__status = '2' AND isys_catg_its_components_list__status = '2'  AND isys_connection__isys_obj__id = obj_main.isys_obj__id  AND isys_catg_its_components_list__status = 2   AND isys_obj__status = 2    GROUP BY isys_connection__isys_obj__id  ) 'isys_cmdb_dao_category_g_itservice__connected_object', 
(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' 

FROM isys_obj AS obj_main 
 

WHERE TRUE 
AND obj_main.isys_obj__isys_obj_type__id = 11 
