Congenital heart disease (CHD) is one of the leading causes of mortality among birth defects, and due to significant variations in the whole heart and great vessel, automatic CHD segmentation using CT images has been always under-researched. Even though some segmentation algorithms have been developed in the literature, none perform very well under the complex structure of CHD. To deal with the challenges, we take advantage of deep learning in processing regular structures and graph algorithms in dealing with large variations and propose a framework combining both the whole heart and great vessel segmentation in complex CHD. We benefit from deep learning in segmenting the four chambers and myocardium based on the blood pool, and then we extract the connection information and apply graph matching to determine the categories of all the vessels. Experimental results on 68 3D CT images covering 14 types of CHD illustrate our framework can increase the Dice score by 12% on average compared with the state-of-the-art whole heart and great vessel segmentation method in normal anatomy. We further introduce two cardiovascular imaging specialists to evaluate our results in the standard of the Van Praagh classification system, and achieves well performance in clinical evaluation. All these results may pave the way for the clinical use of our method in the incoming future.