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.type as "type",
  24. t.pbsm as "pbsm",
  25. t.icon as "icon",
  26. --case when t.sde is null then t.url else to_char(dblayer.address) end as "url",
  27. t.url as "url",
  28. t.lev as "lev",
  29. t.sort as "sort",
  30. t.state as "state",
  31. t.parent as "parent",
  32. --case when t.sde is null then t.server_type else 'Arcgis' end as "server_type",
  33. t.server_type as "server_type",
  34. t.sflssj as "sflssj",
  35. t.sfdbfx as "sfdbfx",
  36. t.sfjl as "sfjl",
  37. t.sfcx as "sfcx",
  38. t.sftj as "sftj",
  39. t.epsg as "epsg",
  40. t.year as "year",
  41. t.sjlx as "sjlx",
  42. t.sde as "sde",
  43. t.gltj as "gltj",
  44. t.sjly as "sjly",
  45. t.legend as "legend",
  46. t.ywlx as "ywlx",
  47. (select distinct(uhbm) from t_yzt_zyml_my my where my.zy_bsm = t.bsm and my.uhbm = #{username}) as "my",
  48. (select fzbsm from T_YZT_ZYML_LSSJ ls where ls.zybsm = t.bsm) as "fzbsm",
  49. to_char(res.datetime ,'yyyy-MM-dd hh24:mi:ss') as "datetime",
  50. (select usertable.nick_name from sys_user usertable where usertable.user_name = res.createperson) as
  51. "createperson"
  52. from t_yzt_zyml t left join t_yzt_db_layer dblayer on dblayer.id = t.sde
  53. left join tb_resourcehooktb res on res.name = replace(dblayer.source, 'SDE.','')
  54. where 1 = 1
  55. <if test="param != null and param != ''">
  56. and t.bsm in (select bsm
  57. from t_yzt_zyml ml
  58. start with ml.bsm = #{param}
  59. connect by prior ml.bsm = ml.pbsm)
  60. </if>
  61. <if test="resources != null and resources != ''">
  62. and (t.parent = 1 or t.bsm in (
  63. with temp as
  64. (select #{resources} value from dual t)
  65. select regexp_substr(replace(value, ' ,', ','), '[^,]+', 1, level)
  66. from temp
  67. connect by regexp_count(value, ',') + 1 >= level
  68. ) )
  69. </if>
  70. order by t.lev,t.pbsm , t.sort
  71. </select>
  72. <select id="GetList4XZQH" parameterType="java.lang.String" resultType="com.onemap.apply.domain.yzt.ZymlDTO">
  73. select
  74. (select count(1) from ( select * from t_yzt_zyml ml left join t_yzt_db_layer dblayer2 on dblayer2.id = ml.sde
  75. where dblayer2.source
  76. like '%'||#{xzqh}||'%' or ml.sjly = #{xzqh} or ml.parent = 1)cou where cou.parent = 0
  77. start with cou.bsm = t.bsm
  78. connect by prior cou.bsm = cou.pbsm ) as "count",
  79. t.bsm as "bsm",
  80. t.name as "name",
  81. case when t.sde is null then t.type else to_char(dblayer.servicetype) end as "type",
  82. t.pbsm as "pbsm",
  83. t.icon as "icon",
  84. case when t.sde is null then t.url else to_char(dblayer.address) end as "url",
  85. t.lev as "lev",
  86. t.sort as "sort",
  87. t.state as "state",
  88. t.parent as "parent",
  89. case when t.sde is null then t.server_type else 'Arcgis' end as "server_type",
  90. t.sflssj as "sflssj",
  91. t.sfdbfx as "sfdbfx",
  92. t.sfjl as "sfjl",
  93. t.sfcx as "sfcx",
  94. t.sftj as "sftj",
  95. t.epsg as "epsg",
  96. t.year as "year",
  97. t.sjlx as "sjlx",
  98. t.sde as "sde",
  99. t.gltj as "gltj",
  100. t.sjly as "sjly",
  101. t.legend as "legend",
  102. t.ywlx as "ywlx",
  103. (select distinct(uhbm) from t_yzt_zyml_my my where my.zy_bsm = t.bsm and my.uhbm = #{username}) as "my",
  104. (select fzbsm from T_YZT_ZYML_LSSJ ls where ls.zybsm = t.bsm) as "fzbsm",
  105. to_char(res.datetime ,'yyyy-MM-dd hh24:mi:ss') as "datetime",
  106. (select usertable.nick_name from sys_user usertable where usertable.user_name = res.createperson) as
  107. "createperson"
  108. from t_yzt_zyml t left join t_yzt_db_layer dblayer on dblayer.id = t.sde
  109. left join tb_resourcehooktb res on res.name = replace(dblayer.source, 'SDE.','')
  110. where 1 = 1
  111. <if test="param != null and param != ''">
  112. and t.bsm in (select bsm
  113. from t_yzt_zyml ml
  114. start with ml.bsm = #{param}
  115. connect by prior ml.bsm = ml.pbsm)
  116. </if>
  117. and (dblayer.id in ( select id from T_YZT_DB_LAYER where source
  118. like '%'||#{xzqh}||'%' ) or PARENT = 1 or t.sjly = #{xzqh})
  119. order by t.lev, t.sort
  120. </select>
  121. <select id="GetTree" parameterType="java.lang.String" resultType="com.onemap.apply.domain.yzt.ZymlTreeDTO">
  122. select
  123. t.bsm as "id",
  124. t.name as "name",
  125. t.pbsm as "pid",
  126. null as "url",
  127. t.state as "state",
  128. case when t.parent = 0 then 1 else 0 end as "type"
  129. 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
  130. </select>
  131. <select id="GetMyCollect" parameterType="java.lang.String" resultType="com.onemap.apply.domain.yzt.ZymlDTO">
  132. select
  133. 0 as "count",
  134. t.bsm as "bsm",
  135. t.name as "name",
  136. case when t.sde is null then t.type else to_char(dblayer.servicetype) end as "type",
  137. t.pbsm as "pbsm",
  138. t.icon as "icon",
  139. case when t.sde is null then t.url else to_char(dblayer.address) end as "url",
  140. t.lev as "lev",
  141. t.sort as "sort",
  142. t.state as "state",
  143. t.parent as "parent",
  144. t.server_type as "server_type",
  145. t.sflssj as "sflssj",
  146. t.sfdbfx as "sfdbfx",
  147. t.sfjl as "sfjl",
  148. t.sfcx as "sfcx",
  149. t.sftj as "sftj",
  150. t.epsg as "epsg",
  151. t.year as "year",
  152. t.sjlx as "sjlx",
  153. t.sde as "sde",
  154. t.gltj as "gltj",
  155. t.sjly as "sjly",
  156. t.legend as "legend",
  157. t.ywlx as "ywlx",
  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>