Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

image.png
数据库是这样存的,全国有70w多的数据,比如我业务要查“广东省深圳市福田区”的时候,业务表怎么设计才比较合理?如果修改区划名称又怎么办?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
1.9k views
Welcome To Ask or Share your Answers For Others

1 Answer

你要查询这个地区的数据 肯定不会是传递名字(对于名字,前端拿数据自己去拼接,名字的问题解决了)
一般这种树结构的,都会加一个字段存储路径,例如:省code,市code,区县code
你要查询某个省或者市的所有节点,直接like就行了


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...