A water pump with a built-in battery, comprising a pump body, wherein a battery compartment and a mounting cavity arranged in a horizontal direction and adjacent to each other are provided in the pump body; a water inlet and a water outlet are further formed in the pump body; a control panel is provided at an upper part of the mounting cavity; a battery pack is detachably connected into the battery compartment, and an upper part of the battery compartment is detachably connected to a battery compartment cover; a handle is provided on the battery compartment cover; a motor is provided in the mounting cavity; and the control panel is electrically connected to the battery pack and the motor; characterized in that a floating structure is further connected to the pump body; the floating structure comprises a floating member and a hinge member, and the hinge member is configured to hinge the floating member to a side surface of the pump body, wherein the floating member comprises a float and a housing that are in an integrated structure; and alternatively, the floating member comprises a float and a housing that are in a split structure, wherein the float is connected into the housing; and one side of the housing is connected to the hinge member, and the other opposite side of the housing is fastened to the pump body; the hinge member comprises a fixed member provided on the side surface of the pump body and a movable member connected to the housing; a limiting grid plate is provided on the fixed member; and the movable member comprises a movable curved surface and a limiting plane; the limiting plane and the limiting grid plate are matched with each other to limit a rotation angle of the housing; and the rotation angle is 0-135 degrees. a battery compartment and a mounting cavity arranged in a horizontal direction and adjacent to each other are provided in the pump body; a water inlet and a water outlet are further formed in the pump body; a control panel is provided at an upper part of the mounting cavity; a battery pack is detachably connected into the battery compartment, and an upper part of the battery compartment is detachably connected to a battery compartment cover; a handle is provided on the battery compartment cover; a motor is provided in the mounting cavity; and the control panel is electrically connected to the battery pack and the motor; characterized in that a floating structure is further connected to the pump body; the floating structure comprises a floating member and a hinge member, and the hinge member is configured to hinge the floating member to a side surface of the pump body, wherein the floating member comprises a float and a housing that are in an integrated structure; and alternatively, the floating member comprises a float and a housing that are in a split structure, wherein the float is connected into the housing; and one side of the housing is connected to the hinge member, and the other opposite side of the housing is fastened to the pump body; the hinge member comprises a fixed member provided on the side surface of the pump body and a movable member connected to the housing; a limiting grid plate is provided on the fixed member; and the movable member comprises a movable curved surface and a limiting plane; the limiting plane and the limiting grid plate are matched with each other to limit a rotation angle of the housing; and the rotation angle is 0-135 degrees.