"LEFT JOIN alarm_rule_level_config b ON a.id = b.alarm_rule_id "+
"LEFT JOIN alarm_rule_level_config_template c ON (b.alarm_rule_level_name = c.alarm_template_level_name and b.sort=c.sort and b.template_type = c.alarm_template_type) "+
"LEFT JOIN alarm_rule_level_config_template c ON (b.alarm_rule_level_name = c.alarm_template_level_name "+
" and b.sort=c.sort and b.template_type = c.alarm_template_type and b.depart_id = c.depart_id) "+
"LEFT JOIN alarm_custom_rule_repository d ON a.alarm_rule_repository_id = d.id "+
LEFT JOIN ( SELECT depart_id, count( id ) fxk_count FROM danger_level_manage WHERE create_time LIKE CONCAT(#{year},'%') GROUP BY depart_id ) dl ON dl.depart_id = d.id
LEFT JOIN ( SELECT depart_id, count( id ) yhpc_count FROM danger_inspection_record WHERE create_time LIKE CONCAT(#{year},'%') GROUP BY depart_id ) di ON di.depart_id = d.id
LEFT JOIN ( SELECT depart_id, count( id ) aqyh_count FROM ajh_rectification_info WHERE create_time LIKE CONCAT(#{year},'%') GROUP BY depart_id ) aq ON aq.depart_id = d.id