The aim of this study was to identify effective genetic markers for the Antigen Processing Associated Transporter 1 (TAP1), α (1,2) Fucosyltransferase 1 (FUT1), Natural Resistance Associated Macrophage Protein 1 (NRAMP1), Mucin 4 (MUC4) and Mucin 13 (MUC13) diarrhea-resistance genes in the local pig breeds, namely Shanghai white pigs, Fengjing pigs, Shawutou pigs, Meishan pigs and Pudong white pigs, to provide a reference for the characterization of local pig breed resources in Shanghai. Polymerase chain reaction–restriction fragment length polymorphism (PCR-RFLR) and sequence sequencing were applied to analyze the polymorphisms of the above genes and to explore the effects on the immunity of Shanghai local pig breeds in conjunction with some immunity factors. The results showed that both TAP1 and MUC4 genes had antidiarrheal genotype GG in the five pig breeds, AG and GG genotypes of the FUT1 gene were detected in Pudong white pigs, AA antidiarrheal genes of the NRAMP1 gene were detected in Meishan pigs, the AB type of the NRAMP1 gene was detected in Pudong white pigs, and antidiarrheal genotype GG of the MUC13 gene was only detected in Shanghai white pigs. The MUC13 antidiarrhea genotype GG was only detected in Shanghai white pigs. The TAP1 gene was moderately polymorphic in Shanghai white pigs, Fengjing pigs, Shawutou pigs, Meishan pigs and Pudong white pigs, among which TAP1 in Shanghai white pigs and Shawutou pigs did not satisfy the Hardy–Weinberg equilibrium. The FUT1 gene of Pudong white pigs was in a state of low polymorphism. NRAMP1 of Meishan pigs and Pudong white pigs was in a state of moderate polymorphism, which did not satisfy the Hardy–Weinberg equilibrium. The MUC4 genes of Shanghai white pigs and Pudong white pigs were in a state of low polymorphism, and the MUC4 genes of Fengjing pigs and Shawutou pigs were in a state of moderate polymorphism, and the MUC4 genes of Fengjing pigs and Pudong white pigs did not satisfy the Hardy–Weinberg equilibrium. The MUC13 gene of Shanghai white pigs and Pudong white pigs was in a state of moderate polymorphism. Meishan pigs had higher levels of IL-2, IL-10, IgG and TNF-α, and Pudong white pigs had higher levels of IL-12 than the other pigs. The level of interleukin 12 (IL-12) was significantly higher in the AA genotype of the MUC13 gene of Shanghai white pigs than in the AG genotype. The indicator of tumor necrosis factor alpha (TNF-α) in the AA genotype of the TAP1 gene of Fengjing pigs was significantly higher than that of the GG and AG genotypes. The indicator of IL-12 in the AG genotype of the Shawutou pig TAP1 gene was significantly higher than that of the GG genotype. The level of TNF-α in the AA genotype of the NRAMP1 gene of Meishan pigs was markedly higher than that of the AB genotype. The IL-2 level of the AG type of the FUT1 gene was obviously higher than that of the GG type of Pudong white pigs, the IL-2 level of the AA type of the MUC4 gene was dramatically higher than that of the AG type, and the IgG level of the GG type of the MUC13 gene was apparently higher than that of the AG type. The results of this study are of great significance in guiding the antidiarrhea breeding and molecular selection of Shanghai white pigs, Fengjing pigs, Shawutou pigs, Meishan pigs and Pudong white pigs and laying the foundation for future antidiarrhea breeding of various local pig breeds in Shanghai.