(select count(1)count from alarm_record_history where alarm_rule_type='6' and alarm_param_type='数据长期不变累计时长报警配置' and DATE_FORMAT( record_time, '%Y-%m' ) =#{time} and sd.id=depart_id)invariantCount,
(select count(1)count from alarm_record_history where alarm_rule_type='6' and alarm_param_type='数据超过有效上下限报警配置' and DATE_FORMAT( record_time, '%Y-%m' ) =#{time} and sd.id=depart_id )overCount
FROM
(select count(1) count from alarm_record_history
where alarm_rule_type='6'
and alarm_param_type='数据长期不变累计时长报警配置'
and DATE_FORMAT( record_time, '%Y-%m' ) = #{time}
and sd.id=depart_id)invariantCount,
(select count(1) count from alarm_record_history
where alarm_rule_type='6'
and alarm_param_type='数据超过有效上下限报警配置'
and DATE_FORMAT( record_time, '%Y-%m' ) = #{time}
and sd.id=depart_id )overCount
FROM
sys_depart sd
left join sys_factory_info sfi on sfi.depart_id=sd.id