1 Chronicles 9:22
All these which were chosen to be porters in the gates were two hundred and twelve. These were reckoned by their genealogy in their villages, whom David and Samuel the seer did ordain in their set office. All these which were chosen to be porters in the gates were two hundred and twelve. These were reckoned by their genealogy in their villages, whom David and Samuel the seer did ordain in their set office.
The two hundred and twelve chosen porters in the gates stand within the genealogical lists of the first nine chapters of Chronicles, read together with chapters 8-11, which record the tribes, the priesthood, names, and appointed roles. Those records met the postexilic need to establish hereditary duties including temple service, preserving the identity and continuity of God's people and tribes. Temple service was divided into assigned roles, with the gatekeepers or porters among them and the priests and temple workers given responsibility for the service.
The order described in chapter 9 verses 1-32 was originally ordained by David and Samuel the seer even though it describes the period after the return from Babylon, so the Sabbath service of verse 32 dates back to David's life. The verse is historical record rather than an expressed promise and gives no specific explanation or application beyond that record.
The genealogies show that God is particular and that a faithful record of every soul is kept in heaven, and the lines of Judah and Levi remained unbroken until Jesus' first advent, when Jesus came from Judah and David's family as prophesied and Christ's priesthood superseded the Aaronic priesthood.