There are many versions of the legend about the Beixin Bridge Locking Dragon Well, and the most widely circulated one is the story of Yao Guangxiao locking the dragon during the Ming Dynasty.
Legend has it that Liu Bowen and Yao Guangxiao discovered a water dragon occupying the then-desolate area of Beijing City during its construction.
In other words, at that time, Beijing City was the water dragon's territory!
If King Yama built Beijing City, naturally, the water dragon would have nowhere to go.
Thus, the water dragon caused a great flood in Beijing to drive away King Yama so it could continue to occupy Beijing City. Therefore, it started the flood from the sea eye beneath Beixin Bridge.
The flood inundated King Yama's Mansion.
King Yama was furious and summoned Liu Bowen to figure out what was happening!
Liu Bowen calculated and found out that it was this dragon causing trouble, so he sent Young Master Yao to subdue the water dragon.