zoukankan      html  css  js  c++  java
  • MySQL通过实体经纬度字段插入数据库point类型的经纬度字段


    说明:
    数据库:表中没有经度跟纬度字段,只有location字段(point类型) POINT(经度 纬度)
    实体类:只有经度 lng 字段、纬度 lat 字段 没有location字段

    <!--添加一个小区-->
    <insert id="insertOneDistrict" parameterType="com.diantijiang.saas.order.entity.District"
    keyProperty="id" useGeneratedKeys="true">
    insert
    into
    oc_district(
    <if test="null != name">
    name,
    </if>
    <if test="null != shortName">
    short_name,
    </if>
    <if test="null != cityId">
    city_id,
    </if>
    <if test="null != city">
    city,
    </if>
    <if test="null != areaId">
    area_id,
    </if>
    <if test="null != area">
    area,
    </if>
    <if test="null != address">
    address,
    </if>
    <if test="null != tel">
    tel,
    </if>
    location
    )
    values (
    <if test="null != name">
    #{name},
    </if>
    <if test="null != shortName">
    #{shortName},
    </if>
    <if test="null != cityId">
    #{cityId},
    </if>
    <if test="null != city">
    #{city},
    </if>
    <if test="null != areaId">
    #{areaId},
    </if>
    <if test="null != area">
    #{area},
    </if>
    <if test="null != address">
    #{address},
    </if>
    <if test="null != tel">
    #{tel},
    </if>
    GeomFromText ('POINT(${lng} ${lat})')
    )
    </insert>
  • 相关阅读:
    树形dp入门
    D. Kilani and the Game(多源BFS)
    C. Ayoub and Lost Array
    poj3254(状压dp)
    CodeForces
    链式前项星(模板)
    “东信杯”广西大学第一届程序设计竞赛(同步赛)H
    最小生成树kruskal模板
    hdu-4763(kmp+拓展kmp)
    poj-3080(kmp+暴力枚举)
  • 原文地址:https://www.cnblogs.com/Soy-technology/p/10985860.html
Copyright © 2011-2022 走看看