SELECT 
obj_main.isys_obj__id AS '__id__', 
(CONCAT(obj_main.isys_obj__title, ' {', obj_main.isys_obj__id, '}')   ) 'isys_cmdb_dao_category_g_global__title', 
(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', 
(SELECT isys_cats_net_ip_addresses_list__title
                              FROM isys_catg_ip_list
                                INNER JOIN isys_cats_net_ip_addresses_list ON isys_catg_ip_list__isys_cats_net_ip_addresses_list__id = isys_cats_net_ip_addresses_list__id  WHERE isys_catg_ip_list__primary = 1  AND isys_catg_ip_list__isys_obj__id = obj_main.isys_obj__id  AND isys_catg_ip_list__status = 2   LIMIT 1) 'isys_cmdb_dao_category_g_ip__primary_hostaddress', 
(SELECT isys_catg_ip_list__hostname
                              FROM isys_catg_ip_list  WHERE isys_catg_ip_list__primary = 1  AND isys_catg_ip_list__isys_obj__id = obj_main.isys_obj__id  AND isys_catg_ip_list__status = 2   LIMIT 1) 'isys_cmdb_dao_category_g_ip__primary_hostname', 
(SELECT (CASE WHEN isys_monitoring_hosts__type = 'livestatus' THEN
                                        isys_catg_monitoring_list__isys_obj__id ELSE NULL END)
                                FROM isys_catg_monitoring_list
                                INNER JOIN isys_monitoring_hosts ON isys_monitoring_hosts__id = isys_catg_monitoring_list__isys_monitoring_hosts__id  WHERE isys_catg_monitoring_list__isys_obj__id = obj_main.isys_obj__id  AND isys_catg_monitoring_list__status = 2   ) 'isys_cmdb_dao_category_g_livestatus__livestatus_state' 

FROM isys_obj AS obj_main 
 

WHERE TRUE 
AND obj_main.isys_obj__isys_obj_type__id = 59 
