t.monitorId, t.temperature, t.collectTime, t.recodeTime, COALESCE(ebmi.monitor_name, t.monitorId) AS monitorName LEFT JOIN ems_base_monitor_info ebmi ON t.monitorId = ebmi.monitor_code AND (ebmi.monitor_type IN (5, 6) OR ebmi.monitor_type IS NULL) AND (t.temperature IS NULL OR (t.temperature BETWEEN 0 AND 79)) AND ( (ebmi.monitor_type = 5 AND t.temperature > 0) OR (ebmi.monitor_type = 6 AND t.temperature > 0) OR (ebmi.monitor_type NOT IN (5, 6) OR ebmi.monitor_type IS NULL) ) AND t.collectTime >= #{startTime} AND t.collectTime < #{endTime}