The invention discloses a device for detecting the mounting holes of a shelf beam by use of plane mirrors. The device comprises a base, a conveyor belt, a proximity switch, a stopper, a push cylinder, a measurement bracket, a portal frame, image shooting modules, a screw driver module, a compression cylinder, and a turning driver module. The two image shooting modules are used for collecting images of front and rear pairs of mounting holes of a work piece to be detected. Each image shooting module includes an industrial camera, a camera holder, a parallel light source, a plane mirror mounting base, and a plane mirror, wherein the parallel light source emits vertically upward parallel light, the parallel light goes out from two mounting holes in the same end of the work piece to be detected after passing through a through hole, one light beam directly hits the industrial camera, and the other light beam is reflected by the plane mirror and then hits the industrial camera. The device has a simple and compact structure, and is low in cost of production. The process of mounting hole detection is continuous and online, there is no need to interrupt the production process, and the production efficiency and detection efficiency are improved.