Optional-position lockable hydraulic cylinder

The invention aims to provide an optional-position lockable hydraulic cylinder which comprises a cylinder body, a locking box body, a piston rod, a locking lever, a turning block and a lock claw. A front cover is fixed at the front end of the cylinder body, a rear cover is fixed at the rear end of the cylinder body, the locking box body is fixed on the rear cover, one end of the locking box body is fixed with a box cover, a piston is arranged in the cylinder body, a first oil mouth and a second oil mouth are respectively formed in the front end and the rear end of the cylinder body, one end of the piston rod is disposed in the piston, the left portion of the locking lever is located in the locking box body, the right end portion of the locking lever penetrates the rear cover to be disposed in the piston, the turning block provided with a cavity is disposed on the upper left portion of the locking lever, and a multihead trapezoidal thread of the turning block is arranged at the position of the cavity of the turning block and is engaged with a multihead trapezoidal thread of the locking lever. The optional-positional lockable hydraulic cylinder is simple and reliable in structure and especially suitable for being applied to occasions when the piston rod needs to stay in a certain position and bears larger pushing and pulling force.