Mycoplasma pneumonia (MP) is a common respiratory infection generally treated with macrolides, but resistance mutations against macrolides are often detected in mycoplasma pneumoniae in China. Rapid and accurate identification of mycoplasma pneumoniae and its mutant type is necessary for precise medication. This paper presents a 3D-printed microfluidic device to achieve this. By 3D printing, the stereoscopic structures such as microvalves, reservoirs, drainage tubes, and connectors were fabricated in one step. The device integrated commercial polymerase chain reaction (PCR) tubes as PCR chambers. The detection was a sample-to-answer procedure. First, the sample, a PCR mix, and mineral oil were respectively added to the reservoirs on the device. Next, the device automatically mixed the sample with the PCR mix and evenly dispensed the mixed solution and mineral oil into the PCR chambers, which were preloaded with the specified primers and probes. Subsequently, quantitative real-time PCR (qPCR) was carried out with the homemade instrument. Within 80 min, mycoplasma pneumoniae and its mutation type in the clinical samples were determined, which was verified by DNA sequencing. The easy-to-make and easy-to-use device provides a rapid and integrated detection approach for pathogens and antibiotic resistance mutations, which is urgently needed on the infection scene and in hospital emergency departments.