The Command to Love God and Our Neighbor Includes a Command to Love Ourselves
27 Seeing, then, that there is no need of a command that every man should love himself and his own body—seeing, that is, that we love ourselves, and what is beneath us but connected with us, through a law of nature which has never been violated, and which is common to us with the beasts (for even the beasts love themselves and their own bodies)—it only remained necessary to lay injunctions upon us in regard to God above us, and our neighbor beside us. “You shall love,” He says, “the Lord your God with all your heart, and with all your soul, and with all your mind; and you shall love your neighbor as yourself.
On these two commandments hang all the law and the prophets.” Thus the end of the commandment is love, and that twofold, the love of God and the love of our neighbor. Now, if you take yourself in your entirety—that is, soul and body together—and your neighbor in his entirety, soul and body together (for man is made up of soul and body), you will find that none of the classes of things that are to be loved is overlooked in these two commandments. For though, when the love of God comes first, and the measure of our love for Him is prescribed in such terms that it is evident all other things are to find their centre in Him, nothing seems to be said about our love for ourselves; yet when it is said, “You shall love your neighbor as yourself,” it at once becomes evident that our love for ourselves has not been overlooked.
Source: Christian Doctrine (New Advent)