Linear-quadratic regulator with intermediate points for degenerate equations with unbounded operator