• 全国省市级联sql表


    全国省市级联sql表

    sql文件获取地址

    【查询所有的省市区信息】

    SELECT
        *
    FROM
        hat_province AS p
    LEFT JOIN hat_city as c ON p.provinceID = c.father
    LEFT JOIN hat_area AS a ON c.cityID = a.father;


    对于后台获取到数据之后,可以按照以下数据格式返回给前端进行解析:

    [
        {
            "value": "130000",
            "label": "河北省",
            "children": [
                {
                    "value": "130100",
                    "label": "石家庄市",
                    "children": [
                        {
                            "value": "130102",
                            "label": "长安区"
                        },
                        {
                            "value": "130104",
                            "label": "桥西区"
                        }
                    ]
                },
                {
                    "value": "130200",
                    "label": "唐山市",
                    "children": [
                        {
                            "value": "130202",
                            "label": "路南区"
                        },
                        {
                            "value": "130203",
                            "label": "路北区"
                        }
                    ]
                }
            ]
        },
        {
            "value": "130000",
            "label": "河北省",
            "children": [
                {
                    "value": "130100",
                    "label": "石家庄市",
                    "children": [
                        {
                            "value": "130102",
                            "label": "长安区"
                        },
                        {
                            "value": "130104",
                            "label": "桥西区"
                        }
                    ]
                },
                {
                    "value": "130200",
                    "label": "唐山市",
                    "children": [
                        {
                            "value": "130202",
                            "label": "路南区"
                        },
                        {
                            "value": "130203",
                            "label": "路北区"
                        }
                    ]
                }
            ]
        }
    ]

  • 相关阅读:
    MFC列表控件更改一行的字体颜色
    MFC之sqlite
    MFC笔记10
    MFC---关于string.h相关函数
    MFC笔记8
    MFC笔记7
    MFC笔记6
    MFC笔记5
    MFC笔记4
    MFC笔记3
  • 原文地址:https://www.cnblogs.com/Edward-Wang/p/12070418.html
Copyright © 2020-2023  润新知