dfbf7f73bc1bae207c39d6e0d4e107da6a5364dc.svn-base 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="cn.com.goldenwater.dcproj.dao.AttAdBaseDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.AttAdBase" id="attAdBaseResultMap">
  5. <result property="guid" column="GUID"/>
  6. <result property="adCode" column="AD_CODE"/>
  7. <result property="adName" column="AD_NAME"/>
  8. <result property="adType" column="AD_TYPE"/>
  9. <result property="lowLeftLong" column="LOW_LEFT_LONG"/>
  10. <result property="lowLeftLat" column="LOW_LEFT_LAT"/>
  11. <result property="upRightLong" column="UP_RIGHT_LONG"/>
  12. <result property="upRightLat" column="UP_RIGHT_LAT"/>
  13. <result property="adGrad" column="AD_GRAD"/>
  14. <result property="adFullName" column="AD_FULL_NAME"/>
  15. <result property="upAdGuid" column="UP_AD_GUID"/>
  16. <result property="note" column="NOTE"/>
  17. <result property="collTime" column="COLL_TIME"/>
  18. <result property="updTime" column="UPD_TIME"/>
  19. <result property="recPers" column="REC_PERS"/>
  20. <result property="stat" column="STAT"/>
  21. </resultMap>
  22. <sql id="table_columns">
  23. GUID,
  24. AD_CODE,
  25. AD_NAME,
  26. <!--AD_TYPE,-->
  27. LOW_LEFT_LONG,
  28. LOW_LEFT_LAT,
  29. UP_RIGHT_LONG,
  30. UP_RIGHT_LAT,
  31. AD_GRAD,
  32. <!--UP_AD_GUID,-->
  33. NOTE,
  34. <!--COLL_TIME,
  35. UPD_TIME,
  36. REC_PERS,-->
  37. STAT
  38. </sql>
  39. <sql id="entity_properties">
  40. #{guid},
  41. #{adCode},
  42. #{adName},
  43. <!--#{adType},-->
  44. #{lowLeftLong},
  45. #{lowLeftLat},
  46. #{upRightLong},
  47. #{upRightLat},
  48. #{adGrad},
  49. <!--#{upAdGuid},-->
  50. #{note},
  51. <!--#{collTime},
  52. #{updTime},
  53. #{recPers},-->
  54. #{stat}
  55. </sql>
  56. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  57. <sql id="page_where">
  58. <trim prefix="where" prefixOverrides="and | or ">
  59. <if test="adCode != null and adCode != ''">and AD_CODE LIKE '${adCode}%'</if>
  60. <if test="adName != null and adName != ''">and AD_NAME = #{adName}</if>
  61. <if test="adType != null and adType != ''">and AD_TYPE = #{adType}</if>
  62. <if test="lowLeftLong != null and lowLeftLong != ''">and LOW_LEFT_LONG = #{lowLeftLong}</if>
  63. <if test="lowLeftLat != null and lowLeftLat != ''">and LOW_LEFT_LAT = #{lowLeftLat}</if>
  64. <if test="upRightLong != null and upRightLong != ''">and UP_RIGHT_LONG = #{upRightLong}</if>
  65. <if test="upRightLat != null and upRightLat != ''">and UP_RIGHT_LAT = #{upRightLat}</if>
  66. <if test="adGrad != null and adGrad != ''">and AD_GRAD = #{adGrad}</if>
  67. <if test="upAdGuid != null and upAdGuid != ''">and UP_AD_GUID = #{upAdGuid}</if>
  68. <if test="note != null and note != ''">and NOTE = #{note}</if>
  69. <if test="collTime != null">and COLL_TIME = #{collTime}</if>
  70. <if test="updTime != null">and UPD_TIME = #{updTime}</if>
  71. <if test="stat != null and stat != ''">and STAT = #{stat}</if>
  72. </trim>
  73. </sql>
  74. <select id="get" resultMap="attAdBaseResultMap" parameterType="String">
  75. select * from att_ad_base where ad_code = #{id}
  76. </select>
  77. <select id="getBy" resultMap="attAdBaseResultMap">
  78. select
  79. <include refid="table_columns"/>
  80. from att_ad_base
  81. <include refid="page_where"/>
  82. </select>
  83. <select id="findAll" resultMap="attAdBaseResultMap">
  84. select
  85. <include refid="table_columns"/>
  86. from att_ad_base
  87. </select>
  88. <select id="findList" resultMap="attAdBaseResultMap">
  89. select
  90. GUID,
  91. AD_CODE,
  92. AD_NAME,
  93. LOW_LEFT_LONG,
  94. LOW_LEFT_LAT,
  95. UP_RIGHT_LONG,
  96. UP_RIGHT_LAT,
  97. AD_GRAD,
  98. AD_FULL_NAME,
  99. NOTE,
  100. STAT
  101. from att_ad_base
  102. <include refid="page_where"/>
  103. ORDER BY AD_CODE ASC
  104. </select>
  105. <select id="selectCount" resultType="int">
  106. select count(GUID) from att_ad_base
  107. <include refid="page_where"/>
  108. </select>
  109. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.AttAdBase">
  110. insert into att_ad_base(
  111. <include refid="table_columns"/>
  112. )
  113. values (
  114. <include refid="entity_properties"/>
  115. )
  116. </insert>
  117. <delete id="delete" parameterType="java.lang.String">
  118. delete from att_ad_base where GUID = #{id}
  119. </delete>
  120. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.AttAdBase">
  121. delete from att_ad_base
  122. <include refid="page_where"/>
  123. </delete>
  124. <update id="deleteInFlag" parameterType="java.lang.String">
  125. update att_ad_base set flag_valid = 0 where GUID = #{id}
  126. </update>
  127. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.AttAdBase">
  128. update att_ad_base
  129. <trim prefix="set" suffixOverrides=",">
  130. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  131. <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
  132. <if test="adType != null and adType != ''">AD_TYPE = #{adType},</if>
  133. <if test="lowLeftLong != null and lowLeftLong != ''">LOW_LEFT_LONG = #{lowLeftLong},</if>
  134. <if test="lowLeftLat != null and lowLeftLat != ''">LOW_LEFT_LAT = #{lowLeftLat},</if>
  135. <if test="upRightLong != null and upRightLong != ''">UP_RIGHT_LONG = #{upRightLong},</if>
  136. <if test="upRightLat != null and upRightLat != ''">UP_RIGHT_LAT = #{upRightLat},</if>
  137. <if test="adGrad != null and adGrad != ''">AD_GRAD = #{adGrad},</if>
  138. <if test="upAdGuid != null and upAdGuid != ''">UP_AD_GUID = #{upAdGuid},</if>
  139. <if test="note != null and note != ''">NOTE = #{note},</if>
  140. <if test="collTime != null">COLL_TIME = #{collTime},</if>
  141. <if test="updTime != null">UPD_TIME = #{updTime},</if>
  142. <if test="recPers != null and recPers != ''">REC_PERS = #{recPers},</if>
  143. <if test="stat != null and stat != ''">STAT = #{stat},</if>
  144. </trim>
  145. <where>GUID = #{guid}</where>
  146. </update>
  147. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.AttAdBase">
  148. update att_ad_base
  149. <trim prefix="set" suffixOverrides=",">
  150. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  151. <if test="adName != null and adName != ''">AD_NAME = #{adName},</if>
  152. <if test="adType != null and adType != ''">AD_TYPE = #{adType},</if>
  153. <if test="lowLeftLong != null and lowLeftLong != ''">LOW_LEFT_LONG = #{lowLeftLong},</if>
  154. <if test="lowLeftLat != null and lowLeftLat != ''">LOW_LEFT_LAT = #{lowLeftLat},</if>
  155. <if test="upRightLong != null and upRightLong != ''">UP_RIGHT_LONG = #{upRightLong},</if>
  156. <if test="upRightLat != null and upRightLat != ''">UP_RIGHT_LAT = #{upRightLat},</if>
  157. <if test="adGrad != null and adGrad != ''">AD_GRAD = #{adGrad},</if>
  158. <if test="upAdGuid != null and upAdGuid != ''">UP_AD_GUID = #{upAdGuid},</if>
  159. <if test="note != null and note != ''">NOTE = #{note},</if>
  160. <if test="collTime != null">COLL_TIME = #{collTime},</if>
  161. <if test="updTime != null">UPD_TIME = #{updTime},</if>
  162. <if test="recPers != null and recPers != ''">REC_PERS = #{recPers},</if>
  163. <if test="stat != null and stat != ''">STAT = #{stat},</if>
  164. </trim>
  165. <include refid="page_where"/>
  166. </update>
  167. <!-- 其他自定义SQL -->
  168. <select id="getByAdcode" resultMap="attAdBaseResultMap" parameterType="String">
  169. select
  170. *
  171. from att_ad_base where AD_CODE = #{code}
  172. </select>
  173. <select id="getAllChildByCode" resultMap="attAdBaseResultMap" parameterType="String">
  174. select * from att_ad_base where AD_CODE like '${code}%'
  175. </select>
  176. <!--查询督查范围内的对下那个-->
  177. <select id="getListByInspGroupIdObjType" parameterType="cn.com.goldenwater.dcproj.param.PagePersObjParam"
  178. resultType="cn.com.goldenwater.dcproj.model.AttAdBase">
  179. select t.*,C.id,C.PNM,o.obj_id
  180. from ATT_AD_X_BASE t
  181. left join BIS_INSP_ALL_OBJ o
  182. on o.CODE = t.Ad_Code LEFT JOIN BIS_INSP_ALL C ON o.ID = C.ID
  183. and o.ptype =#{objType}
  184. <where>
  185. <if test='isAll == "0"'>and o.ID = #{inspGroupId}</if>
  186. <if test='isAll == "1"'>and o.ID LIKE '${inspGroupId}%'</if>
  187. <if test="adCode != null and adCode != ''">and t.AD_CODE LIKE '${adCode}%'</if>
  188. <choose>
  189. <when test="province !=null and province !=''">
  190. and o.ad_code like '${province}%'
  191. </when>
  192. <otherwise>
  193. and o.ad_code is null
  194. </otherwise>
  195. </choose>
  196. <if test="adName != null and adName != ''">and t.AD_NAME LIKE '%${adName}%'</if>
  197. <if test="wtdstNm != null and wtdstNm != ''">and t.AD_NAME LIKE '%${wtdstNm}%'</if>
  198. </where>
  199. </select>
  200. <!--查询不在范围内的对象-->
  201. <select id="getObjListNotInspGroupId" resultType="cn.com.goldenwater.dcproj.model.AttAdBase">
  202. SELECT * FROM ATT_AD_BASE WHERE AD_CODE NOT in (
  203. select CODE from BIS_INSP_ALL_OBJ where id like concat(#{inspGroupId},'%'))
  204. <if test="adName != null and adName != ''">and AD_NAME LIKE '%${adName}%'</if>
  205. <if test="adCode != null and adCode != ''">and AD_CODE LIKE '${adCode}%'</if>
  206. <if test="province !=null and province !=''">
  207. and ad_code like '${province}%'
  208. </if>
  209. order by ad_code asc
  210. </select>
  211. <select id="getObjListByGroupIdAndTypeNew" resultType="cn.com.goldenwater.dcproj.model.AttAdBase">
  212. select * from BIS_INSP_ALL_OBJ where id like concat('','%')
  213. </select>
  214. <sql id="orgIdSql">
  215. <choose>
  216. <when test="orgId !=null and orgId !=''">
  217. and ORG_ID=#{orgId}
  218. </when>
  219. <otherwise>
  220. and ORG_ID is null
  221. </otherwise>
  222. </choose>
  223. </sql>
  224. <select id="getObjByPersId" parameterType="cn.com.goldenwater.dcproj.param.PersObjParam"
  225. resultType="cn.com.goldenwater.dcproj.dto.SecsurveyVlgDto">
  226. SELECT A.VILL_ID,
  227. A.ENG_ID,
  228. A.VILLAGE_CODE,
  229. A.IS_POVERTY,
  230. A.IS_FLUEXC,
  231. A.IS_MTAREA,
  232. A.IS_CENWT_SUPPLY,
  233. A.WATERSUPPLY_PER,
  234. A.VISIT_DATE,
  235. A.REC_PERS_ID,
  236. A.REC_PERS2,
  237. A.REC_PERS_TEL,
  238. A.CREATE_TIME,
  239. A.UPDATE_TIME,
  240. A.STATUS,
  241. A.AD_NM,C.OBJ_ID,
  242. A.WAS_POVERTY,ad.LGTD lgtdPc,ad.LTTD lttdPc,ad.AD_LONG centerXGd,ad.AD_LAT centerYGd
  243. FROM BIS_INSP_SECSURVEY_VLG A
  244. LEFT JOIN BIS_INSP_VILL_RGSTR B ON A.ENG_ID = B.ENG_ID
  245. LEFT JOIN BIS_INSP_ALL_OBJ C ON B.OBJ_ID = C.OBJ_ID
  246. LEFT JOIN ATT_AD_X_BASE ad on A.VILLAGE_CODE = ad.AD_CODE
  247. WHERE C.PTYPE = #{objType}
  248. <choose>
  249. <when test="province !=null and province !=''">
  250. and A.VILLAGE_CODE like '${province}%'
  251. </when>
  252. <otherwise>
  253. and C.AD_CODE is null
  254. </otherwise>
  255. </choose>
  256. AND
  257. REGEXP_LIKE(
  258. C.Id,'^('||
  259. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID = #{persGuid}
  260. <include refid="orgIdSql"/>
  261. )>0 then
  262. (SELECT LISTAGG(id, '|') WITHIN GROUP(ORDER BY PERSID) as
  263. id FROM BIS_INSP_ALL_RLATION WHERE PERSID = #{persGuid}
  264. <include refid="orgIdSql"/>
  265. )
  266. else (select 'non' from dual) end)
  267. ||')')
  268. <if test="adName != null and adName != ''">and A.AD_NM LIKE '%${adName}%'</if>
  269. <if test="adCode != null and adCode != ''">and A.VILLAGE_CODE LIKE '${adCode}%'</if>
  270. <if test="maxLgtd != null and maxLgtd != '' and minLgtd != null and minLgtd != ''">and ad.LGTD BETWEEN
  271. #{minLgtd} AND #{maxLgtd}
  272. </if>
  273. <if test="maxLttd != null and maxLttd != '' and minLttd != null and minLttd != ''">and ad.LTTD BETWEEN
  274. #{minLttd} AND #{maxLttd}
  275. </if>
  276. <if test="maxcenterXGd != null and maxcenterXGd != '' and mincenterXGd != null and mincenterXGd != ''">and
  277. ad.AD_LONG BETWEEN #{mincenterXGd} AND #{maxcenterXGd}
  278. </if>
  279. <if test="maxcenterYGd != null and maxcenterYGd != '' and mincenterYGd != null and mincenterYGd != ''">and
  280. ad.AD_LAT BETWEEN #{mincenterYGd} AND #{maxcenterYGd}
  281. </if>
  282. </select>
  283. <select id="getPspByPersId" parameterType="cn.com.goldenwater.dcproj.param.PersObjParam"
  284. resultType="cn.com.goldenwater.dcproj.dto.ProSourceProtectDto">
  285. SELECT A.ENG_SUR_ID,
  286. A.ENG_ID,
  287. A.WATER_SOURCE_NM,
  288. A.VILLAGE_NM,
  289. A.CWS_CODE,
  290. A.PLAN_INS_AMOUNT,
  291. A.SOURCE_TYPE,
  292. A.IS_PROTECT_AREA,
  293. A.WATER_QUALITY,
  294. A.IS_PROTECT_MARK,
  295. A.IS_POLL_SOURCE,
  296. A.IS_SPARE,
  297. A.VISIT_DATE,
  298. A.REC_PERS_ID,
  299. A.REC_PERS2,
  300. A.REC_PERS_TEL,
  301. A.CREATE_TIME,
  302. A.UPDATE_TIME,
  303. A.STATUS,
  304. A.WTSR_CD,
  305. A.PRO_PLBM,
  306. A.MK_PLBM,
  307. A.POLL_PLBM,
  308. A.SP_PLBM,
  309. A.LGTD,
  310. A.LTTD,
  311. A.LGTD centerXGd,
  312. A.LTTD centerYGd,
  313. A.LGTDPC lgtdPc,
  314. A.LTTDPC lttdPc,C.OBJ_ID,
  315. A.POLL_NOTE FROM BIS_INSP_PRO_SOURCE_PROTECT A LEFT JOIN BIS_INSP_VILL_RGSTR B ON A.ENG_ID = B.ENG_ID
  316. LEFT JOIN BIS_INSP_ALL_OBJ C ON B.OBJ_ID = C.OBJ_ID
  317. WHERE 1 = 1 AND C.PTYPE = #{objType} AND B.ENG_ID IS NOT NULL
  318. <choose>
  319. <when test="province !=null and province !=''">
  320. and C.AD_CODE=#{province}
  321. </when>
  322. <otherwise>
  323. and C.AD_CODE is null
  324. </otherwise>
  325. </choose>
  326. AND
  327. REGEXP_LIKE(
  328. C.Id,'^('||
  329. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID = #{persGuid}
  330. <include refid="orgIdSql"/>
  331. )>0 then
  332. (SELECT LISTAGG(id, '|') WITHIN GROUP(ORDER BY PERSID) as
  333. id FROM BIS_INSP_ALL_RLATION WHERE PERSID = #{persGuid}
  334. <include refid="orgIdSql"/>
  335. )
  336. else (select 'non' from dual) end)
  337. ||')')
  338. <if test="province != null and province != ''">and C.CODE LIKE '${province}%'</if>
  339. <if test="adName != null and adName != ''">and A.WATER_SOURCE_NM LIKE '%${adName}%'</if>
  340. <if test="adCode != null and adCode != ''">and C.CODE LIKE '${adCode}%'</if>
  341. <if test="maxLgtd != null and maxLgtd != '' and minLgtd != null and minLgtd != ''">and A.LGTDPC BETWEEN
  342. #{minLgtd} AND #{maxLgtd}
  343. </if>
  344. <if test="maxLttd != null and maxLttd != '' and minLttd != null and minLttd != ''">and A.LTTDPC BETWEEN
  345. #{minLttd} AND #{maxLttd}
  346. </if>
  347. <if test="maxcenterXGd != null and maxcenterXGd != '' and mincenterXGd != null and mincenterXGd != ''">and
  348. A.LGTD BETWEEN #{mincenterXGd} AND #{maxcenterXGd}
  349. </if>
  350. <if test="maxcenterYGd != null and maxcenterYGd != '' and mincenterYGd != null and mincenterYGd != ''">and
  351. A.LTTD BETWEEN #{mincenterYGd} AND #{maxcenterYGd}
  352. </if>
  353. </select>
  354. <select id="getCwsByPersId" parameterType="cn.com.goldenwater.dcproj.param.PersObjParam"
  355. resultType="cn.com.goldenwater.dcproj.dto.AttCwsBaseDto">
  356. SELECT A.GUID,
  357. A.CWS_CODE,
  358. A.CWS_NAME,
  359. A.CWS_LONG,
  360. A.CWS_LAT,
  361. A.CWS_LOC,
  362. A.ENG_TYPE,
  363. A.WASU_TYPE,
  364. A.WASU_RANG,
  365. A.DES_WASU_SCAL,
  366. A.DES_WASU_POP,
  367. A.ENG_STAT,
  368. A.START_DATE,
  369. A.COMP_DATE,
  370. A.NOTE,
  371. A.EFF_DATE,
  372. A.EXPR_DATE,
  373. A.ADDVCD,
  374. A.CENTER_X_GD,
  375. A.CENTER_Y_GD,
  376. A.INTM,
  377. A.EDTR_PESR,
  378. A.UPTM,C.OBJ_ID,
  379. A.CHK_STATE FROM ATT_CWS_BASE A
  380. LEFT JOIN BIS_INSP_ALL_OBJ C ON A.ADDVCD = C.CODE
  381. WHERE 1 = 1 AND C.PTYPE = #{objType}
  382. <choose>
  383. <when test="province !=null and province !=''">
  384. and A.ADDVCD like '${province}%'
  385. </when>
  386. <otherwise>
  387. and C.AD_CODE is null
  388. </otherwise>
  389. </choose>
  390. <!-- AND
  391. REGEXP_LIKE(
  392. C.Id,'^('||
  393. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID = #{persGuid}
  394. <include refid="orgIdSql"/>
  395. )>0 then
  396. (SELECT LISTAGG(id, '|') WITHIN GROUP(ORDER BY PERSID) as
  397. id FROM BIS_INSP_ALL_RLATION WHERE PERSID = #{persGuid}
  398. <include refid="orgIdSql"/>
  399. )
  400. else (select 'non' from dual) end)
  401. ||')')-->
  402. <if test="adName != null and adName != ''">and A.CWS_NAME LIKE '%${adName}%'</if>
  403. <if test="adCode != null and adCode != ''">and A.ADDVCD LIKE '${adCode}%'</if>
  404. <if test="maxLgtd != null and maxLgtd != '' and minLgtd != null and minLgtd != ''">and A.CWS_LONG BETWEEN
  405. #{minLgtd} AND #{maxLgtd}
  406. </if>
  407. <if test="maxLttd != null and maxLttd != '' and minLttd != null and minLttd != ''">and A.CWS_LAT BETWEEN
  408. #{minLttd} AND #{maxLttd}
  409. </if>
  410. <if test="maxcenterXGd != null and maxcenterXGd != '' and mincenterXGd != null and mincenterXGd != ''">and
  411. A.CENTER_X_GD BETWEEN #{mincenterXGd} AND #{maxcenterXGd}
  412. </if>
  413. <if test="maxcenterYGd != null and maxcenterYGd != '' and mincenterYGd != null and mincenterYGd != ''">and
  414. A.CENTER_Y_GD BETWEEN #{mincenterYGd} AND #{maxcenterYGd}
  415. </if>
  416. <if test="desWasuScal != null and desWasuScal != ''">and A.DES_WASU_SCAL &gt;= #{desWasuScal}</if>
  417. </select>
  418. <select id="getAdData" parameterType="String" resultType="cn.com.goldenwater.dcproj.model.AttAdBase">
  419. select guid,
  420. ad_code,
  421. ad_name,
  422. low_left_long,
  423. low_left_lat,
  424. up_right_long,
  425. up_right_lat,
  426. up_ad_name,
  427. ad_grad,
  428. ad_abbr_name,
  429. ad_stat,
  430. ad_area,
  431. ad_full_name,
  432. note,
  433. eff_date,
  434. expr_date,
  435. ad_stat_long,
  436. ad_stat_lat,
  437. domain_code,
  438. ad_sign,
  439. modifier_people,
  440. upd_date,
  441. is_report,
  442. ad_fcode,lgtd,lttd from att_ad_base WHERE AD_FCODE = #{adCode} ORDER BY AD_CODE
  443. </select>
  444. <select id="fingAdUp" parameterType="String" resultType="cn.com.goldenwater.dcproj.dto.AdUpDto">
  445. SELECT * FROM ATT_AD_BASE WHERE AD_CODE = #{adCode}
  446. </select>
  447. <select id="getAdBaseByPersId" parameterType="cn.com.goldenwater.dcproj.param.PersObjParam"
  448. resultType="cn.com.goldenwater.dcproj.model.AttAdBase">
  449. SELECT * FROM BIS_INSP_ALL_OBJ A LEFT JOIN ATT_AD_BASE B ON A.CODE = B.AD_CODE
  450. WHERE A.PTYPE = '2'
  451. <choose>
  452. <when test="province !=null and province !=''">
  453. and A.AD_CODE=#{province}
  454. </when>
  455. <otherwise>
  456. and A.AD_CODE is null
  457. </otherwise>
  458. </choose>
  459. AND
  460. REGEXP_LIKE(
  461. A.Id,'^('||
  462. ( case when(SELECT count(id) from BIS_INSP_ALL_RLATION WHERE PERSID = #{persGuid}
  463. <include refid="orgIdSql"/>
  464. )>0 then
  465. (SELECT LISTAGG(id, '|') WITHIN GROUP(ORDER BY PERSID) as
  466. id FROM BIS_INSP_ALL_RLATION WHERE PERSID = #{persGuid}
  467. <include refid="orgIdSql"/>
  468. )
  469. else (select 'non' from dual) end)
  470. ||')')
  471. <if test="adName != null and adName != ''">and B.AD_NAME LIKE '%${adName}%'</if>
  472. <if test="adCode != null and adCode != ''">and A.CODE LIKE '${adCode}%'</if>
  473. <if test="maxLgtd != null and maxLgtd != '' and minLgtd != null and minLgtd != ''">and B.LGTD BETWEEN #{minLgtd}
  474. AND #{maxLgtd}
  475. </if>
  476. <if test="maxLttd != null and maxLttd != '' and minLttd != null and minLttd != ''">and B.LTTD BETWEEN #{minLttd}
  477. AND #{maxLttd}
  478. </if>
  479. <if test="maxcenterXGd != null and maxcenterXGd != '' and mincenterXGd != null and mincenterXGd != ''">and
  480. B.AD_LONG BETWEEN #{mincenterXGd} AND #{maxcenterXGd}
  481. </if>
  482. <if test="maxcenterYGd != null and maxcenterYGd != '' and mincenterYGd != null and mincenterYGd != ''">and
  483. B.AD_LAT BETWEEN #{mincenterYGd} AND #{maxcenterYGd}
  484. </if>
  485. </select>
  486. <select id="getAllChildren" resultType="cn.com.goldenwater.dcproj.dto.AdUpDto">
  487. select * from ATT_AD_BASE where AD_CODE LIKE '${adCode}%' and AD_GRAD &lt;= 4
  488. </select>
  489. <!-- 根据行政区划 代码 获取 全名 -->
  490. <select id="getNameByAdCode" resultType="String" >
  491. select
  492. AD_FULL_NAME
  493. from att_ad_base where AD_CODE = #{code}
  494. </select>
  495. </mapper>