As a key part of construction machinery, the hydraulic system is widely used in industrial fields. Due to its complexity and high integration, the fault diagnosis of hydraulic systems has always been a challenging problem. However, existing methods or models mainly focus on individual hydraulic system components while overlooking the interactions between different components, which are limited to specific application scenarios. Therefore, this research aims to develop a multi-task network model to diagnose faults in multiple components of hydraulic systems. Firstly, the initial data was collected from the hydraulic system test bench, in which the extreme gradient boosting (XGBoost) was introduced to evaluate the importance of all features under different fault types. Then, reduction dimensionality is achieved by setting a threshold for feature selection. Subsequently, a novel multi-branch deep neural network (MBDNN), which utilizes multiple branches to extract different information and correlations in the input data, is proposed and established. The multi-level combination of residual block and multi-branch connections enables MBDNN to achieve multiple types of fault diagnosis simultaneously and compensate for the problem of insufficient information representation in single-branch neural networks. The results of multiple rounds of experimental indicate that the MBDNN has higher robustness and accuracy in hydraulic system fault diagnosis than the existing general methods, and the diagnostic accuracy of multi-type faults is improved to 98.5%.