|
@@ -7,97 +7,87 @@
|
|
|
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">
|
|
|
+ <!-- 根据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>
|
|
|
- <if test="ew != null">
|
|
|
- ${ew.sqlSegment}
|
|
|
- </if>
|
|
|
- </where>
|
|
|
+ FROM sde.pewg
|
|
|
+ WHERE objectid = #{id}
|
|
|
</select>
|
|
|
|
|
|
- <!-- 使用SQL查询pewg表,包含所有字段和面积计算(不分页) -->
|
|
|
- <select id="selectPewgListWithArea" resultType="com.zjugis.yzt.beans.entity.Pewg">
|
|
|
+ <!-- 自定义分页查询pewg表,包含所有字段和面积计算 -->
|
|
|
+ <select id="selectPewgPageWithArea" parameterType="java.util.Map" resultType="com.zjugis.yzt.beans.entity.Pewg">
|
|
|
+ <![CDATA[
|
|
|
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 test="pch != null and pch != ''">
|
|
|
+ AND pch LIKE '%' || #{pch} || '%'
|
|
|
+ </if>
|
|
|
+ <if test="dkMc != null and dkMc != ''">
|
|
|
+ AND dk_mc LIKE '%' || #{dkMc} || '%'
|
|
|
+ </if>
|
|
|
+ <if test="minArea != null">
|
|
|
+ <![CDATA[ AND st_area(shape) >= #{minArea} ]]>
|
|
|
+ </if>
|
|
|
+ <if test="maxArea != null">
|
|
|
+ <![CDATA[ AND st_area(shape) <= #{maxArea} ]]>
|
|
|
+ </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="lx != null and lx != ''">
|
|
|
+ AND lx LIKE '%' || #{lx} || '%'
|
|
|
+ </if>
|
|
|
+ <if test="wgyy != null and wgyy != ''">
|
|
|
+ AND wgyy LIKE '%' || #{wgyy} || '%'
|
|
|
</if>
|
|
|
</where>
|
|
|
+ <![CDATA[ ORDER BY objectid DESC ]]>
|
|
|
+ LIMIT #{size} OFFSET #{offset}
|
|
|
</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
|
|
|
+ <!-- 统计符合条件的记录总数 -->
|
|
|
+ <select id="countPewgWithCondition" parameterType="java.util.Map" resultType="java.lang.Long">
|
|
|
+ <![CDATA[
|
|
|
+ SELECT COUNT(*)
|
|
|
FROM sde.pewg
|
|
|
+ ]]>
|
|
|
<where>
|
|
|
- <if test="pcbh != null and pcbh != ''">
|
|
|
- AND pcbh LIKE '%' || #{pcbh} || '%'
|
|
|
+ <if test="pch != null and pch != ''">
|
|
|
+ AND pch LIKE '%' || #{pch} || '%'
|
|
|
</if>
|
|
|
<if test="dkMc != null and dkMc != ''">
|
|
|
AND dk_mc LIKE '%' || #{dkMc} || '%'
|
|
|
</if>
|
|
|
+ <if test="minArea != null">
|
|
|
+ <![CDATA[ AND st_area(shape) >= #{minArea} ]]>
|
|
|
+ </if>
|
|
|
+ <if test="maxArea != null">
|
|
|
+ <![CDATA[ AND st_area(shape) <= #{maxArea} ]]>
|
|
|
+ </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>
|
|
|
+ <if test="wgyy != null and wgyy != ''">
|
|
|
+ AND wgyy LIKE '%' || #{wgyy} || '%'
|
|
|
+ </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>
|