|
@@ -0,0 +1,259 @@
|
|
|
+<?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.onemap.apply.mapper.qytdzz.TQytdzzXzgdMapper">
|
|
|
+
|
|
|
+ <resultMap type="TQytdzzXzgd" id="TQytdzzXzgdResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="geom" column="geom" />
|
|
|
+ <result property="tbbh" column="tbbh" />
|
|
|
+ <result property="qsxz" column="qsxz" />
|
|
|
+ <result property="tbmj" column="tbmj" />
|
|
|
+ <result property="kcdlbm" column="kcdlbm" />
|
|
|
+ <result property="kcxs" column="kcxs" />
|
|
|
+ <result property="kcmj" column="kcmj" />
|
|
|
+ <result property="tbdlmj" column="tbdlmj" />
|
|
|
+ <result property="gdlx" column="gdlx" />
|
|
|
+ <result property="gdpdjb" column="gdpdjb" />
|
|
|
+ <result property="frdbs" column="frdbs" />
|
|
|
+ <result property="czcsxm" column="czcsxm" />
|
|
|
+ <result property="sjnf" column="sjnf" />
|
|
|
+ <result property="bz" column="bz" />
|
|
|
+ <result property="bsm" column="bsm" />
|
|
|
+ <result property="ysdm" column="ysdm" />
|
|
|
+ <result property="zzhdlmc" column="zzhdlmc" />
|
|
|
+ <result property="qsdwdm" column="qsdwdm" />
|
|
|
+ <result property="qsdwmc" column="qsdwmc" />
|
|
|
+ <result property="zldwdm" column="zldwdm" />
|
|
|
+ <result property="zldwmc" column="zldwmc" />
|
|
|
+ <result property="xzgdlydlbm" column="xzgdlydlbm" />
|
|
|
+ <result property="zzhdlbm" column="zzhdlbm" />
|
|
|
+ <result property="xzgdlydlmc" column="xzgdlydlmc" />
|
|
|
+ <result property="xzgdmj" column="xzgdmj" />
|
|
|
+ <result property="xzgddb" column="xzgddb" />
|
|
|
+ <result property="xzgdlyxm" column="xzgdlyxm" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectTQytdzzXzgdVo">
|
|
|
+ select id, public.st_asewkt(public.st_force2d(geom)) geom, tbbh, qsxz, tbmj, kcdlbm, kcxs, kcmj, tbdlmj, gdlx, gdpdjb, frdbs, czcsxm, sjnf, bz, bsm, ysdm, zzhdlmc, qsdwdm, qsdwmc, zldwdm, zldwmc, xzgdlydlbm, zzhdlbm, xzgdlydlmc, xzgdmj, xzgddb, xzgdlyxm from t_qytdzz_xzgd
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectTQytdzzXzgdList" parameterType="TQytdzzXzgd" resultMap="TQytdzzXzgdResult">
|
|
|
+ <include refid="selectTQytdzzXzgdVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="geom != null and geom != ''"> and geom = #{geom}</if>
|
|
|
+ <if test="tbbh != null and tbbh != ''"> and tbbh = #{tbbh}</if>
|
|
|
+ <if test="qsxz != null and qsxz != ''"> and qsxz = #{qsxz}</if>
|
|
|
+ <if test="tbmj != null "> and tbmj = #{tbmj}</if>
|
|
|
+ <if test="kcdlbm != null and kcdlbm != ''"> and kcdlbm = #{kcdlbm}</if>
|
|
|
+ <if test="kcxs != null "> and kcxs = #{kcxs}</if>
|
|
|
+ <if test="kcmj != null "> and kcmj = #{kcmj}</if>
|
|
|
+ <if test="tbdlmj != null "> and tbdlmj = #{tbdlmj}</if>
|
|
|
+ <if test="gdlx != null and gdlx != ''"> and gdlx = #{gdlx}</if>
|
|
|
+ <if test="gdpdjb != null and gdpdjb != ''"> and gdpdjb = #{gdpdjb}</if>
|
|
|
+ <if test="frdbs != null and frdbs != ''"> and frdbs = #{frdbs}</if>
|
|
|
+ <if test="czcsxm != null and czcsxm != ''"> and czcsxm = #{czcsxm}</if>
|
|
|
+ <if test="sjnf != null "> and sjnf = #{sjnf}</if>
|
|
|
+ <if test="bz != null and bz != ''"> and bz = #{bz}</if>
|
|
|
+ <if test="bsm != null and bsm != ''"> and bsm like concat( #{bsm}, '%') </if>
|
|
|
+ <if test="ysdm != null and ysdm != ''"> and ysdm = #{ysdm}</if>
|
|
|
+ <if test="zzhdlmc != null and zzhdlmc != ''"> and zzhdlmc = #{zzhdlmc}</if>
|
|
|
+ <if test="qsdwdm != null and qsdwdm != ''"> and qsdwdm = #{qsdwdm}</if>
|
|
|
+ <if test="qsdwmc != null and qsdwmc != ''"> and qsdwmc = #{qsdwmc}</if>
|
|
|
+ <if test="zldwdm != null and zldwdm != ''"> and zldwdm = #{zldwdm}</if>
|
|
|
+ <if test="zldwmc != null and zldwmc != ''"> and zldwmc = #{zldwmc}</if>
|
|
|
+ <if test="xzgdlydlbm != null and xzgdlydlbm != ''"> and xzgdlydlbm = #{xzgdlydlbm}</if>
|
|
|
+ <if test="zzhdlbm != null and zzhdlbm != ''"> and zzhdlbm = #{zzhdlbm}</if>
|
|
|
+ <if test="xzgdlydlmc != null and xzgdlydlmc != ''"> and xzgdlydlmc = #{xzgdlydlmc}</if>
|
|
|
+ <if test="xzgdmj != null "> and xzgdmj = #{xzgdmj}</if>
|
|
|
+ <if test="xzgddb != null and xzgddb != ''"> and xzgddb = #{xzgddb}</if>
|
|
|
+ <if test="xzgdlyxm != null and xzgdlyxm != ''"> and xzgdlyxm = #{xzgdlyxm}</if>
|
|
|
+ <if test="ids != null and ids.size>0">
|
|
|
+ and id in (
|
|
|
+ <foreach collection="ids" item="param" separator="," >
|
|
|
+ #{param}
|
|
|
+ </foreach>
|
|
|
+ )
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectTQytdzzXzgdById" parameterType="Long" resultMap="TQytdzzXzgdResult">
|
|
|
+ <include refid="selectTQytdzzXzgdVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertTQytdzzXzgd" parameterType="TQytdzzXzgd">
|
|
|
+ insert into t_qytdzz_xzgd
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">id,</if>
|
|
|
+ <if test="geom != null">geom,</if>
|
|
|
+ <if test="tbbh != null">tbbh,</if>
|
|
|
+ <if test="qsxz != null">qsxz,</if>
|
|
|
+ <if test="tbmj != null">tbmj,</if>
|
|
|
+ <if test="kcdlbm != null">kcdlbm,</if>
|
|
|
+ <if test="kcxs != null">kcxs,</if>
|
|
|
+ <if test="kcmj != null">kcmj,</if>
|
|
|
+ <if test="tbdlmj != null">tbdlmj,</if>
|
|
|
+ <if test="gdlx != null">gdlx,</if>
|
|
|
+ <if test="gdpdjb != null">gdpdjb,</if>
|
|
|
+ <if test="frdbs != null">frdbs,</if>
|
|
|
+ <if test="czcsxm != null">czcsxm,</if>
|
|
|
+ <if test="sjnf != null">sjnf,</if>
|
|
|
+ <if test="bz != null">bz,</if>
|
|
|
+ <if test="bsm != null">bsm,</if>
|
|
|
+ <if test="ysdm != null">ysdm,</if>
|
|
|
+ <if test="zzhdlmc != null">zzhdlmc,</if>
|
|
|
+ <if test="qsdwdm != null">qsdwdm,</if>
|
|
|
+ <if test="qsdwmc != null">qsdwmc,</if>
|
|
|
+ <if test="zldwdm != null">zldwdm,</if>
|
|
|
+ <if test="zldwmc != null">zldwmc,</if>
|
|
|
+ <if test="xzgdlydlbm != null">xzgdlydlbm,</if>
|
|
|
+ <if test="zzhdlbm != null">zzhdlbm,</if>
|
|
|
+ <if test="xzgdlydlmc != null">xzgdlydlmc,</if>
|
|
|
+ <if test="xzgdmj != null">xzgdmj,</if>
|
|
|
+ <if test="xzgddb != null">xzgddb,</if>
|
|
|
+ <if test="xzgdlyxm != null">xzgdlyxm,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">#{id},</if>
|
|
|
+ <if test="geom != null">#{geom},</if>
|
|
|
+ <if test="tbbh != null">#{tbbh},</if>
|
|
|
+ <if test="qsxz != null">#{qsxz},</if>
|
|
|
+ <if test="tbmj != null">#{tbmj},</if>
|
|
|
+ <if test="kcdlbm != null">#{kcdlbm},</if>
|
|
|
+ <if test="kcxs != null">#{kcxs},</if>
|
|
|
+ <if test="kcmj != null">#{kcmj},</if>
|
|
|
+ <if test="tbdlmj != null">#{tbdlmj},</if>
|
|
|
+ <if test="gdlx != null">#{gdlx},</if>
|
|
|
+ <if test="gdpdjb != null">#{gdpdjb},</if>
|
|
|
+ <if test="frdbs != null">#{frdbs},</if>
|
|
|
+ <if test="czcsxm != null">#{czcsxm},</if>
|
|
|
+ <if test="sjnf != null">#{sjnf},</if>
|
|
|
+ <if test="bz != null">#{bz},</if>
|
|
|
+ <if test="bsm != null">#{bsm},</if>
|
|
|
+ <if test="ysdm != null">#{ysdm},</if>
|
|
|
+ <if test="zzhdlmc != null">#{zzhdlmc},</if>
|
|
|
+ <if test="qsdwdm != null">#{qsdwdm},</if>
|
|
|
+ <if test="qsdwmc != null">#{qsdwmc},</if>
|
|
|
+ <if test="zldwdm != null">#{zldwdm},</if>
|
|
|
+ <if test="zldwmc != null">#{zldwmc},</if>
|
|
|
+ <if test="xzgdlydlbm != null">#{xzgdlydlbm},</if>
|
|
|
+ <if test="zzhdlbm != null">#{zzhdlbm},</if>
|
|
|
+ <if test="xzgdlydlmc != null">#{xzgdlydlmc},</if>
|
|
|
+ <if test="xzgdmj != null">#{xzgdmj},</if>
|
|
|
+ <if test="xzgddb != null">#{xzgddb},</if>
|
|
|
+ <if test="xzgdlyxm != null">#{xzgdlyxm},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateTQytdzzXzgd" parameterType="TQytdzzXzgd">
|
|
|
+ update t_qytdzz_xzgd
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="geom != null">geom = #{geom},</if>
|
|
|
+ <if test="tbbh != null">tbbh = #{tbbh},</if>
|
|
|
+ <if test="qsxz != null">qsxz = #{qsxz},</if>
|
|
|
+ <if test="tbmj != null">tbmj = #{tbmj},</if>
|
|
|
+ <if test="kcdlbm != null">kcdlbm = #{kcdlbm},</if>
|
|
|
+ <if test="kcxs != null">kcxs = #{kcxs},</if>
|
|
|
+ <if test="kcmj != null">kcmj = #{kcmj},</if>
|
|
|
+ <if test="tbdlmj != null">tbdlmj = #{tbdlmj},</if>
|
|
|
+ <if test="gdlx != null">gdlx = #{gdlx},</if>
|
|
|
+ <if test="gdpdjb != null">gdpdjb = #{gdpdjb},</if>
|
|
|
+ <if test="frdbs != null">frdbs = #{frdbs},</if>
|
|
|
+ <if test="czcsxm != null">czcsxm = #{czcsxm},</if>
|
|
|
+ <if test="sjnf != null">sjnf = #{sjnf},</if>
|
|
|
+ <if test="bz != null">bz = #{bz},</if>
|
|
|
+ <if test="bsm != null">bsm = #{bsm},</if>
|
|
|
+ <if test="ysdm != null">ysdm = #{ysdm},</if>
|
|
|
+ <if test="zzhdlmc != null">zzhdlmc = #{zzhdlmc},</if>
|
|
|
+ <if test="qsdwdm != null">qsdwdm = #{qsdwdm},</if>
|
|
|
+ <if test="qsdwmc != null">qsdwmc = #{qsdwmc},</if>
|
|
|
+ <if test="zldwdm != null">zldwdm = #{zldwdm},</if>
|
|
|
+ <if test="zldwmc != null">zldwmc = #{zldwmc},</if>
|
|
|
+ <if test="xzgdlydlbm != null">xzgdlydlbm = #{xzgdlydlbm},</if>
|
|
|
+ <if test="zzhdlbm != null">zzhdlbm = #{zzhdlbm},</if>
|
|
|
+ <if test="xzgdlydlmc != null">xzgdlydlmc = #{xzgdlydlmc},</if>
|
|
|
+ <if test="xzgdmj != null">xzgdmj = #{xzgdmj},</if>
|
|
|
+ <if test="xzgddb != null">xzgddb = #{xzgddb},</if>
|
|
|
+ <if test="xzgdlyxm != null">xzgdlyxm = #{xzgdlyxm},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteTQytdzzXzgdById" parameterType="Long">
|
|
|
+ delete from t_qytdzz_xzgd where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteTQytdzzXzgdByIds" parameterType="String">
|
|
|
+ delete from t_qytdzz_xzgd where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <select id="statAreaByZzxm" parameterType="Long" resultType="Double">
|
|
|
+ select ROUND(coalesce(sum(area_number::numeric),0),2) area_number from v_qytdzz_zzxm_xzgd where pid = #{zzxmid}
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+ <select id="selectXzgdByZzxmId" parameterType="Long" resultType="java.util.Map">
|
|
|
+ select * from v_qytdzz_zzxm_xzgd where pid = #{zzxmid}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectSjzl" resultType="java.util.Map">
|
|
|
+ select t1.geom ,ROUND(coalesce(area_number::numeric,0),2) area_number,coalesce(count_number::numeric,0) count_number from (
|
|
|
+ SELECT public.st_asewkt(public.st_force2d(public.st_union(geom))) geom,
|
|
|
+ public.st_area( public.st_transform(public.st_union(geom),4525)) area_number,
|
|
|
+ count(*) count_number FROM t_qytdzz_xzgd
|
|
|
+ where bsm like concat( #{bsm}, '%')
|
|
|
+ <if test="zzxmid != null">
|
|
|
+ and id in ( select id from v_qytdzz_zzxm_xzgd where pid = #{zzxmid} )
|
|
|
+ </if>
|
|
|
+ ) t1
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectSjzlXzgd" resultType="java.util.Map">
|
|
|
+ select t1.geom ,ROUND(coalesce(area_number::numeric,0),2) area_number,coalesce(count_number::numeric,0) count_number,zzhdlbm,zzhdlmc from (
|
|
|
+ SELECT public.st_asewkt(public.st_force2d(public.st_union(geom))) geom,
|
|
|
+ public.st_area( public.st_transform(public.st_union(geom),4525)) area_number,
|
|
|
+ count(*) count_number, zzhdlbm,zzhdlmc FROM t_qytdzz_xzgd
|
|
|
+ where bsm like concat( #{bsm}, '%')
|
|
|
+ <if test="zzxmid != null">
|
|
|
+ and id in ( select id from v_qytdzz_zzxm_xzgd where pid = #{zzxmid} )
|
|
|
+ </if>
|
|
|
+ group by zzhdlbm,zzhdlmc
|
|
|
+ ) t1
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+ <select id="selectSjzlXzgdly" resultType="java.util.Map">
|
|
|
+ select dlbm,dlmc,geom,ROUND(coalesce(area_number::numeric,0),2) area_number,coalesce(count_number::numeric,0) count_number from (
|
|
|
+ select dlbm,dlmc,public.st_asewkt(public.st_force2d(public.st_union(geom))) geom,
|
|
|
+ public.st_area( public.st_transform(public.st_union(geom),4525)) area_number,
|
|
|
+ count(*) count_number from (
|
|
|
+ select public.ST_Intersection(t1.geom,t2.geom) geom,t2.dlbm,t2.dlmc
|
|
|
+ from (
|
|
|
+ SELECT public.st_union(geom) geom FROM t_qytdzz_xzgd
|
|
|
+ where bsm like concat( #{bsm}, '%')
|
|
|
+ <if test="zzxmid != null">
|
|
|
+ and id in ( select id from v_qytdzz_zzxm_xzgd where pid = #{zzxmid} )
|
|
|
+ </if>
|
|
|
+ ) t1,tb_qytdzz_sd_zzq t2 where public.st_intersects ( t1.geom , t2.geom )
|
|
|
+ )v1 group by dlbm,dlmc )v2 where ROUND(coalesce(area_number::numeric,0),2) > 0
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+ <select id="selectSjzlXzgdLylx" resultType="java.util.Map">
|
|
|
+ select t1.geom ,ROUND(coalesce(area_number::numeric,0),2) area_number,coalesce(count_number::numeric,0) count_number,xzgdlydlbm zzqdlbm, concat('Q',xzgdlydlmc) zzqdlmc, zzhdlbm, concat('H',zzhdlmc) zzhdlmc from (
|
|
|
+ select xzgdlydlbm, xzgdlydlmc, zzhdlbm, zzhdlmc,public.st_asewkt(public.st_force2d(public.st_union(geom))) geom, public.st_area(public.st_transform(public.st_union(geom),4525)) area_number, count(*) count_number
|
|
|
+ from vector.t_qytdzz_xzgd
|
|
|
+ where bsm like concat( #{bsm}, '%')
|
|
|
+ <if test="zzxmid != null">
|
|
|
+ and id in ( select id from v_qytdzz_zzxm_xzgd where pid = #{zzxmid} )
|
|
|
+ </if>
|
|
|
+ group by xzgdlydlbm, xzgdlydlmc, zzhdlbm, zzhdlmc
|
|
|
+ ) t1
|
|
|
+ </select>
|
|
|
+</mapper>
|