|
|
@@ -7,30 +7,36 @@
|
|
|
<resultMap id="gongdiJihuaMap" type="com.siwei.apply.domain.GongdiJihua">
|
|
|
<id column="gid" property="gid"/>
|
|
|
<result column="fid" property="fid"/>
|
|
|
- <result column="mj_pfm" property="mjPfm"/>
|
|
|
- <result column="mj_mu" property="mjMu"/>
|
|
|
+ <result column="mj_12" property="mj12"/>
|
|
|
+ <result column="mj_m" property="mjM"/>
|
|
|
<result column="xmmc" property="xmmc"/>
|
|
|
<result column="tdyt" property="tdyt"/>
|
|
|
<result column="gyfs" property="gyfs"/>
|
|
|
- <result column="gysj" property="gysj"/>
|
|
|
+ <result column="ngysj" property="ngysj"/>
|
|
|
+ <result column="nf" property="nf"/>
|
|
|
+ <result column="nydwz" property="nydwz"/>
|
|
|
+ <result column="xzqmc" property="xzqmc"/>
|
|
|
+ <result column="tgdw" property="tgdw"/>
|
|
|
+ <result column="ybpmj" property="ybpmj"/>
|
|
|
+ <result column="wbpmj" property="wbpmj"/>
|
|
|
<result column="bz" property="bz"/>
|
|
|
<result column="geom" property="geom"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<insert id="add" parameterType="com.siwei.apply.domain.GongdiJihua">
|
|
|
- INSERT INTO vector.gj_gongdi_jihua (fid, mj_pfm, mj_mu, xmmc, tdyt, gyfs, gysj, bz, geom)
|
|
|
- VALUES (#{fid}, #{mjPfm}, #{mjMu}, #{xmmc}, #{tdyt}, #{gyfs}, #{gysj}, #{bz}, ST_GeomFromEWKT(#{geom}))
|
|
|
+ INSERT INTO vector.gj_gongdi_xiangmu_jihua (fid, mj_12, mj_m, xmmc, tdyt, gyfs, ngysj, nf, nydwz, xzqmc, tgdw, ybpmj, wbpmj, bz, geom)
|
|
|
+ VALUES (#{fid}, #{mj12}, #{mjM}, #{xmmc}, #{tdyt}, #{gyfs}, #{ngysj}, #{nf}, #{nydwz}, #{xzqmc}, #{tgdw}, #{ybpmj}, #{wbpmj}, #{bz}, ST_GeomFromEWKT(#{geom}))
|
|
|
</insert>
|
|
|
|
|
|
<select id="get" resultMap="gongdiJihuaMap">
|
|
|
- SELECT gid, fid, mj_pfm, mj_mu, xmmc, tdyt, gyfs, gysj, bz, ST_AsEWKT(geom) as geom
|
|
|
- FROM vector.gj_gongdi_jihua
|
|
|
+ SELECT gid, fid, mj_12, mj_m, xmmc, tdyt, gyfs, ngysj, nf, nydwz, xzqmc, tgdw, ybpmj, wbpmj, bz, ST_AsEWKT(geom) as geom
|
|
|
+ FROM vector.gj_gongdi_xiangmu_jihua
|
|
|
WHERE gid = #{gid}
|
|
|
</select>
|
|
|
|
|
|
<select id="getList" parameterType="com.siwei.apply.domain.vo.GongdiJihuaFilterVo" resultMap="gongdiJihuaMap">
|
|
|
- SELECT gid, fid, mj_pfm, mj_mu, xmmc, tdyt, gyfs, gysj, bz, ST_AsEWKT(geom) as geom
|
|
|
- FROM vector.gj_gongdi_jihua
|
|
|
+ SELECT gid, fid, mj_12, mj_m, xmmc, tdyt, gyfs, ngysj, nf, nydwz, xzqmc, tgdw, ybpmj, wbpmj, bz, ST_AsEWKT(geom) as geom
|
|
|
+ FROM vector.gj_gongdi_xiangmu_jihua
|
|
|
<where>
|
|
|
<if test="xmmc != null and xmmc != ''">
|
|
|
AND xmmc LIKE CONCAT('%', #{xmmc}, '%')
|
|
|
@@ -42,30 +48,22 @@
|
|
|
AND gyfs = #{gyfs}
|
|
|
</if>
|
|
|
<if test="startDate != null and startDate != ''">
|
|
|
- AND gysj >= #{startDate}
|
|
|
+ AND ngysj >= #{startDate}
|
|
|
</if>
|
|
|
<if test="endDate != null and endDate != ''">
|
|
|
- AND gysj <= #{endDate}
|
|
|
+ AND ngysj <= #{endDate}
|
|
|
</if>
|
|
|
<if test="year != null and year != ''">
|
|
|
- AND TO_CHAR(gysj, 'YYYY') = #{year}
|
|
|
+ AND TO_CHAR(ngysj, 'YYYY') = #{year}
|
|
|
</if>
|
|
|
</where>
|
|
|
ORDER BY gid DESC
|
|
|
LIMIT #{pageSize} OFFSET #{offset}
|
|
|
</select>
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
<select id="getCount" parameterType="com.siwei.apply.domain.vo.GongdiJihuaFilterVo" resultType="int">
|
|
|
SELECT COUNT(*)
|
|
|
- FROM vector.gj_gongdi_jihua
|
|
|
+ FROM vector.gj_gongdi_xiangmu_jihua
|
|
|
<where>
|
|
|
<if test="xmmc != null and xmmc != ''">
|
|
|
AND xmmc LIKE CONCAT('%', #{xmmc}, '%')
|
|
|
@@ -77,24 +75,30 @@
|
|
|
AND gyfs = #{gyfs}
|
|
|
</if>
|
|
|
<if test="startDate != null and startDate != ''">
|
|
|
- AND gysj >= #{startDate}
|
|
|
+ AND ngysj >= #{startDate}
|
|
|
</if>
|
|
|
<if test="endDate != null and endDate != ''">
|
|
|
- AND gysj <= #{endDate}
|
|
|
+ AND ngysj <= #{endDate}
|
|
|
</if>
|
|
|
</where>
|
|
|
</select>
|
|
|
|
|
|
<update id="update" parameterType="com.siwei.apply.domain.GongdiJihua">
|
|
|
- UPDATE vector.gj_gongdi_jihua
|
|
|
+ UPDATE vector.gj_gongdi_xiangmu_jihua
|
|
|
<set>
|
|
|
<if test="fid != null">fid = #{fid},</if>
|
|
|
- <if test="mjPfm != null">mj_pfm = #{mjPfm},</if>
|
|
|
- <if test="mjMu != null">mj_mu = #{mjMu},</if>
|
|
|
+ <if test="mj12 != null">mj_12 = #{mj12},</if>
|
|
|
+ <if test="mjM != null">mj_m = #{mjM},</if>
|
|
|
<if test="xmmc != null">xmmc = #{xmmc},</if>
|
|
|
<if test="tdyt != null">tdyt = #{tdyt},</if>
|
|
|
<if test="gyfs != null">gyfs = #{gyfs},</if>
|
|
|
- <if test="gysj != null">gysj = #{gysj},</if>
|
|
|
+ <if test="ngysj != null">ngysj = #{ngysj},</if>
|
|
|
+ <if test="nf != null">nf = #{nf},</if>
|
|
|
+ <if test="nydwz != null">nydwz = #{nydwz},</if>
|
|
|
+ <if test="xzqmc != null">xzqmc = #{xzqmc},</if>
|
|
|
+ <if test="tgdw != null">tgdw = #{tgdw},</if>
|
|
|
+ <if test="ybpmj != null">ybpmj = #{ybpmj},</if>
|
|
|
+ <if test="wbpmj != null">wbpmj = #{wbpmj},</if>
|
|
|
<if test="bz != null">bz = #{bz},</if>
|
|
|
<if test="geom != null">geom = ST_GeomFromEWKT(#{geom}),</if>
|
|
|
</set>
|
|
|
@@ -102,7 +106,7 @@
|
|
|
</update>
|
|
|
|
|
|
<delete id="batchDelete">
|
|
|
- DELETE FROM vector.gj_gongdi_jihua
|
|
|
+ DELETE FROM vector.gj_gongdi_xiangmu_jihua
|
|
|
WHERE gid IN
|
|
|
<foreach collection="gids" item="gid" open="(" separator="," close=")">
|
|
|
#{gid}
|
|
|
@@ -110,26 +114,26 @@
|
|
|
</delete>
|
|
|
|
|
|
<select id="getByGeomIntersects" resultMap="gongdiJihuaMap">
|
|
|
- SELECT gid, fid, mj_pfm, mj_mu, xmmc, tdyt, gyfs, gysj, bz, ST_AsEWKT(geom) as geom
|
|
|
- FROM vector.gj_gongdi_jihua
|
|
|
+ SELECT gid, fid, mj_12, mj_m, xmmc, tdyt, gyfs, ngysj, nf, nydwz, xzqmc, tgdw, ybpmj, wbpmj, bz, ST_AsEWKT(geom) as geom
|
|
|
+ FROM vector.gj_gongdi_xiangmu_jihua
|
|
|
WHERE public.ST_Intersects(geom, public.ST_GeomFromEWKT(#{ewkt}))
|
|
|
</select>
|
|
|
|
|
|
<select id="getPlanSummaryByTimeRange" resultType="map">
|
|
|
SELECT
|
|
|
- COALESCE(SUM(mj_pfm), 0) AS planarea,
|
|
|
- COALESCE(SUM(mj_mu), 0) AS planmu,
|
|
|
+ COALESCE(SUM(mj_12), 0) AS planarea,
|
|
|
+ COALESCE(SUM(mj_m), 0) AS planmu,
|
|
|
COUNT(*) AS plancount,
|
|
|
COALESCE(SUM(CASE WHEN gyfs = '出让' THEN 1 ELSE 0 END), 0) AS plantransfer,
|
|
|
COALESCE(SUM(CASE WHEN gyfs = '划拨' THEN 1 ELSE 0 END), 0) AS planallocation,
|
|
|
COALESCE(SUM(CASE WHEN gyfs IS NULL OR gyfs NOT IN ('出让', '划拨') THEN 1 ELSE 0 END), 0) AS planother
|
|
|
- FROM vector.gj_gongdi_jihua
|
|
|
+ FROM vector.gj_gongdi_xiangmu_jihua
|
|
|
<where>
|
|
|
<if test="startTime != null and startTime != ''">
|
|
|
- AND gysj >= #{startTime}::date
|
|
|
+ AND ngysj >= #{startTime}::date
|
|
|
</if>
|
|
|
<if test="endTime != null and endTime != ''">
|
|
|
- AND gysj <= #{endTime}::date
|
|
|
+ AND ngysj <= #{endTime}::date
|
|
|
</if>
|
|
|
</where>
|
|
|
</select>
|
|
|
@@ -137,20 +141,20 @@
|
|
|
<select id="getPlanStatsByLandType" resultType="map">
|
|
|
SELECT
|
|
|
COALESCE(tdyt, '未知') AS category,
|
|
|
- COALESCE(SUM(mj_pfm), 0) AS planarea,
|
|
|
- COALESCE(SUM(mj_mu), 0) AS planmu,
|
|
|
+ COALESCE(SUM(mj_12), 0) AS planarea,
|
|
|
+ COALESCE(SUM(mj_m), 0) AS planmu,
|
|
|
COUNT(*) AS plancount,
|
|
|
COALESCE(SUM(CASE WHEN gyfs = '出让' THEN 1 ELSE 0 END), 0) AS plantransfer,
|
|
|
COALESCE(SUM(CASE WHEN gyfs = '划拨' THEN 1 ELSE 0 END), 0) AS planallocation,
|
|
|
COALESCE(SUM(CASE WHEN gyfs IS NULL OR gyfs NOT IN ('出让', '划拨') THEN 1 ELSE 0 END), 0) AS planother,
|
|
|
'0%' AS supplyrate
|
|
|
- FROM vector.gj_gongdi_jihua
|
|
|
+ FROM vector.gj_gongdi_xiangmu_jihua
|
|
|
<where>
|
|
|
<if test="startTime != null and startTime != ''">
|
|
|
- AND gysj >= #{startTime}::date
|
|
|
+ AND ngysj >= #{startTime}::date
|
|
|
</if>
|
|
|
<if test="endTime != null and endTime != ''">
|
|
|
- AND gysj <= #{endTime}::date
|
|
|
+ AND ngysj <= #{endTime}::date
|
|
|
</if>
|
|
|
</where>
|
|
|
GROUP BY tdyt
|
|
|
@@ -160,24 +164,81 @@
|
|
|
<select id="getPlanStatsBySupplyMode" resultType="map">
|
|
|
SELECT
|
|
|
COALESCE(gyfs, '未知') AS category,
|
|
|
- COALESCE(SUM(mj_pfm), 0) AS planarea,
|
|
|
- COALESCE(SUM(mj_mu), 0) AS planmu,
|
|
|
+ COALESCE(SUM(mj_12), 0) AS planarea,
|
|
|
+ COALESCE(SUM(mj_m), 0) AS planmu,
|
|
|
COUNT(*) AS plancount,
|
|
|
COALESCE(SUM(CASE WHEN gyfs = '出让' THEN 1 ELSE 0 END), 0) AS plantransfer,
|
|
|
COALESCE(SUM(CASE WHEN gyfs = '划拨' THEN 1 ELSE 0 END), 0) AS planallocation,
|
|
|
COALESCE(SUM(CASE WHEN gyfs IS NULL OR gyfs NOT IN ('出让', '划拨') THEN 1 ELSE 0 END), 0) AS planother,
|
|
|
'0%' AS supplyrate
|
|
|
- FROM vector.gj_gongdi_jihua
|
|
|
+ FROM vector.gj_gongdi_xiangmu_jihua
|
|
|
<where>
|
|
|
<if test="startTime != null and startTime != ''">
|
|
|
- AND gysj >= #{startTime}::date
|
|
|
+ AND ngysj >= #{startTime}::date
|
|
|
</if>
|
|
|
<if test="endTime != null and endTime != ''">
|
|
|
- AND gysj <= #{endTime}::date
|
|
|
+ AND ngysj <= #{endTime}::date
|
|
|
</if>
|
|
|
</where>
|
|
|
GROUP BY gyfs
|
|
|
ORDER BY planarea DESC
|
|
|
</select>
|
|
|
|
|
|
-</mapper>
|
|
|
+ <select id="supplyList" resultType="map">
|
|
|
+ SELECT *
|
|
|
+ FROM vector.${tableName}
|
|
|
+ WHERE 1=1
|
|
|
+ <if test="year != null and year != '' and year != '0'">
|
|
|
+ AND nf = #{year}
|
|
|
+ </if>
|
|
|
+ ORDER BY gid ASC
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+ <insert id="insertTableSupplyData" parameterType="map">
|
|
|
+ INSERT INTO vector.${tableName}
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="data.fid != null">fid,</if>
|
|
|
+ <if test="data.mj_12 != null">mj_12,</if>
|
|
|
+ <if test="data.mj_m != null">mj_m,</if>
|
|
|
+ <if test="data.xmmc != null">xmmc,</if>
|
|
|
+ <if test="data.tdyt != null">tdyt,</if>
|
|
|
+ <if test="data.gyfs != null">gyfs,</if>
|
|
|
+ <if test="data.ngysj != null">ngysj,</if>
|
|
|
+ <if test="data.nf != null">nf,</if>
|
|
|
+ <if test="data.nydwz != null">nydwz,</if>
|
|
|
+ <if test="data.xzqmc != null">xzqmc,</if>
|
|
|
+ <if test="data.tgdw != null">tgdw,</if>
|
|
|
+ <if test="data.ybpmj != null">ybpmj,</if>
|
|
|
+ <if test="data.wbpmj != null">wbpmj,</if>
|
|
|
+ <if test="data.bz != null">bz,</if>
|
|
|
+ <if test="data.the_geom != null">geom,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="data.fid != null">#{data.fid}::int4,</if>
|
|
|
+ <if test="data.mj_12 != null">#{data.mj_12}::numeric,</if>
|
|
|
+ <if test="data.mj_m != null">#{data.mj_m}::numeric,</if>
|
|
|
+ <if test="data.xmmc != null">#{data.xmmc}::varchar,</if>
|
|
|
+ <if test="data.tdyt != null">#{data.tdyt}::varchar,</if>
|
|
|
+ <if test="data.gyfs != null">#{data.gyfs}::varchar,</if>
|
|
|
+ <if test="data.ngysj != null">#{data.ngysj}::date,</if>
|
|
|
+ <if test="data.nf != null">#{data.nf}::varchar,</if>
|
|
|
+ <if test="data.nydwz != null">#{data.nydwz}::varchar,</if>
|
|
|
+ <if test="data.xzqmc != null">#{data.xzqmc}::varchar,</if>
|
|
|
+ <if test="data.tgdw != null">#{data.tgdw}::varchar,</if>
|
|
|
+ <if test="data.ybpmj != null">#{data.ybpmj}::numeric,</if>
|
|
|
+ <if test="data.wbpmj != null">#{data.wbpmj}::numeric,</if>
|
|
|
+ <if test="data.bz != null">#{data.bz}::varchar,</if>
|
|
|
+ <if test="data.the_geom != null">public.st_transform(public.st_geomfromewkt(#{data.the_geom}), #{shpDbSRID}),</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <delete id="deleteByTable" parameterType="String">
|
|
|
+ DELETE FROM vector.${tableName}
|
|
|
+ WHERE 1=1
|
|
|
+ <if test="gid != null and gid !=''">
|
|
|
+ and gid = #{gid}
|
|
|
+ </if>
|
|
|
+ </delete>
|
|
|
+
|
|
|
+</mapper>
|