WHERE fs.system_type_code IS NOT NULL AND fs.system_type_code IN ('fireWaterSys', 'fireCAFSSys', 'fireAlarmSys', 'fireONLSys')
GROUP BY fs.system_type_code
( SELECT COUNT( 1 ) AS sysNum FROM `f_fire_fighting_system` `fs` WHERE fs.system_type_code IS NOT NULL AND fs.system_type_code = 'fireWaterSys' ) AS fireWaterSys,
( SELECT COUNT( 1 ) AS sysNum FROM `f_fire_fighting_system` `fs` WHERE fs.system_type_code IS NOT NULL AND fs.system_type_code = 'fireCAFSSys' ) AS fireCAFSSys,
( SELECT COUNT( 1 ) AS sysNum FROM `f_fire_fighting_system` `fs` WHERE fs.system_type_code IS NOT NULL AND fs.system_type_code = 'fireAlarmSys' ) AS fireAlarmSys,
( SELECT COUNT( 1 ) AS sysNum FROM `f_fire_fighting_system` `fs` WHERE fs.system_type_code IS NOT NULL AND fs.system_type_code = 'fireONLSys' ) AS fireONLSys