82dc41392ba37d41c1de0e60760bb863d2fbd83d.svn-base 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505
  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.BisNewVillRgstrDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.BisNewVillRgstr" id="bisNewVillRgstrResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="objId" column="OBJ_ID"/>
  7. <result property="regsNm" column="REGS_NM"/>
  8. <result property="waterPriceIsMade" column="WATER_PRICE_IS_MADE"/>
  9. <result property="waterSafeOrPay" column="WATER_SAFE_OR_PAY"/>
  10. <result property="adCode" column="AD_CODE"/>
  11. <result property="persId" column="PERS_ID"/>
  12. <result property="intm" column="INTM"/>
  13. <result property="uptm" column="UPTM"/>
  14. <result property="note" column="NOTE"/>
  15. <result property="dataStat" column="DATA_STAT"/>
  16. <result property="state" column="STATE"/>
  17. <result property="adFullName" column="AD_FULL_NAME"/>
  18. <result property="isPkx" column="IS_PKX"/>
  19. <result property="isFoOver" column="IS_FO_OVER"/>
  20. <result property="lgtd" column="LGTD"/>
  21. <result property="lttd" column="LTTD"/>
  22. <result property="lgtdpc" column="LGTDPC"/>
  23. <result property="lttdpc" column="LTTDPC"/>
  24. <result property="villNum" column="VILL_NUM"/>
  25. <result property="proNum" column="PRO_NUM"/>
  26. <result property="waterNum" column="WATER_NUM"/>
  27. </resultMap>
  28. <sql id="table_columns">
  29. ID,VILL_NUM,PRO_NUM,WATER_NUM,
  30. LGTD ,
  31. LTTD ,
  32. LGTDPC ,
  33. LTTDPC ,
  34. OBJ_ID,
  35. REGS_NM,
  36. WATER_PRICE_IS_MADE,
  37. WATER_SAFE_OR_PAY,
  38. AD_CODE,
  39. PERS_ID,
  40. INTM,
  41. UPTM,
  42. NOTE,
  43. DATA_STAT,
  44. STATE,
  45. AD_FULL_NAME,
  46. IS_PKX,
  47. IS_FO_OVER
  48. </sql>
  49. <sql id="entity_properties">
  50. #{id},#{villNum},#{proNum},#{waterNum},
  51. #{lgtd},
  52. #{lttd},
  53. #{lgtdpc},
  54. #{lttdpc},
  55. #{objId},
  56. #{regsNm},
  57. #{waterPriceIsMade},
  58. #{waterSafeOrPay},
  59. #{adCode},
  60. #{persId},
  61. #{intm},
  62. #{uptm},
  63. #{note},
  64. #{dataStat},
  65. #{state},
  66. #{adFullName},
  67. #{isPkx},
  68. #{isFoOver}
  69. </sql>
  70. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  71. <sql id="page_where">
  72. <trim prefix="where" prefixOverrides="and | or ">
  73. <if test="objId != null and objId != ''">and OBJ_ID = #{objId}</if>
  74. <if test="waterNum != null and waterNum != ''">and WATER_NUM = #{waterNum}</if>
  75. <if test="proNum != null and proNum != ''">and PRO_NUM = #{proNum}</if>
  76. <if test="villNum != null and villNum != ''">and VILL_NUM = #{villNum}</if>
  77. <if test="regsNm != null and regsNm != ''">and REGS_NM = #{regsNm}</if>
  78. <if test="waterPriceIsMade != null and waterPriceIsMade != ''">and WATER_PRICE_IS_MADE =
  79. #{waterPriceIsMade}
  80. </if>
  81. <if test="waterSafeOrPay != null and waterSafeOrPay != ''">and WATER_SAFE_OR_PAY = #{waterSafeOrPay}</if>
  82. <if test="adCode != null and adCode != ''">and AD_CODE = #{adCode}</if>
  83. <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
  84. <if test="intm != null">and INTM = #{intm}</if>
  85. <if test="uptm != null">and UPTM = #{uptm}</if>
  86. <if test="note != null and note != ''">and NOTE = #{note}</if>
  87. <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
  88. <if test="state != null and state != ''">and STATE = #{state}</if>
  89. <if test="adFullName != null and adFullName != ''">and AD_FULL_NAME = #{adFullName}</if>
  90. <if test="isPkx != null and isPkx != ''">and IS_PKX = #{isPkx}</if>
  91. <if test="isFoOver != null and isFoOver != ''">and IS_FO_OVER = #{isFoOver}</if>
  92. </trim>
  93. </sql>
  94. <select id="get" resultMap="bisNewVillRgstrResultMap" parameterType="String">
  95. select
  96. <include refid="table_columns"/>
  97. from BIS_NEW_VILL_RGSTR where ID = #{id}
  98. </select>
  99. <select id="getBy" resultMap="bisNewVillRgstrResultMap">
  100. select
  101. <include refid="table_columns"/>
  102. from BIS_NEW_VILL_RGSTR
  103. <include refid="page_where"/>
  104. </select>
  105. <select id="findAll" resultMap="bisNewVillRgstrResultMap">
  106. select
  107. <include refid="table_columns"/>
  108. from BIS_NEW_VILL_RGSTR
  109. </select>
  110. <select id="findList" resultMap="bisNewVillRgstrResultMap">
  111. select
  112. <include refid="table_columns"/>
  113. from BIS_NEW_VILL_RGSTR
  114. <include refid="page_where"/>
  115. </select>
  116. <select id="selectCount" resultType="int">
  117. select count(ID) from BIS_NEW_VILL_RGSTR
  118. <include refid="page_where"/>
  119. </select>
  120. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisNewVillRgstr">
  121. insert into BIS_NEW_VILL_RGSTR(
  122. <include refid="table_columns"/>
  123. )
  124. values (
  125. <include refid="entity_properties"/>
  126. )
  127. </insert>
  128. <delete id="delete" parameterType="java.lang.String">
  129. delete from BIS_NEW_VILL_RGSTR where ID = #{id}
  130. </delete>
  131. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisNewVillRgstr">
  132. delete from BIS_NEW_VILL_RGSTR
  133. <include refid="page_where"/>
  134. </delete>
  135. <update id="deleteInFlag" parameterType="java.lang.String">
  136. update BIS_NEW_VILL_RGSTR set flag_valid = 0 where ID = #{id}
  137. </update>
  138. <update id="updateVillSum" parameterType="cn.com.goldenwater.dcproj.model.BisNewVillRgstr">
  139. update BIS_NEW_VILL_RGSTR set VILL_NUM = #{villNum} where ID = #{id}
  140. </update>
  141. <update id="updateProSum" parameterType="cn.com.goldenwater.dcproj.model.BisNewVillRgstr">
  142. update BIS_NEW_VILL_RGSTR set PRO_NUM = #{proNum} where ID = #{id}
  143. </update>
  144. <update id="updateWaterSum" parameterType="cn.com.goldenwater.dcproj.model.BisNewVillRgstr">
  145. update BIS_NEW_VILL_RGSTR set WATER_NUM = #{waterNum} where ID = #{id}
  146. </update>
  147. <update id="updateAllNum" parameterType="cn.com.goldenwater.dcproj.model.BisNewVillRgstr">
  148. update BIS_NEW_VILL_RGSTR set WATER_NUM = #{waterNum},PRO_NUM = #{proNum},VILL_NUM = #{villNum} where ID = #{id}
  149. </update>
  150. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisNewVillRgstr">
  151. update BIS_NEW_VILL_RGSTR
  152. <trim prefix="set" suffixOverrides=",">
  153. <if test="lgtd != null and lgtd != ''">LGTD = #{lgtd},</if>
  154. <if test="lttd != null and lttd != ''">LTTD = #{lttd},</if>
  155. <if test="lgtdpc != null and lgtdpc != ''">LGTDPC = #{lgtdpc},</if>
  156. <if test="lttdpc != null and lttdpc != ''">LTTDPC = #{lttdpc},</if>
  157. <if test="objId != null and objId != ''">OBJ_ID = #{objId},</if>
  158. <if test="regsNm != null and regsNm != ''">REGS_NM = #{regsNm},</if>
  159. <if test="waterPriceIsMade != null and waterPriceIsMade != ''">WATER_PRICE_IS_MADE = #{waterPriceIsMade},
  160. </if>
  161. <if test="waterSafeOrPay != null and waterSafeOrPay != ''">WATER_SAFE_OR_PAY = #{waterSafeOrPay},</if>
  162. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  163. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  164. <if test="intm != null">INTM = #{intm},</if>
  165. <if test="uptm != null">UPTM = #{uptm},</if>
  166. <if test="note != null and note != ''">NOTE = #{note},</if>
  167. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  168. <if test="state != null and state != ''">STATE = #{state},</if>
  169. <if test="adFullName != null and adFullName != ''">AD_FULL_NAME = #{adFullName},</if>
  170. <if test="isPkx != null and isPkx != ''">IS_PKX = #{isPkx},</if>
  171. <if test="isFoOver != null and isFoOver != ''">IS_FO_OVER = #{isFoOver},</if>
  172. </trim>
  173. <where>ID = #{id}</where>
  174. </update>
  175. <select id="pageNotAddRegstr" resultType="cn.com.goldenwater.dcproj.dto.AttCountryDto"
  176. parameterType="cn.com.goldenwater.dcproj.param.CommonParam">
  177. select e.ad_code,e.ad_name,(case when e.is_poveryt is null then '0' else e.is_poveryt end)
  178. is_poveryt,e.lgtd,e.lttd,
  179. (case when o.obj_id is null then '0' else '1' end) status,o.obj_id,o.id from att_ad_x_base e
  180. left join bis_insp_all_obj o on e.ad_code=o.code
  181. where o.ptype=#{objType}
  182. <if test="objId !=null and objId !=''">
  183. and o.obj_id=#{objId}
  184. </if>
  185. <if test="name !=null and name !=''">
  186. and e.ad_name like '%${name}%'
  187. </if>
  188. <if test="adCode !=null and adCode !=''">
  189. and e.ad_code like '%${adCode}%'
  190. </if>
  191. <if test="isPoveryt !=null and isPoveryt !=''">
  192. and e.is_poveryt =#{isPoveryt}
  193. </if>
  194. <if test="orderBy !=null and orderBy !=''">
  195. order by ${orderBy}
  196. </if>
  197. </select>
  198. <select id="findNewVillPageByType" parameterType="cn.com.goldenwater.dcproj.param.TypeParam"
  199. resultType="cn.com.goldenwater.dcproj.dto.BisNewVillRgstrDto">
  200. select * from (select A.*,CASE WHEN b.state IS NULL THEN '0' ELSE b.state END AS wtdstState,B.Id as
  201. regstr_id,B.Id as rgstr_id,B.INTM,(
  202. case WHEN B.is_pkx is null THEN '0' else B.is_pkx END ) as is_pkx,
  203. B.Water_Price_Is_Made,B.WATER_SAFE_OR_PAY,B.vill_num,B.pro_num,B.water_num
  204. FROM BIS_INSP_ALL_OBJ A
  205. LEFT JOIN BIS_NEW_VILL_RGSTR B
  206. ON A.OBJ_ID = B.OBJ_ID
  207. where A.ptype=#{pType} AND
  208. A.Id in (
  209. select distinct id from (
  210. SELECT P.id FROM BIS_INSP_ALL P START WITH P.PID IN (SELECT id FROM BIS_INSP_ALL_RLATION A
  211. WHERE A.PERSID = #{presId} and length(id) in (3,6,9))
  212. CONNECT BY P.PID = PRIOR P.ID
  213. union all
  214. SELECT P.id FROM BIS_INSP_ALL P where p.id in (SELECT id FROM BIS_INSP_ALL_RLATION A
  215. WHERE A.PERSID =#{presId} and length(id)=12 )
  216. )
  217. )
  218. ) a
  219. where 1=1
  220. <if test="adCode !=null and adCode !=''">
  221. and a.code like '${adCode}%'
  222. </if>
  223. <if test="sttm != null and sttm != '' and entm != null and entm != ''">
  224. AND INTM &gt;= TO_DATE(#{sttm},'YYYY-MM-DD') AND INTM &lt; TO_DATE(#{entm},'YYYY-MM-DD')+1
  225. </if>
  226. <if test="plnaId !=null and plnaId !=''">
  227. and a.id like '${plnaId}%'
  228. </if>
  229. <if test="groupId !=null and groupId !=''">
  230. and a.id like '${groupId}%'
  231. </if>
  232. <if test="state !=null and state !=''">
  233. and wtdstState in (${state})
  234. </if>
  235. <if test="rsName !=null and rsName !=''">
  236. and a.nm like '%${rsName}%'
  237. </if>
  238. order by wtdstState asc
  239. <if test="orderBy != null and orderBy != ''">
  240. ,${orderBy}
  241. </if>
  242. </select>
  243. <!-- 其他自定义SQL -->
  244. <select id="sumNewVillNumAdd" resultType="cn.com.goldenwater.dcproj.dto.SumNewVillNumDto" parameterType="String">
  245. select sum(vill_num) as vill_num,sum(pro_num) as pro_num,sum(water_num) as water_num from (
  246. SELECT COUNT(B.ad_code) vill_num,0 as pro_num,0 as water_num
  247. FROM bis_new_dcuser_rel_vill B
  248. where B.regstr_id =#{regstrId}
  249. UNION all
  250. SELECT 0 as vill_num,count(B.id) pro_num,0 as water_num
  251. FROM BIS_NEW_COUNTRY_FEE B
  252. where B.REGSTR_ID=#{regstrId}
  253. UNION all
  254. SELECT
  255. 0 as vill_num,0 as pro_num,COUNT(B.id) as water_num
  256. FROM BIS_NEW_WATERUSER_INFO B
  257. where B.REGSTR_ID=#{regstrId}
  258. ) w
  259. </select>
  260. <select id="sumNewVillNum" resultType="cn.com.goldenwater.dcproj.dto.SumNewVillNumDto" parameterType="String">
  261. select sum(vill_num) as vill_num,sum(pro_num) as pro_num,sum(water_num) as water_num from (
  262. SELECT COUNT(B.ad_code) vill_num,0 as pro_num,0 as water_num
  263. FROM att_ad_x_base B
  264. where B.ad_code like '${code}%' and substr(ad_code,10) !='000'
  265. ) w
  266. </select>
  267. <select id="findPageList" resultType="cn.com.goldenwater.dcproj.model.BisInspPblm"
  268. parameterType="cn.com.goldenwater.dcproj.param.PlbmParam">
  269. select w.* from (
  270. select j.id as oid,j.obj_id,m.pblm_id,m.obj_type,m.insp_pblm_name,m.state,m.data_stat
  271. ,m.insp_pblm_desc,m.pblm_long,m.pblm_lat,s.check_point,s.PBLM_DESC,
  272. m.new_vill_name,j.nm,m.vill_type,m.has_vedio,m.quote,m.rec_pers,
  273. m.regid,j.code as ad_code,ba.ad_full_name,s.sn_num,p.pers_name,al.sttm,al.entm,
  274. m.insp_add_desc,m.coll_time,(select l.pnm from bis_insp_all l where l.id=substr(al.id,0,6)) as pnm,
  275. (select org_nm from bis_insp_org where org_id=substr(al.id,4,3)) as org_nm
  276. from (select *
  277. from BIS_INSP_ALL_OBJ j
  278. <choose>
  279. <when test="objType != null and objType != '' ">
  280. where j.pType= #{objType}
  281. </when>
  282. <otherwise>
  283. where j.pType='25'
  284. </otherwise>
  285. </choose>
  286. ) j
  287. join BIS_INSP_PBLM m on m.obj_id=j.obj_id
  288. join obj_insp_pblms s on m.pblms_type_id=s.guid
  289. left join bis_insp_all al on al.id=j.id
  290. left join bis_insp_all_rlation_pers p on m.rec_pers=p.guid
  291. left join att_ad_x_base ba on j.code=ba.ad_code
  292. ) w
  293. where 1=1
  294. <if test="tabType =='2'.toString()">
  295. and w.entm &lt;to_date(#{nowTime},'yyyy-MM-dd')+1
  296. </if>
  297. <if test="tabType =='1'.toString()">
  298. and w.entm &gt;=to_date(#{nowTime},'yyyy-MM-dd') and w.sttm &lt; to_date(#{nowTime},'yyyy-MM-dd')+1
  299. </if>
  300. <if test="timeType =='1'.toString()">
  301. and w.COLL_TIME >=to_date(#{nowTime},'yyyy-MM-dd')
  302. </if>
  303. <if test="timeType =='2'.toString()">
  304. and w.COLL_TIME &gt;=to_date(#{nowMonth},'yyyy-MM')
  305. </if>
  306. <if test="timeType =='3'.toString()">
  307. and w.COLL_TIME &gt;=to_date(#{nowYear},'yyyy')
  308. </if>
  309. AND W.OID in (
  310. select distinct id from (
  311. SELECT P.id FROM BIS_INSP_ALL P START WITH P.PID IN (SELECT id FROM BIS_INSP_ALL_RLATION A
  312. WHERE A.PERSID = #{presId} and length(id) in (3,6,9)
  313. <include refid="choseSql"/>
  314. )
  315. CONNECT BY P.PID = PRIOR P.ID
  316. union all
  317. SELECT P.id FROM BIS_INSP_ALL P where p.id in (SELECT id FROM BIS_INSP_ALL_RLATION A
  318. WHERE A.PERSID =#{presId} and length(id)=12
  319. <include refid="choseSql"/>
  320. )
  321. )
  322. )
  323. <if test="villType !=null and villType !=''">
  324. and w.vill_type in (${villType})
  325. </if>
  326. <if test="state != null and state != ''">and w.state = #{state}</if>
  327. <if test="codes != null and codes != ''">and w.code in (${codes})</if>
  328. <if test="orgIds != null and orgIds != ''">and w.oid in (${orgIds})</if>
  329. <if test="objIdes != null and objIdes != ''">and OBJ_ID in (${objIdes})</if>
  330. <if test="inspPblmName !=null and inspPblmName !=''">
  331. and w.insp_pblm_name like '${inspPblmName}%'
  332. </if>
  333. <if test="startTime != null and startTime != ''">and COLL_TIME &gt;= TO_DATE(#{startTime},'YYYY-MM-DD')</if>
  334. <if test="findTime != null and findTime != ''">and COLL_TIME=TO_DATE(#{findTime},'YYYY-MM-DD')</if>
  335. <if test="endTime != null and endTime != ''">and COLL_TIME &lt; TO_DATE(#{endTime},'YYYY-MM-DD')+1</if>
  336. <if test="oides != null and oides != ''">and oid in (${oides})</if>
  337. <if test="regid !=null and regid !=''">
  338. and w.regid=#{regid}
  339. </if>
  340. <if test="recPers !=null and recPers !=''">
  341. and w.rec_Pers=#{recPers}
  342. </if>
  343. <if test="objId !=null and objId !=''">
  344. and w.obj_id=#{objId}
  345. </if>
  346. <if test="groupId !=null and groupId !=''">
  347. and oid like '${groupId}%'
  348. </if>
  349. <if test="adFullName !=null and adFullName !=''">
  350. and w.AD_FULL_NAMe like '%${adFullName}%'
  351. </if>
  352. <if test="persName !=null and persName !=''">
  353. and w.PERS_NAME like '%${persName}%'
  354. </if>
  355. <if test="nm !=null and nm !=''">
  356. and w.NM like '%${nm}%'
  357. </if>
  358. <if test="orgNm !=null and orgNm !=''">
  359. and w.ORG_NM like '%${orgNm}%'
  360. </if>
  361. <if test="hasVedio !=null and hasVedio !=''">
  362. and w.HAS_VEDIO=#{hasVedio}
  363. </if>
  364. <if test="adCode !=null and adCode !=''">
  365. and w.AD_CODE like '${adCode}%'
  366. </if>
  367. order by w.AD_CODE
  368. <if test="orderBy !=null and orderBy !=''">
  369. ,${orderBy}
  370. </if>
  371. </select>
  372. <select id="findPageByType" resultType="cn.com.goldenwater.dcproj.dto.BisNewVillRgstrDto"
  373. parameterType="cn.com.goldenwater.dcproj.param.TypeParam">
  374. select * from (select A.id,A.Nm,A.Code,A.Obj_Id,A.Lgtd,A.Lttd,A.Lgtdpc,A.Lttdpc,
  375. A.pType,CASE WHEN b.state IS NULL THEN '0' ELSE b.state
  376. END AS wtdstState,B.Id as regstr_Id,ad.ad_full_name,al.pnm as groupName,b.intm as c_time
  377. ,to_char(b.intm,'yyyy-MM-dd HH24:mi:ss') as intm,
  378. to_char(b.uptm,'yyyy-MM-dd HH24:mi:ss') as uptm,B.Water_Price_Is_Made,B.WATER_SAFE_OR_PAY
  379. FROM BIS_INSP_ALL_OBJ A
  380. LEFT JOIN BIS_New_VILL_RGSTR B
  381. ON A.OBJ_ID = B.OBJ_ID
  382. left join ATT_AD_X_BASE ad on b.ad_code = ad.ad_code
  383. left join BIS_INSP_ALL al
  384. on A.id=al.id
  385. where
  386. A.Id in (
  387. select distinct id from (
  388. SELECT P.id FROM BIS_INSP_ALL P START WITH P.PID IN (SELECT id FROM BIS_INSP_ALL_RLATION A
  389. WHERE A.PERSID = #{presId} and length(id) in (3,6,9)
  390. <include refid="choseSql"/>
  391. )
  392. CONNECT BY P.PID = PRIOR P.ID
  393. union all
  394. SELECT P.id FROM BIS_INSP_ALL P where p.id in (SELECT id FROM BIS_INSP_ALL_RLATION A
  395. WHERE A.PERSID =#{presId} and length(id)=12
  396. <include refid="choseSql"/>
  397. )
  398. )
  399. )
  400. <if test="tabType =='2'.toString()">
  401. and al.entm &lt;to_date(#{nowTime},'yyyy-MM-dd')+1
  402. </if>
  403. <if test="tabType =='1'.toString()">
  404. and al.entm &gt;=to_date(#{nowTime},'yyyy-MM-dd')
  405. </if>
  406. ) a
  407. where ptype=#{pType}
  408. <if test="plnaId !=null and plnaId !=''">
  409. and a.id like '${plnaId}%'
  410. </if>
  411. <if test="state !=null and state !=''">
  412. and wtdstState in (${state})
  413. </if>
  414. <if test="sttm != null and sttm != '' and entm != null and entm != ''">
  415. AND c_time &gt;= TO_DATE(#{sttm},'YYYY-MM-DD') AND c_time &lt; TO_DATE(#{entm},'YYYY-MM-DD')+1
  416. </if>
  417. <if test="groupId !=null and groupId !=''">
  418. and a.id like '${groupId}%'
  419. </if>
  420. <if test="name !=null and name !=''">
  421. and a.nm like '%${name}%'
  422. </if>
  423. <if test="nm !=null and nm !=''">
  424. and a.nm like '%${nm}%'
  425. </if>
  426. <if test="adName !=null and adName !=''">
  427. and a.ad_full_name like '%${adName}%'
  428. </if>
  429. <if test="rsName !=null and rsName !=''">
  430. and a.nm like '%${rsName}%'
  431. </if>
  432. order by wtdstState asc
  433. <if test="orderBy != null and orderBy != ''">
  434. <!--,${orderBy}-->
  435. ,nlssort(nm,'NLS_SORT=SCHINESE_PINYIN_M')
  436. </if>
  437. </select>
  438. <sql id="choseSql">
  439. <choose>
  440. <when test="province !=null and province !=''">
  441. AND ad_code=#{province}
  442. </when>
  443. <otherwise>
  444. AND ad_code is null
  445. </otherwise>
  446. </choose>
  447. </sql>
  448. <select id="getVill20ByPersId" parameterType="cn.com.goldenwater.dcproj.param.PersObjParam"
  449. resultType="cn.com.goldenwater.dcproj.dto.BisNewWateruserInfoDto">
  450. SELECT A.*,ad.LGTD lgtdPc,ad.LTTD lttdPc,ad.AD_LONG centerXGd,ad.AD_LAT centerYGd,B.Obj_Id
  451. FROM BIS_NEW_WATERUSER_INFO A LEFT JOIN BIS_NEW_VILL_RGSTR B ON A.REGSTR_ID = B.ID
  452. LEFT JOIN BIS_INSP_ALL_OBJ C ON B.OBJ_ID = C.OBJ_ID
  453. LEFT JOIN ATT_AD_X_BASE ad on A.AD_CODE = ad.AD_CODE
  454. WHERE C.PTYPE = #{objType}
  455. AND
  456. <if test="adName != null and adName != ''">and A.VILLAGE_NM LIKE '%${adName}%'</if>
  457. <if test="adCode != null and adCode != ''">and A.AD_CODE LIKE '${adCode}%'</if>
  458. <if test="maxLgtd != null and maxLgtd != '' and minLgtd != null and minLgtd != ''">and ad.LGTD BETWEEN
  459. #{minLgtd} AND #{maxLgtd}
  460. </if>
  461. <if test="maxLttd != null and maxLttd != '' and minLttd != null and minLttd != ''">and ad.LTTD BETWEEN
  462. #{minLttd} AND #{maxLttd}
  463. </if>
  464. <if test="maxcenterXGd != null and maxcenterXGd != '' and mincenterXGd != null and mincenterXGd != ''">and
  465. ad.AD_LONG BETWEEN #{mincenterXGd} AND #{maxcenterXGd}
  466. </if>
  467. <if test="maxcenterYGd != null and maxcenterYGd != '' and mincenterYGd != null and mincenterYGd != ''">and
  468. ad.AD_LAT BETWEEN #{mincenterYGd} AND #{maxcenterYGd}
  469. </if>
  470. </select>
  471. </mapper>