|
@@ -0,0 +1,103 @@
|
|
|
+<?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">
|
|
|
+<mapper namespace="com.zjugis.yzt.dao.PewgMapper">
|
|
|
+
|
|
|
+ <!-- 更新shape字段 -->
|
|
|
+ <update id="updateShapeById">
|
|
|
+ UPDATE pewg SET shape = st_geometry(#{shape}, #{wkid}) WHERE objectid = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <!-- 根据objectid查询shape的面积(平方米) -->
|
|
|
+ <select id="selectAreaById" parameterType="java.lang.Integer" resultType="java.lang.Double">
|
|
|
+ SELECT st_area(shape) FROM sde.pewg WHERE objectid = #{objectid}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 使用SQL查询pewg表,包含所有字段和面积计算(分页) -->
|
|
|
+ <select id="selectPewgWithArea" resultType="com.zjugis.yzt.beans.entity.Pewg">
|
|
|
+ SELECT
|
|
|
+ objectid, pcbh, pch, dk_bh, dk_mc, xzz, dk_yt, td_zl, dk_mj, dk_qs, lx, pwh, pzrq, pz_mj, nmjf, bz, wgyy, lyjz, nczfs, nczsj,
|
|
|
+ st_astext(shape) as shape,
|
|
|
+ st_area(shape) as area
|
|
|
+ FROM sde.pewg
|
|
|
+ <where>
|
|
|
+ <if test="ew != null">
|
|
|
+ ${ew.sqlSegment}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 使用SQL查询pewg表,包含所有字段和面积计算(不分页) -->
|
|
|
+ <select id="selectPewgListWithArea" resultType="com.zjugis.yzt.beans.entity.Pewg">
|
|
|
+ SELECT
|
|
|
+ objectid, pcbh, pch, dk_bh, dk_mc, xzz, dk_yt, td_zl, dk_mj, dk_qs, lx, pwh, pzrq, pz_mj, nmjf, bz, wgyy, lyjz, nczfs, nczsj,
|
|
|
+ st_astext(shape) as shape,
|
|
|
+ st_area(shape) as area
|
|
|
+ FROM sde.pewg
|
|
|
+ <where>
|
|
|
+ <if test="ew != null">
|
|
|
+ ${ew.sqlSegment}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 根据条件查询pewg列表(包含面积) -->
|
|
|
+ <select id="selectPewgListByCondition" parameterType="java.util.Map" resultType="com.zjugis.yzt.beans.entity.Pewg">
|
|
|
+ SELECT
|
|
|
+ objectid, pcbh, pch, dk_bh, dk_mc, xzz, dk_yt, td_zl, dk_mj, dk_qs, lx, pwh, pzrq, pz_mj, nmjf, bz, wgyy, lyjz, nczfs, nczsj,
|
|
|
+ st_astext(shape) as shape,
|
|
|
+ st_area(shape) as area
|
|
|
+ FROM sde.pewg
|
|
|
+ <where>
|
|
|
+ <if test="pcbh != null and pcbh != ''">
|
|
|
+ AND pcbh LIKE '%' || #{pcbh} || '%'
|
|
|
+ </if>
|
|
|
+ <if test="dkMc != null and dkMc != ''">
|
|
|
+ AND dk_mc LIKE '%' || #{dkMc} || '%'
|
|
|
+ </if>
|
|
|
+ <if test="xzz != null and xzz != ''">
|
|
|
+ AND xzz LIKE '%' || #{xzz} || '%'
|
|
|
+ </if>
|
|
|
+ <if test="dkYt != null and dkYt != ''">
|
|
|
+ AND dk_yt LIKE '%' || #{dkYt} || '%'
|
|
|
+ </if>
|
|
|
+ <if test="wgyy != null and wgyy != ''">
|
|
|
+ AND wgyy LIKE '%' || #{wgyy} || '%'
|
|
|
+ </if>
|
|
|
+ <if test="lx != null and lx != ''">
|
|
|
+ AND lx LIKE '%' || #{lx} || '%'
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ ORDER BY objectid DESC
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 根据ID查询pewg详情(包含面积) -->
|
|
|
+ <select id="selectPewgByIdWithArea" parameterType="java.lang.Integer" resultType="com.zjugis.yzt.beans.entity.Pewg">
|
|
|
+ SELECT
|
|
|
+ objectid, pcbh, pch, dk_bh, dk_mc, xzz, dk_yt, td_zl, dk_mj, dk_qs, lx, pwh, pzrq, pz_mj, nmjf, bz, wgyy, lyjz, nczfs, nczsj,
|
|
|
+ st_astext(shape) as shape,
|
|
|
+ st_area(shape) as area
|
|
|
+ FROM sde.pewg
|
|
|
+ WHERE objectid = #{objectid}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 统计pewg总面积 -->
|
|
|
+ <select id="selectTotalArea" resultType="java.lang.Double">
|
|
|
+ SELECT SUM(st_area(shape)) FROM sde.pewg
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 根据批次统计面积 -->
|
|
|
+ <select id="selectAreaByPcbh" parameterType="java.lang.String" resultType="java.lang.Double">
|
|
|
+ SELECT SUM(st_area(shape)) FROM sde.pewg WHERE pcbh = #{pcbh}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 根据ID查询pewg详情,返回所有字段和面积 -->
|
|
|
+ <select id="selectByIdWithArea" parameterType="java.lang.Integer" resultType="com.zjugis.yzt.beans.entity.Pewg">
|
|
|
+ SELECT
|
|
|
+ objectid, pcbh, pch, dk_bh, dk_mc, xzz, dk_yt, td_zl, dk_mj, dk_qs, lx, pwh, pzrq, pz_mj, nmjf, bz, wgyy, lyjz, nczfs, nczsj,
|
|
|
+ st_astext(shape) as shape,
|
|
|
+ st_area(shape) as area
|
|
|
+ FROM sde.pewg
|
|
|
+ WHERE objectid = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+</mapper>
|