ZrzMapper.xml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.siwei.apply.mapper.cadastre.ZrzMapper">
  6. <resultMap id="BaseResultMap" type="com.siwei.apply.domain.cadastre.Zrz">
  7. <id column="bsm" property="bsm"/>
  8. <result column="ysdm" property="ysdm"/>
  9. <result column="bdcdyh" property="bdcdyh"/>
  10. <result column="zddm" property="zddm"/>
  11. <result column="xmbh" property="xmbh"/>
  12. <result column="dclxtzm" property="dclxtzm"/>
  13. <result column="glh" property="glh"/>
  14. <result column="dzjgh" property="dzjgh"/>
  15. <result column="zrzh" property="zrzh"/>
  16. <result column="lzdm" property="lzdm"/>
  17. <result column="lzzl" property="lzzl"/>
  18. <result column="xmmc" property="xmmc"/>
  19. <result column="jzwmc" property="jzwmc"/>
  20. <result column="jgrq" property="jgrq"/>
  21. <result column="jzwgd" property="jzwgd"/>
  22. <result column="zzdmj" property="zzdmj"/>
  23. <result column="zydmj" property="zydmj"/>
  24. <result column="ycjzmj" property="ycjzmj"/>
  25. <result column="scjzmj" property="scjzmj"/>
  26. <result column="zcs" property="zcs"/>
  27. <result column="dscs" property="dscs"/>
  28. <result column="dxcs" property="dxcs"/>
  29. <result column="dxsd" property="dxsd"/>
  30. <result column="ghyt" property="ghyt"/>
  31. <result column="ytmc" property="ytmc"/>
  32. <result column="pzyt" property="pzyt"/>
  33. <result column="sjyt" property="sjyt"/>
  34. <result column="fwjg" property="fwjg"/>
  35. <result column="zts" property="zts"/>
  36. <result column="dah" property="dah"/>
  37. <result column="bz" property="bz"/>
  38. <result column="zt" property="zt"/>
  39. <result column="djzt" property="djzt"/>
  40. <result column="ybdcdyh" property="ybdcdyh"/>
  41. <result column="jsxmmc" property="jsxmmc"/>
  42. <result column="jsgcghxkzh" property="jsgcghxkzh"/>
  43. <result column="jsgcghxkz" property="jsgcghxkz"/>
  44. <result column="xcjsghxkzh" property="xcjsghxkzh"/>
  45. <result column="xcjsghxkz" property="xcjsghxkz"/>
  46. <result column="ghhsjgwj" property="ghhsjgwj"/>
  47. <result column="qlrsjsyrlxm" property="qlrsjsyrlxm"/>
  48. <result column="fwxz" property="fwxz"/>
  49. <result column="gyjzmj" property="gyjzmj"/>
  50. <result column="gyqk" property="gyqk"/>
  51. <result column="zyjzmj" property="zyjzmj"/>
  52. <result column="ftjzmj" property="ftjzmj"/>
  53. <result column="fwcqly" property="fwcqly"/>
  54. <result column="cqlyzmcl" property="cqlyzmcl"/>
  55. <result column="fwqsjxsyt" property="fwqsjxsyt"/>
  56. <result column="fct" property="fct"/>
  57. <result column="fjsm" property="fjsm"/>
  58. <result column="dcyj" property="dcyj"/>
  59. <result column="dcy" property="dcy"/>
  60. <result column="dcrq" property="dcrq"/>
  61. <result column="shyj" property="shyj"/>
  62. <result column="shy" property="shy"/>
  63. <result column="shrq" property="shrq"/>
  64. <result column="fwdcb" property="fwdcb"/>
  65. <result column="fcct" property="fcct"/>
  66. <result column="bdcdyb" property="bdcdyb"/>
  67. <result column="dcdw" property="dcdw"/>
  68. <result column="geom" property="geom"/>
  69. <result column="valid_flag" property="validFlag"/>
  70. </resultMap>
  71. <insert id="add" parameterType="com.siwei.apply.domain.cadastre.Zrz">
  72. INSERT INTO vector.zrz (
  73. bsm, ysdm, bdcdyh, zddm, xmbh, dclxtzm, glh, dzjgh, zrzh, lzdm,
  74. lzzl, xmmc, jzwmc, jgrq, jzwgd, zzdmj, zydmj, ycjzmj, scjzmj, zcs,
  75. dscs, dxcs, dxsd, ghyt, ytmc, pzyt, sjyt, fwjg, zts, dah, bz,
  76. zt, djzt, ybdcdyh, jsxmmc, jsgcghxkzh, jsgcghxkz, xcjsghxkzh,
  77. xcjsghxkz, ghhsjgwj, qlrsjsyrlxm, fwxz, gyjzmj, gyqk, zyjzmj,
  78. ftjzmj, fwcqly, cqlyzmcl, fwqsjxsyt, fct, fjsm, dcyj, dcy, dcrq,
  79. shyj, shy, shrq, fwdcb, fcct, bdcdyb, dcdw, geom, valid_flag
  80. ) VALUES (
  81. #{bsm}, #{ysdm}, #{bdcdyh}, #{zddm}, #{xmbh}, #{dclxtzm}, #{glh}, #{dzjgh}, #{zrzh}, #{lzdm},
  82. #{lzzl}, #{xmmc}, #{jzwmc}, #{jgrq}, #{jzwgd}, #{zzdmj}, #{zydmj}, #{ycjzmj}, #{scjzmj}, #{zcs},
  83. #{dscs}, #{dxcs}, #{dxsd}, #{ghyt}, #{ytmc}, #{pzyt}, #{sjyt}, #{fwjg}, #{zts}, #{dah}, #{bz},
  84. #{zt}, #{djzt}, #{ybdcdyh}, #{jsxmmc}, #{jsgcghxkzh}, #{jsgcghxkz}, #{xcjsghxkzh},
  85. #{xcjsghxkz}, #{ghhsjgwj}, #{qlrsjsyrlxm}, #{fwxz}, #{gyjzmj}, #{gyqk}, #{zyjzmj},
  86. #{ftjzmj}, #{fwcqly}, #{cqlyzmcl}, #{fwqsjxsyt}, #{fct}, #{fjsm}, #{dcyj}, #{dcy}, #{dcrq},
  87. #{shyj}, #{shy}, #{shrq}, #{fwdcb}, #{fcct}, #{bdcdyb}, #{dcdw}, #{geom}, #{validFlag}
  88. )
  89. </insert>
  90. <select id="get" resultMap="BaseResultMap">
  91. SELECT *, ST_AsEWKT(geom) as geom
  92. FROM vector.zrz
  93. WHERE bsm = #{bsm}
  94. </select>
  95. <select id="getListByDjzqdm" resultMap="BaseResultMap">
  96. SELECT bsm, ysdm, bdcdyh, zddm, xmbh, dclxtzm, glh, dzjgh, zrzh, lzdm,
  97. lzzl, xmmc, jzwmc, jgrq, jzwgd, zzdmj, zydmj, ycjzmj, scjzmj, zcs,
  98. dscs, dxcs, dxsd, ghyt, ytmc, pzyt, sjyt, fwjg, zts, dah, bz,
  99. zt, djzt, ybdcdyh, jsxmmc, jsgcghxkzh, jsgcghxkz, xcjsghxkzh,
  100. xcjsghxkz, ghhsjgwj, qlrsjsyrlxm, fwxz, gyjzmj, gyqk, zyjzmj,
  101. ftjzmj, fwcqly, cqlyzmcl, fwqsjxsyt, fct, fjsm, dcyj, dcy, dcrq,
  102. shyj, shy, shrq, fwdcb, fcct, bdcdyb, dcdw,ST_AsEWKT(geom) as geom
  103. FROM vector.zrz
  104. <where>
  105. <if test="djzqdm != null and djzqdm != ''">
  106. and LEFT(zddm, 12) = #{djzqdm}
  107. </if>
  108. </where>
  109. </select>
  110. <select id="getList" resultMap="BaseResultMap">
  111. SELECT *, ST_AsEWKT(geom) as geom
  112. FROM vector.zrz
  113. </select>
  114. <update id="update" parameterType="com.siwei.apply.domain.cadastre.Zrz">
  115. UPDATE vector.zrz
  116. <set>
  117. <if test="ysdm != null">ysdm = #{ysdm},</if>
  118. <if test="bdcdyh != null">bdcdyh = #{bdcdyh},</if>
  119. <if test="zddm != null">zddm = #{zddm},</if>
  120. <if test="xmbh != null">xmbh = #{xmbh},</if>
  121. <if test="dclxtzm != null">dclxtzm = #{dclxtzm},</if>
  122. <if test="glh != null">glh = #{glh},</if>
  123. <if test="dzjgh != null">dzjgh = #{dzjgh},</if>
  124. <if test="zrzh != null">zrzh = #{zrzh},</if>
  125. <if test="lzdm != null">lzdm = #{lzdm},</if>
  126. <if test="lzzl != null">lzzl = #{lzzl},</if>
  127. <if test="xmmc != null">xmmc = #{xmmc},</if>
  128. <if test="jzwmc != null">jzwmc = #{jzwmc},</if>
  129. <if test="jgrq != null">jgrq = #{jgrq},</if>
  130. <if test="jzwgd != null">jzwgd = #{jzwgd},</if>
  131. <if test="zzdmj != null">zzdmj = #{zzdmj},</if>
  132. <if test="zydmj != null">zydmj = #{zydmj},</if>
  133. <if test="ycjzmj != null">ycjzmj = #{ycjzmj},</if>
  134. <if test="scjzmj != null">scjzmj = #{scjzmj},</if>
  135. <if test="zcs != null">zcs = #{zcs},</if>
  136. <if test="dscs != null">dscs = #{dscs},</if>
  137. <if test="dxcs != null">dxcs = #{dxcs},</if>
  138. <if test="dxsd != null">dxsd = #{dxsd},</if>
  139. <if test="ghyt != null">ghyt = #{ghyt},</if>
  140. <if test="ytmc != null">ytmc = #{ytmc},</if>
  141. <if test="pzyt != null">pzyt = #{pzyt},</if>
  142. <if test="sjyt != null">sjyt = #{sjyt},</if>
  143. <if test="fwjg != null">fwjg = #{fwjg},</if>
  144. <if test="zts != null">zts = #{zts},</if>
  145. <if test="dah != null">dah = #{dah},</if>
  146. <if test="bz != null">bz = #{bz},</if>
  147. <if test="zt != null">zt = #{zt},</if>
  148. <if test="djzt != null">djzt = #{djzt},</if>
  149. <if test="ybdcdyh != null">ybdcdyh = #{ybdcdyh},</if>
  150. <if test="jsxmmc != null">jsxmmc = #{jsxmmc},</if>
  151. <if test="jsgcghxkzh != null">jsgcghxkzh = #{jsgcghxkzh},</if>
  152. <if test="jsgcghxkz != null">jsgcghxkz = #{jsgcghxkz},</if>
  153. <if test="xcjsghxkzh != null">xcjsghxkzh = #{xcjsghxkzh},</if>
  154. <if test="xcjsghxkz != null">xcjsghxkz = #{xcjsghxkz},</if>
  155. <if test="ghhsjgwj != null">ghhsjgwj = #{ghhsjgwj},</if>
  156. <if test="qlrsjsyrlxm != null">qlrsjsyrlxm = #{qlrsjsyrlxm},</if>
  157. <if test="fwxz != null">fwxz = #{fwxz},</if>
  158. <if test="gyjzmj != null">gyjzmj = #{gyjzmj},</if>
  159. <if test="gyqk != null">gyqk = #{gyqk},</if>
  160. <if test="zyjzmj != null">zyjzmj = #{zyjzmj},</if>
  161. <if test="ftjzmj != null">ftjzmj = #{ftjzmj},</if>
  162. <if test="fwcqly != null">fwcqly = #{fwcqly},</if>
  163. <if test="cqlyzmcl != null">cqlyzmcl = #{cqlyzmcl},</if>
  164. <if test="fwqsjxsyt != null">fwqsjxsyt = #{fwqsjxsyt},</if>
  165. <if test="fct != null">fct = #{fct},</if>
  166. <if test="fjsm != null">fjsm = #{fjsm},</if>
  167. <if test="dcyj != null">dcyj = #{dcyj},</if>
  168. <if test="dcy != null">dcy = #{dcy},</if>
  169. <if test="dcrq != null">dcrq = #{dcrq},</if>
  170. <if test="shyj != null">shyj = #{shyj},</if>
  171. <if test="shy != null">shy = #{shy},</if>
  172. <if test="shrq != null">shrq = #{shrq},</if>
  173. <if test="fwdcb != null">fwdcb = #{fwdcb},</if>
  174. <if test="fcct != null">fcct = #{fcct},</if>
  175. <if test="bdcdyb != null">bdcdyb = #{bdcdyb},</if>
  176. <if test="dcdw != null">dcdw = #{dcdw},</if>
  177. <if test="geom != null">geom = #{geom},</if>
  178. <if test="validFlag != null">valid_flag = #{validFlag},</if>
  179. </set>
  180. WHERE bsm = #{bsm}
  181. </update>
  182. <select id="getStatisticsByGhyt" resultType="java.util.Map">
  183. SELECT
  184. ghyt,
  185. ytmc,
  186. djzt,
  187. COUNT(*) as count,
  188. SUM(scjzmj) as total_scjzmj
  189. FROM vector.zrz
  190. GROUP BY ghyt, ytmc, djzt
  191. </select>
  192. <select id="getZrzqlReportData" resultType="java.util.Map">
  193. SELECT
  194. LEFT(zddm, 12) as djzqdm,
  195. ghyt,
  196. ytmc,
  197. djzt,
  198. SUM(scjzmj) as total_area
  199. FROM vector.zrz
  200. <where>
  201. <if test="ghytCodes != null and ghytCodes.size() > 0">
  202. AND ghyt IN
  203. <foreach item="code" collection="ghytCodes" open="(" separator="," close=")">
  204. #{code}
  205. </foreach>
  206. </if>
  207. </where>
  208. GROUP BY LEFT(zddm, 12), ghyt, ytmc, djzt
  209. </select>
  210. <select id="getDictByType" resultType="java.util.Map">
  211. SELECT * FROM "vector"."public_dict"
  212. <where>
  213. <if test="type != null and type != ''">
  214. AND type = #{type}
  215. </if>
  216. <if test="name != null and name != ''">
  217. AND name LIKE CONCAT('%', #{name}, '%')
  218. </if>
  219. </where>
  220. </select>
  221. </mapper>