ObjectiveTo explore the risk factors for accompanying depression in patients with community type Ⅱ diabetes and to construct their risk prediction model. MethodsA total of 269 patients with type Ⅱ diabetes accompanied with depression and 217 patients with simple type Ⅱ diabetes from three community health service centers in two streets of Pingshan District, Shenzhen from October 2021 to April 2022 were included. The risk factors were analyzed and screened out, and a logistic regression risk prediction model was constructed. The goodness of fit and prediction ability of the model were tested by the Hosmer-Lemeshow test and the receiver operating characteristic (ROC) curve. Finally, the model was verified. ResultsLogistic regression analysis showed that smoking, diabetes complications, physical function, psychological dimension, medical coping for face, and medical coping for avoidance were independent risk factors for depressive disorder in patients with type Ⅱ diabetes. Modeling group Hosmer-Lemeshow test P=0.345, the area under the ROC curve was 0.987, sensitivity was 95.2% and specificity was 98.6%. The area under the ROC curve was 0.945, sensitivity was 89.8%, specificity was 84.8%, and accuracy was 86.8%, showing the model predictive value. ConclusionThe risk prediction model of type Ⅱ diabetes patients with depressive disorder constructed in this study has good predictive and discriminating ability.