HgxfxMapper.xml 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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.onemap.apply.mapper.fzss.HgxfxMapper">
  6. <select id="GetPage" parameterType="java.lang.String" resultType="com.onemap.apply.domain.config.fzss.HgxfxDTO">
  7. select t.bsm as "bsm",
  8. t.fxmj as "fxmj",
  9. t.xmmc as "xmmc",
  10. t.xmlx as "xmlx",
  11. t.jsdw as "jsdw",
  12. t.ydxz_bsm as "ydxz_bsm",
  13. t.fxbg as "fxbg",
  14. t.rwzt as "rwzt",
  15. t.cjsj as "cjsj",
  16. public.st_asewkt(t1.geom) AS geom
  17. from t_fzss_hgxfx t
  18. left join t_fzss_zhxz_file t1 on t1.id = t.xzfw
  19. where t.scsj is null
  20. <if test="kssj != null and kssj != ''">
  21. and t.cjsj &gt;= to_date(#{kssj}, 'yyyy-MM-dd hh24:mi:ss')
  22. </if>
  23. <if test="jssj != null and jssj != ''">
  24. and t.cjsj &lt;= to_date(#{jssj}, 'yyyy-MM-dd hh24:mi:ss')
  25. </if>
  26. <if test="xmmc != null and xmmc != ''">
  27. and t.xmmc like '%'||#{xmmc}||'%'
  28. </if>
  29. <if test="username != null and username != ''">
  30. and t.cjyh = #{username}
  31. </if>
  32. order by t.cjsj is null,t.cjsj desc
  33. </select>
  34. <insert id="insertXzfw">
  35. insert into t_fzss_zhxz_file (id, geom, from_type, create_time,area)
  36. values (#{id}, public.st_geomfromewkt(#{geom}), #{from_type}, now(),public.st_area(public.st_geomfromewkt(#{geom})::public.geography))
  37. </insert>
  38. <select id="getXzfw" parameterType="java.lang.String" resultType="map">
  39. SELECT id,
  40. public.st_asewkt(geom) AS geom,
  41. area,
  42. create_time
  43. FROM t_fzss_zhxz_file
  44. WHERE id = #{id}
  45. </select>
  46. <select id="getJcxs" parameterType="java.lang.String" resultType="com.onemap.apply.domain.config.fzss.HgxfxJcxsDTO">
  47. select t.bsm as "bsm",
  48. t.rwbsm as "rwbsm",
  49. t.scxbsm as "scxbsm",
  50. t.zdmj as "zdmj",
  51. t.jcjg as "jcjg",
  52. scx.kzxjb as "kzxjb",
  53. case when scx.kzxjb = 1 then '一级控制线'
  54. when scx.kzxjb = 2 then '二级控制线'
  55. else scx.tjzd end as "classify",
  56. scx.ysmc as "ysmc" from t_fzss_hgxfx_hgscx t
  57. left join t_fzss_hgxfx_scx scx on scx.bsm = t.scxbsm
  58. where t.rwbsm = #{bsm} and scx.kzxjb > 0
  59. order by scx.kzxjb
  60. </select>
  61. <select id="getFxtb" parameterType="java.lang.String" resultType="com.onemap.apply.domain.config.fzss.HgxfxFxtbDTO">
  62. select xz.ydyhfldm as "dldm2",
  63. xz.ydyhflmc as "dlmc2",
  64. (select d.dldm from t_dict_dldm d where d.fzbs = 'GH' and d.dldm = substr(xz.ydyhfldm,0,2)) as "dldm1",
  65. (select d.dlmc from t_dict_dldm d where d.fzbs = 'GH' and d.dldm = substr(xz.ydyhfldm,0,2)) as "dlmc1",
  66. sum(t.yzmj) as "yzmj",
  67. sum(xz.mj) as "mj"
  68. from (select * from t_fzss_hgxfx_jg_gis t where t.scxbsm = (select hgscx.bsm from t_fzss_hgxfx_hgscx hgscx left join t_fzss_hgxfx_scx scx on scx.bsm = hgscx.scxbsm where scx.kzxjb = 0
  69. and hgscx.rwbsm = #{bsm})) t
  70. inner join (select * from sde.xzydyh x where x.objectid in (select objid from t_fzss_hgxfx_jg_gis gis where gis.scxbsm = (select hgscx.bsm from t_fzss_hgxfx_hgscx hgscx left join t_fzss_hgxfx_scx scx on scx.bsm = hgscx.scxbsm where scx.kzxjb = 0
  71. and hgscx.rwbsm = #{bsm}))
  72. ) xz on xz.objectid = t.objid
  73. group by xz.ydyhfldm,xz.ydyhflmc
  74. order by xz.ydyhfldm
  75. </select>
  76. <select id="getScrwCount" resultType="java.lang.Integer">
  77. select count(1) count from t_fzss_hgxfx t where 1 >= t.rwzt
  78. </select>
  79. <delete id="deleteResourceScx">
  80. delete from t_fzss_hgxfx_scx where kzxjb > 2
  81. </delete>
  82. <insert id="unionResourceScx">
  83. insert into t_fzss_hgxfx_scx (bsm,ysdm,ysmc,sjy,kzxjb,xssx,tjzd, status )
  84. -- select to_char(t.layername) bsm,
  85. -- '202400000000' ysdm,
  86. -- to_char(t.layeralias) ysmc,
  87. -- to_char(t.source) sjy,
  88. -- ( select (select * from (select to_number(bsm) from t_yzt_zyml
  89. -- start with bsm = o.bsm
  90. -- connect by prior pbsm = bsm order by pbsm desc) where 1 >= rownum)
  91. -- from t_yzt_zyml o where o.bsm = m.bsm) kzxjb,
  92. -- rownum xssx,
  93. -- ( select (select * from (select name from t_yzt_zyml
  94. -- start with bsm = o.bsm
  95. -- connect by prior pbsm = bsm order by pbsm desc) where 1 >= rownum)
  96. -- from t_yzt_zyml o where o.bsm = m.bsm) tjzd,
  97. -- '1' status
  98. -- from t_yzt_db_layer t
  99. -- left join t_yzt_zyml m
  100. -- on m.sde = t.id
  101. -- where t.id in (select distinct(sde) from t_yzt_zyml)
  102. -- union all
  103. select to_char(substr(t.sde,INSTR(t.sde,'.') + 1)) bsm,
  104. '202400000000' ysdm,
  105. to_char(t.name) ysmc,
  106. to_char(t.sde) sjy,
  107. ( select (select * from (select to_number(bsm) from t_yzt_zyml
  108. start with bsm = o.bsm
  109. connect by prior pbsm = bsm order by pbsm desc) where 1 >= rownum)
  110. from t_yzt_zyml o where o.bsm = t.bsm) kzxjb,
  111. rownum xssx,
  112. ( select (select * from (select name from t_yzt_zyml
  113. start with bsm = o.bsm
  114. connect by prior pbsm = bsm order by pbsm desc) where 1 >= rownum)
  115. from t_yzt_zyml o where o.bsm = t.bsm) tjzd,
  116. '1' status from t_yzt_zyml t where t.sde like '%.%' and t.parent = '0'
  117. </insert>
  118. </mapper>