存储停车场停车位瞬态状态的最佳数据库设计
嘿。 我正在设计一个网站(使用 spring、hibernate 和 postgres),供停车场所有者跟踪其停车场停车位的状态(占用、空置或保留),并且对于其他人,我的网站应该能够显示他们想要查看的任何停车场的停车位的当前状态。
基本上任何停车场业主都可以在我的网站上注册,并可以输入包含其停车场停车位总数的信息。因此,假设我在 parking_lots 表中有两个条目,其中包含 A 和 B 两个停车场的详细信息。A 和 B 有唯一的 id,并且说 A 有 7 个停车位,B 有 5 个。
现在我的问题是最好的数据库设计可以存储 A 中的 7 个停车位、B 中的 5 个停车位的状态,明天如果有一个条目 C 带有 3 个停车位,我应该仍然能够处理它。假设用户点击我网站上的停车场 A,他应该能够看到 A 中的哪些停车位已被占用,哪些停车位是空的,以及是否为将来的任何时间预留了空间。状态可能在一天中的任何时刻发生变化。
任何帮助将不胜感激。提前致谢。 血清素追逐
Hey.
I'm designing a website (using spring, hibernate and postgres) for parking lot owners to keep track of the statuses(occupied or vacant or reserved) of the parking spaces at their parking lots and for everybody else my website should be able to display the current statuses of parking spaces in any parking lot they want to see.
Basically any parking lot owner can register with my website and can enter the information that contains the total number of parking spaces in their parking lot. So assume I have two entries in the parking_lots table with the details of two parking lots say A and B. A and B have unique ids, and say A has 7 parking spaces and B has 5.
Now my question here is what would be the best data base design to store the statuses of the 7 parking spaces in A, 5 in B and tomorrow if there's an entry C with say 3 parking spaces I should still be able to handle it. Suppose a user clicks on parking lot A at my website, he should be able to see which parking spaces in A are occupied, which are vacant and if any space is reserved for anytime in the future. The statuses can change at any minute in a day.
Any help will be greatly appreciated. Thanks in advance.
Serotonin Chase
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)