Anomaly detectionplays a vital role in ensuring the safe operation of machine. But most existing algorithms focus on anomaly detection under stable working conditions. Their performance will be degraded for the components that operate under different working conditions, such as rotary manipulators. Besides, changes of working conditions would cause signal shift, leading to false alarms or missed detections in the algorithms. To this end, a multi-condition anomaly detection method based on a supervised contrastive autoencoder and adaptive threshold is proposed. First, supervised contrastive learning is integrated into the architecture of the autoencoder, which uses working condition information (WCI) as labels to narrow the distance between normal sample features of the same working condition and expand the distance between normal sample features of distinct working conditions. This enables the autoencoder to better learn the WCI while ensuring reconstruction capability. Then, a combination of reconstruction errors and the distance between the test samples and the centroids of all training samples at the same working condition is used as the anomaly detection metric. Finally, an adaptive threshold based on the WCI is set for anomaly detection,thereby enhancing the anomaly detection effect of the network under distinct working conditions. The superiority of the proposed method is confirmed by experiments conducted under different working conditions.