Background: Urinary tract infection (UTI) is one of the most common adverse events after transvaginal gynecologic urinary surgery. This retrospective case-control study investigated the prevalence of UTI risk factors and constructed a model for predicting the occurrence of UTI postoperatively for transvaginal gynecologic urinary surgery patients. Methods: The clinical data of patients who underwent gynecologic urinary surgery in the Hangzhou Maternity Hospital from January 2018 to December 2021 were analyzed. The data was and analyzed by two different approaches including logistic regression analysis and Least Absolute Shrinkage and Selection Operator regression (LASSO) regression analysis. The two models were constructed to predict the risk of UTI events. Receiver operating characteristic (ROC) curves were used to assess the predictive performance of the model. Results: We assessed the information for 289 patients including 255 patients without UTI and 34 UTI patients. The ROC curve and area under the curve (AUC) of the two models were 0.82 (95% confidence interval (95% CI): 0.90–0.74) and 0.81 (95% CI: 0.89–0.74) respectively. The ROC curve results also showed that the two models were well-fitted in subgroups. The results of logistic regression analysis showed the length of cervical extension, age, indwelling urinary catheter days, and bacterial infection were independent impact factors. Their odd ratios were 1.26, 0.92, 1.36, and 2.07, respectively with p < 0.05. Moreover, the indwelling urinary catheter days, cervical extension, and bacterial infection were key risk factors in the two models. The ROC curves of the two models in six subgroups showed that the AUC were all greater than 0.65. Notably, the length of the cervix >4 cm is defined as cervical extension. Cervical length minus 4 cm is defined as the length of cervical extension. Types of infected bacteria refer to the urinary tract infection caused by possible factors. Conclusions: The findings of this study indicated that the factors of indwelling urinary catheter days, cervical extension, and bacterial infection were key risk factors. Two models for predicting the occurrence of UTI in women who underwent gynecologic urinary surgery had good predicted performance.