|
@@ -1,33 +1,36 @@
|
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
|
<!DOCTYPE mapper
|
|
|
-PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
-"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
+ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.onemap.apply.mapper.gdbh.TGdbhRwGeomMapper">
|
|
|
-
|
|
|
+
|
|
|
<resultMap type="TGdbhRwGeom" id="TGdbhRwGeomResult">
|
|
|
- <result property="id" column="id" />
|
|
|
- <result property="geom" column="geom" />
|
|
|
- <result property="rwbsm" column="rwbsm" />
|
|
|
- <result property="geomJson" column="geom_json" />
|
|
|
- <result property="sort" column="sort" />
|
|
|
- <result property="geomarea" column="geomarea" />
|
|
|
+ <result property="id" column="id"/>
|
|
|
+ <result property="geom" column="geom"/>
|
|
|
+ <result property="rwbsm" column="rwbsm"/>
|
|
|
+ <result property="geomJson" column="geom_json"/>
|
|
|
+ <result property="sort" column="sort"/>
|
|
|
+ <result property="geomarea" column="geomarea"/>
|
|
|
+ <result property="siweiarea" column="siweiarea"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectTGdbhRwGeomVo">
|
|
|
- select id, public.st_asewkt(geom) geom, rwbsm, geom_json, sort, geomarea from t_gdbh_rw_geom
|
|
|
+ select id, public.st_asewkt(geom) geom, rwbsm, geom_json, sort, geomarea
|
|
|
+ from t_gdbh_rw_geom
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectTGdbhRwGeomList" parameterType="TGdbhRwGeom" resultMap="TGdbhRwGeomResult">
|
|
|
- <include refid="selectTGdbhRwGeomVo"/>
|
|
|
- <where>
|
|
|
- <if test="geom != null and geom != ''"> and geom = #{geom}</if>
|
|
|
- <if test="rwbsm != null and rwbsm != ''"> and rwbsm = #{rwbsm}</if>
|
|
|
- <if test="geomJson != null and geomJson != ''"> and geom_json = #{geomJson}</if>
|
|
|
- <if test="sort != null and sort != ''"> and sort = #{sort}</if>
|
|
|
- <if test="geomarea != null and geomarea != ''"> and geomarea = #{geomarea}</if>
|
|
|
+ select id, public.st_asewkt(geom) geom, rwbsm, geom_json, sort, geomarea,ROUND(geomarea * 666.67, 2) AS siweiarea from
|
|
|
+ t_gdbh_rw_geom
|
|
|
+ <where>
|
|
|
+ <if test="geom != null and geom != ''">and geom = #{geom}</if>
|
|
|
+ <if test="rwbsm != null and rwbsm != ''">and rwbsm = #{rwbsm}</if>
|
|
|
+ <if test="geomJson != null and geomJson != ''">and geom_json = #{geomJson}</if>
|
|
|
+ <if test="sort != null and sort != ''">and sort = #{sort}</if>
|
|
|
+ <if test="geomarea != null and geomarea != ''">and geomarea = #{geomarea}</if>
|
|
|
</where>
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="selectTGdbhRwGeomById" parameterType="String" resultMap="TGdbhRwGeomResult">
|
|
|
<include refid="selectTGdbhRwGeomVo"/>
|
|
|
where id = #{id}
|
|
@@ -35,7 +38,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
|
|
|
<select id="sumTGdbhRwGeomByRwbsm" parameterType="String" resultType="map">
|
|
|
- select public.st_asewkt(public.st_union(geom)) geom, sum(geomarea) geomarea, count(*) geomnumber,STRING_AGG(id, ',') AS ids from t_gdbh_rw_geom
|
|
|
+ select public.st_asewkt(public.st_union(geom)) geom,
|
|
|
+ sum(geomarea) geomarea,
|
|
|
+ count(*) geomnumber,
|
|
|
+ STRING_AGG(id, ',') AS ids
|
|
|
+ from t_gdbh_rw_geom
|
|
|
where rwbsm = #{rwbsm}
|
|
|
|
|
|
</select>
|
|
@@ -49,7 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="geomJson != null">geom_json,</if>
|
|
|
<if test="sort != null">sort,</if>
|
|
|
<if test="geomarea != null">geomarea,</if>
|
|
|
- </trim>
|
|
|
+ </trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="id != null and id != ''">#{id},</if>
|
|
|
<if test="geom != null">public.st_transform(public.st_geomfromewkt(#{geom}), 4326),</if>
|
|
@@ -57,7 +64,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="geomJson != null">#{geomJson},</if>
|
|
|
<if test="sort != null">#{sort},</if>
|
|
|
<if test="geomarea != null">#{geomarea},</if>
|
|
|
- </trim>
|
|
|
+ </trim>
|
|
|
</insert>
|
|
|
|
|
|
<update id="updateTGdbhRwGeom" parameterType="TGdbhRwGeom">
|
|
@@ -73,11 +80,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</update>
|
|
|
|
|
|
<delete id="deleteTGdbhRwGeomById" parameterType="String">
|
|
|
- delete from t_gdbh_rw_geom where id = #{id}
|
|
|
+ delete
|
|
|
+ from t_gdbh_rw_geom
|
|
|
+ where id = #{id}
|
|
|
</delete>
|
|
|
|
|
|
<delete id="deleteTGdbhRwGeomByIds" parameterType="String">
|
|
|
- delete from t_gdbh_rw_geom where id in
|
|
|
+ delete from t_gdbh_rw_geom where id in
|
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
#{id}
|
|
|
</foreach>
|