ZymlMapper.xml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351
  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.yzt.ZymlMapper">
  6. <select id="GetList" parameterType="java.lang.String" resultType="com.onemap.apply.domain.yzt.ZymlDTO">
  7. select
  8. (select count(1) from t_yzt_zyml cou where cou.parent = 0
  9. <if test="resources != null and resources != ''">
  10. and cou.bsm in (
  11. with temp as
  12. (select #{resources} value from dual t)
  13. select regexp_substr(replace(value, ' ,', ','), '[^,]+', 1, level)
  14. from temp
  15. connect by regexp_count(value, ',') + 1 >= level
  16. )
  17. </if>
  18. start with cou.bsm = t.bsm
  19. connect by prior cou.bsm = cou.pbsm ) as "count",
  20. t.bsm as "bsm",
  21. t.name as "name",
  22. case when t.sde is null then t.type else to_char(dblayer.servicetype) end as "type",
  23. t.pbsm as "pbsm",
  24. t.icon as "icon",
  25. case when t.sde is null then t.url else to_char(dblayer.address) end as "url",
  26. t.lev as "lev",
  27. t.sort as "sort",
  28. t.state as "state",
  29. t.parent as "parent",
  30. case when t.sde is null then t.server_type else 'Arcgis' end as "server_type",
  31. t.sflssj as "sflssj",
  32. t.sfdbfx as "sfdbfx",
  33. t.sfjl as "sfjl",
  34. t.sfcx as "sfcx",
  35. t.sftj as "sftj",
  36. t.epsg as "epsg",
  37. t.year as "year",
  38. t.sjlx as "sjlx",
  39. t.sde as "sde",
  40. t.gltj as "gltj",
  41. t.sjly as "sjly",
  42. t.legend as "legend",
  43. t.ywlx as "ywlx",
  44. t.dataexplain as "dataexplain",
  45. (select distinct(uhbm) from t_yzt_zyml_my my where my.zy_bsm = t.bsm and my.uhbm = #{username}) as "my",
  46. (select fzbsm from T_YZT_ZYML_LSSJ ls where ls.zybsm = t.bsm) as "fzbsm",
  47. to_char(res.datetime ,'yyyy-MM-dd hh24:mi:ss') as "datetime",
  48. (select usertable.nick_name from sys_user usertable where usertable.user_name = res.createperson) as
  49. "createperson"
  50. from t_yzt_zyml t left join t_yzt_db_layer dblayer on dblayer.id = t.sde
  51. left join tb_resourcehooktb res on res.name = replace(dblayer.source, 'SDE.','')
  52. where 1 = 1
  53. <if test="param != null and param != ''">
  54. and t.bsm in (select bsm
  55. from t_yzt_zyml ml
  56. start with ml.bsm = #{param}
  57. connect by prior ml.bsm = ml.pbsm)
  58. </if>
  59. <if test="resources != null and resources != ''">
  60. and (t.parent = 1 or t.bsm in (
  61. with temp as
  62. (select #{resources} value from dual t)
  63. select regexp_substr(replace(value, ' ,', ','), '[^,]+', 1, level)
  64. from temp
  65. connect by regexp_count(value, ',') + 1 >= level
  66. ) )
  67. </if>
  68. order by t.lev,t.pbsm , t.sort
  69. </select>
  70. <select id="GetList4XZQH" parameterType="java.lang.String" resultType="com.onemap.apply.domain.yzt.ZymlDTO">
  71. select
  72. (select count(1) from ( select * from t_yzt_zyml ml left join t_yzt_db_layer dblayer2 on dblayer2.id = ml.sde
  73. where dblayer2.source
  74. like '%'||#{xzqh}||'%' or ml.sjly = #{xzqh} or ml.parent = 1)cou where cou.parent = 0
  75. start with cou.bsm = t.bsm
  76. connect by prior cou.bsm = cou.pbsm ) as "count",
  77. t.bsm as "bsm",
  78. t.name as "name",
  79. case when t.sde is null then t.type else to_char(dblayer.servicetype) end as "type",
  80. t.pbsm as "pbsm",
  81. t.icon as "icon",
  82. case when t.sde is null then t.url else to_char(dblayer.address) end as "url",
  83. t.lev as "lev",
  84. t.sort as "sort",
  85. t.state as "state",
  86. t.parent as "parent",
  87. case when t.sde is null then t.server_type else 'Arcgis' end as "server_type",
  88. t.sflssj as "sflssj",
  89. t.sfdbfx as "sfdbfx",
  90. t.sfjl as "sfjl",
  91. t.sfcx as "sfcx",
  92. t.sftj as "sftj",
  93. t.epsg as "epsg",
  94. t.year as "year",
  95. t.sjlx as "sjlx",
  96. t.sde as "sde",
  97. t.gltj as "gltj",
  98. t.sjly as "sjly",
  99. t.legend as "legend",
  100. t.ywlx as "ywlx",
  101. (select distinct(uhbm) from t_yzt_zyml_my my where my.zy_bsm = t.bsm and my.uhbm = #{username}) as "my",
  102. (select fzbsm from T_YZT_ZYML_LSSJ ls where ls.zybsm = t.bsm) as "fzbsm",
  103. to_char(res.datetime ,'yyyy-MM-dd hh24:mi:ss') as "datetime",
  104. (select usertable.nick_name from sys_user usertable where usertable.user_name = res.createperson) as
  105. "createperson"
  106. from t_yzt_zyml t left join t_yzt_db_layer dblayer on dblayer.id = t.sde
  107. left join tb_resourcehooktb res on res.name = replace(dblayer.source, 'SDE.','')
  108. where 1 = 1
  109. <if test="param != null and param != ''">
  110. and t.bsm in (select bsm
  111. from t_yzt_zyml ml
  112. start with ml.bsm = #{param}
  113. connect by prior ml.bsm = ml.pbsm)
  114. </if>
  115. and (dblayer.id in ( select id from T_YZT_DB_LAYER where source
  116. like '%'||#{xzqh}||'%' ) or PARENT = 1 or t.sjly = #{xzqh})
  117. order by t.lev, t.sort
  118. </select>
  119. <select id="GetTree" parameterType="java.lang.String" resultType="com.onemap.apply.domain.yzt.ZymlTreeDTO">
  120. select
  121. t.bsm as "id",
  122. t.name as "name",
  123. t.pbsm as "pid",
  124. null as "url",
  125. t.state as "state",
  126. case when t.parent = 0 then 1 else 0 end as "type"
  127. from t_yzt_zyml t left join t_yzt_db_layer dblayer on dblayer.id = t.sde order by t.lev,t.pbsm , t.sort
  128. </select>
  129. <select id="GetMyCollect" parameterType="java.lang.String" resultType="com.onemap.apply.domain.yzt.ZymlDTO">
  130. select
  131. 0 as "count",
  132. t.bsm as "bsm",
  133. t.name as "name",
  134. case when t.sde is null then t.type else to_char(dblayer.servicetype) end as "type",
  135. t.pbsm as "pbsm",
  136. t.icon as "icon",
  137. case when t.sde is null then t.url else to_char(dblayer.address) end as "url",
  138. t.lev as "lev",
  139. t.sort as "sort",
  140. t.state as "state",
  141. t.parent as "parent",
  142. t.server_type as "server_type",
  143. t.sflssj as "sflssj",
  144. t.sfdbfx as "sfdbfx",
  145. t.sfjl as "sfjl",
  146. t.sfcx as "sfcx",
  147. t.sftj as "sftj",
  148. t.epsg as "epsg",
  149. t.year as "year",
  150. t.sjlx as "sjlx",
  151. t.sde as "sde",
  152. t.gltj as "gltj",
  153. t.sjly as "sjly",
  154. t.legend as "legend",
  155. t.ywlx as "ywlx",
  156. t.fwmc AS "fwmc",
  157. t.fwys AS "fwys",
  158. #{username} as "my",
  159. null as "fzbsm",
  160. to_char(res.datetime ,'yyyy-MM-dd hh24:mi:ss') as "datetime",
  161. (select usertable.nick_name from sys_user usertable where usertable.user_name = res.createperson) as "createperson"
  162. from T_YZT_ZYML t left join t_yzt_db_layer dblayer on dblayer.id = t.sde
  163. left join tb_resourcehooktb res on res.name = replace(dblayer.source, 'SDE.','')
  164. where t.bsm in ((select distinct(my.zy_bsm) from T_YZT_ZYML_MY my where my.uhbm = #{username})) order by t.bsm
  165. </select>
  166. <select id="GetMyCollect4XZQH" parameterType="java.lang.String" resultType="com.onemap.apply.domain.yzt.ZymlDTO">
  167. select
  168. 0 as "count",
  169. t.bsm as "bsm",
  170. t.name as "name",
  171. case when t.sde is null then t.type else to_char(dblayer.servicetype) end as "type",
  172. t.pbsm as "pbsm",
  173. t.icon as "icon",
  174. case when t.sde is null then t.url else to_char(dblayer.address) end as "url",
  175. t.lev as "lev",
  176. t.sort as "sort",
  177. t.state as "state",
  178. t.parent as "parent",
  179. t.server_type as "server_type",
  180. t.sflssj as "sflssj",
  181. t.sfdbfx as "sfdbfx",
  182. t.sfjl as "sfjl",
  183. t.sfcx as "sfcx",
  184. t.sftj as "sftj",
  185. t.epsg as "epsg",
  186. t.year as "year",
  187. t.sjlx as "sjlx",
  188. t.sde as "sde",
  189. t.gltj as "gltj",
  190. t.sjly as "sjly",
  191. t.legend as "legend",
  192. t.ywlx as "ywlx",
  193. #{username} as "my",
  194. null as "fzbsm",
  195. to_char(res.datetime ,'yyyy-MM-dd hh24:mi:ss') as "datetime",
  196. (select usertable.nick_name from sys_user usertable where usertable.user_name = res.createperson) as "createperson"
  197. from T_YZT_ZYML t left join t_yzt_db_layer dblayer on dblayer.id = t.sde
  198. left join tb_resourcehooktb res on res.name = replace(dblayer.source, 'SDE.','')
  199. where t.bsm in ((select distinct(my.zy_bsm) from T_YZT_ZYML_MY my where my.uhbm = #{username}))
  200. order by t.bsm
  201. </select>
  202. <select id="GetByBsms" parameterType="java.lang.String" resultType="com.onemap.apply.domain.yzt.ZymlDTO">
  203. select
  204. 0 as "count",
  205. t.bsm as "bsm",
  206. t.name as "name",
  207. case when t.sde is null then t.type else to_char(dblayer.servicetype) end as "type",
  208. t.pbsm as "pbsm",
  209. t.icon as "icon",
  210. case when t.sde is null then t.url else to_char(dblayer.address) end as "url",
  211. t.lev as "lev",
  212. t.sort as "sort",
  213. t.state as "state",
  214. t.parent as "parent",
  215. t.server_type as "server_type",
  216. t.sflssj as "sflssj",
  217. t.sfdbfx as "sfdbfx",
  218. t.sfjl as "sfjl",
  219. t.sfcx as "sfcx",
  220. t.sftj as "sftj",
  221. t.epsg as "epsg",
  222. t.year as "year",
  223. t.sjlx as "sjlx",
  224. t.sde as "sde",
  225. t.gltj as "gltj",
  226. t.sjly as "sjly",
  227. t.legend as "legend",
  228. t.ywlx as "ywlx",
  229. null as "my",
  230. null as "fzbsm"
  231. from T_YZT_ZYML t left join t_yzt_db_layer dblayer on dblayer.id = t.sde where t.bsm in
  232. <foreach collection="array" item="bsm" open="(" separator="," close=")">
  233. #{bsm}
  234. </foreach>
  235. order by t.bsm
  236. </select>
  237. <select id="GetByBsm" parameterType="java.lang.String" resultType="com.onemap.apply.domain.yzt.ZymlDTO">
  238. select
  239. 0 as "count",
  240. t.bsm as "bsm",
  241. t.name as "name",
  242. case when t.sde is null then t.type else to_char(dblayer.servicetype) end as "type",
  243. t.pbsm as "pbsm",
  244. t.icon as "icon",
  245. case when t.sde is null then t.url else to_char(dblayer.address) end as "url",
  246. t.lev as "lev",
  247. t.sort as "sort",
  248. t.state as "state",
  249. t.parent as "parent",
  250. t.server_type as "server_type",
  251. t.sflssj as "sflssj",
  252. t.sfdbfx as "sfdbfx",
  253. t.sfjl as "sfjl",
  254. t.sfcx as "sfcx",
  255. t.sftj as "sftj",
  256. t.epsg as "epsg",
  257. t.year as "year",
  258. t.sjlx as "sjlx",
  259. t.sde as "sde",
  260. t.gltj as "gltj",
  261. t.sjly as "sjly",
  262. t.legend as "legend",
  263. t.ywlx as "ywlx",
  264. null as "my",
  265. null as "fzbsm"
  266. from T_YZT_ZYML t
  267. left join t_yzt_db_layer dblayer on dblayer.id = t.sde
  268. where t.bsm = #{bsm}
  269. </select>
  270. <select id="GetAttrs" parameterType="java.lang.String" resultType="com.onemap.apply.domain.yzt.ResourceAttrsDTO">
  271. select t.sxmc as "sxmc",
  272. t.sxbm as "sxbm",
  273. t.sxlx as "sxlx",
  274. t.xssx as "xssx",
  275. t.sfcx as "sfcx",
  276. t.sftj as "sftj",
  277. t.dw as "dw",
  278. t.zdcx as "zdcx" from T_YZT_ZYSX t where t.zy_bsm = #{bsm}
  279. </select>
  280. <select id="GetCollectCount" parameterType="com.onemap.apply.domain.yzt.ZymlBsmDTO" resultType="java.lang.Integer">
  281. select count(1) from T_YZT_ZYML_MY t where t.uhbm = #{username} and t.zy_bsm = #{bsm}
  282. </select>
  283. <delete id="DeleteCollect" parameterType="com.onemap.apply.domain.yzt.ZymlBsmDTO">
  284. delete from T_YZT_ZYML_MY t where t.uhbm = #{username} and t.zy_bsm = #{bsm}
  285. </delete>
  286. <insert id="AddCollect" parameterType="com.onemap.apply.domain.yzt.ZymlBsmDTO">
  287. insert into T_YZT_ZYML_MY (uhbm,zy_bsm) values(#{username},#{bsm})
  288. </insert>
  289. <select id="GetDbfxList" parameterType="java.lang.String" resultType="com.onemap.apply.domain.yzt.DbfxResourceDTO">
  290. select t.bsm as "bsm",
  291. case when zy.sde is null then zy.type else to_char(dblayer.servicetype) end as "type",
  292. case when zy.sde is null then zy.url else to_char(dblayer.address) end as "url",
  293. t.name as "name",
  294. t.zybsm "zybsm",
  295. t.lxfz as "lxfz",
  296. t.sort as "sort",
  297. t.tjname as "tjname",
  298. t.xzq as "xzq" ,
  299. zy.server_type as "server_type",
  300. zy.epsg as "epsg",
  301. zy.year as "year",
  302. zy.legend as "legend",
  303. zy.ywlx as "ywlx",
  304. ls.fzbsm as "fzbsm"
  305. from T_YZT_DBFX t
  306. left join t_yzt_zyml zy on zy.bsm = t.zybsm
  307. left join t_yzt_db_layer dblayer on dblayer.id = zy.sde
  308. left join T_YZT_ZYML_LSSJ ls on ls.zybsm = t.zybsm
  309. </select>
  310. <select id="GetLssjList" parameterType="java.lang.String" resultType="com.onemap.apply.domain.yzt.DbfxLssjDTO">
  311. select
  312. t.fzbsm as "fzbsm",
  313. t.zybsm as "zybsm",
  314. zy.epsg as "epsg",
  315. zy.type as "type",
  316. zy.server_type as "server_type",
  317. zy.year as "year",
  318. zy.url as "url"
  319. from T_YZT_ZYML_LSSJ t
  320. left join t_yzt_zyml zy on zy.bsm = t.zybsm
  321. where t.fzbsm = #{param} order by zy.year desc
  322. </select>
  323. <select id="GetLegend" parameterType="java.lang.String" resultType="com.onemap.apply.domain.yzt.ZymlLegendDTO">
  324. select t.bsm as "bsm",
  325. t.zybsm as "zybsm",
  326. t.zymc as "zymc",
  327. t.tldm as "tldm",
  328. t.tlmc as "tlmc",
  329. t.tllx as "tllx",
  330. t.tlys as "tlys" from t_yzt_zyml_tl t where t.zybsm = #{zybsm} order by t.tldm
  331. </select>
  332. <select id="getXzqCode" parameterType="java.lang.String" resultType="java.lang.String">
  333. SELECT FD_CODE FROM "TB_DICT_XZQHDM" WHERE FD_NAME = #{deptName}
  334. </select>
  335. <select id="GetLegendAttr" parameterType="java.lang.String" resultType="java.util.Map">
  336. select t.name "name",t.value "value" from bs_dic t where t.type = #{ywlx}
  337. </select>
  338. </mapper>