CommunityServiceDaoImplMapper.xml 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595
  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="communityServiceDaoImpl">
  6. <!-- 保存小区信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveBusinessCommunityInfo" parameterType="Map">
  8. insert into business_community(community_id,b_id,name,address,city_code,
  9. nearby_landmarks,map_x,map_y,month,state,operate,community_area)
  10. values(#{communityId},#{bId},#{name},#{address},#{cityCode},
  11. #{nearbyLandmarks},#{mapX},#{mapY},#{month},#{state},#{operate},#{communityArea})
  12. </insert>
  13. <!-- 保存小区属性信息 add by wuxw 2018-07-03 -->
  14. <insert id="saveBusinessCommunityAttr" parameterType="Map">
  15. insert into business_community_attr(b_id,attr_id,community_id,spec_cd,value,month,operate)
  16. values(#{bId},#{attrId},#{communityId},#{specCd},#{value},#{month},#{operate})
  17. </insert>
  18. <!-- 保存小区照片信息 add by wuxw 2018-07-03 -->
  19. <insert id="saveBusinessCommunityPhoto" parameterType="Map">
  20. insert into business_community_photo(community_photo_id,b_id,community_id,community_photo_type_cd,photo,month,operate)
  21. values(#{communityPhotoId},#{bId},#{communityId},#{communityPhotoTypeCd},#{photo},#{month},#{operate})
  22. </insert>
  23. <!-- 查询小区信息(Business) add by wuxw 2018-07-03 -->
  24. <select id="getBusinessCommunityInfo" parameterType="Map" resultType="Map">
  25. select s.community_id,s.b_id,s.name,s.address,s.city_code,s.nearby_landmarks,
  26. s.map_x,s.map_y,s.operate,s.state,s.community_area communityArea,s.community_area
  27. from business_community s where 1 = 1
  28. <if test="operate != null and operate != ''">
  29. and s.operate = #{operate}
  30. </if>
  31. <if test="bId != null and bId !=''">
  32. and s.b_id = #{bId}
  33. </if>
  34. <if test="communityId != null and communityId != ''">
  35. and s.community_id = #{communityId}
  36. </if>
  37. </select>
  38. <!-- 查询小区属性信息(Business) add by wuxw 2018-07-03 -->
  39. <select id="getBusinessCommunityAttrs" parameterType="Map" resultType="Map">
  40. select sa.b_id,sa.attr_id,sa.community_id,sa.spec_cd,sa.value,sa.operate
  41. from business_community_attr sa where 1=1
  42. <if test="operate != null and operate != ''">
  43. and sa.operate = #{operate}
  44. </if>
  45. <if test="bId != null and bId !=''">
  46. and sa.b_id = #{bId}
  47. </if>
  48. <if test="communityId != null and communityId != ''">
  49. and sa.community_id = #{communityId}
  50. </if>
  51. <if test="attrId != null and attrId != ''">
  52. and sa.attr_id = #{attrId}
  53. </if>
  54. </select>
  55. <!-- 查询小区照片信息 add by wuxw 2018-07-03 -->
  56. <select id="getBusinessCommunityPhoto" parameterType="Map" resultType="Map">
  57. select sp.community_photo_id,sp.b_id,sp.community_id,sp.community_photo_type_cd,sp.photo,sp.operate
  58. from business_community_photo sp where 1=1
  59. <if test="bId != null and bId !=''">
  60. and sp.b_id = #{bId}
  61. </if>
  62. <if test="operate != null and operate != ''">
  63. and sp.operate = #{operate}
  64. </if>
  65. <if test="communityId != null and communityId != ''">
  66. and sp.community_id = #{communityId}
  67. </if>
  68. </select>
  69. <!-- 保存小区信息至 instance表中 add by wuxw 2018-07-03 -->
  70. <insert id="saveCommunityInfoInstance" parameterType="Map">
  71. insert into s_community(community_id,b_id,name,address,city_code,nearby_landmarks,map_x,map_y,status_cd,state,community_area)
  72. values(#{community_id},#{b_id},#{name},#{address},#{city_code},#{nearby_landmarks},#{map_x},#{map_y},'0',#{state},#{communityArea})
  73. </insert>
  74. <!-- 保存小区属性信息到 instance add by wuxw 2018-07-03 -->
  75. <insert id="saveCommunityAttrsInstance" parameterType="Map">
  76. insert into s_community_attr(b_id,attr_id,community_id,spec_cd,value,status_cd)
  77. select sa.b_id,sa.attr_id,sa.community_id,sa.spec_cd,sa.value,'0'
  78. from business_community_attr sa
  79. where sa.operate = 'ADD' and sa.b_id=#{bId}
  80. <if test="communityId != null and communityId != ''">
  81. and sa.community_id = #{communityId}
  82. </if>
  83. </insert>
  84. <!-- 保存 小区照片信息 instance add by wuxw 2018-07-03 -->
  85. <insert id="saveCommunityPhotoInstance" parameterType="Map">
  86. insert into s_community_photo(community_photo_id,b_id,community_id,community_photo_type_cd,photo,status_cd)
  87. select sp.community_photo_id,sp.b_id,sp.community_id,sp.community_photo_type_cd,sp.photo,'0'
  88. from business_community_photo sp
  89. where sp.operate = 'ADD' and sp.b_id=#{bId}
  90. <if test="communityId != null and communityId != ''">
  91. and sp.community_id = #{communityId}
  92. </if>
  93. </insert>
  94. <!-- 查询小区信息 add by wuxw 2018-07-03 -->
  95. <select id="getCommunityInfo" parameterType="Map" resultType="Map">
  96. select s.community_id,s.b_id,s.name,s.address,s.city_code,s.nearby_landmarks,s.map_x,s.map_y,s.status_cd,s.state
  97. from s_community s
  98. where 1=1
  99. <if test="statusCd != null and statusCd != ''">
  100. and s.status_cd = #{statusCd}
  101. </if>
  102. <if test="bId != null and bId !=''">
  103. and s.b_id = #{bId}
  104. </if>
  105. <if test="communityId != null and communityId !=''">
  106. and s.community_id = #{communityId}
  107. </if>
  108. </select>
  109. <!-- 查询小区属性信息 add by wuxw 2018-07-03 -->
  110. <select id="getCommunityAttrs" parameterType="Map" resultType="Map">
  111. select sa.b_id,sa.attr_id,sa.community_id,sa.spec_cd,sa.value,sa.status_cd
  112. from s_community_attr sa
  113. where
  114. 1=1
  115. <if test="statusCd != null and statusCd != ''">
  116. and sa.status_cd = #{statusCd}
  117. </if>
  118. <if test="bId != null and bId !=''">
  119. and sa.b_id = #{bId}
  120. </if>
  121. <if test="communityId != null and communityId !=''">
  122. and sa.community_id = #{communityId}
  123. </if>
  124. <if test="communityIds != null ">
  125. and sa.community_id in
  126. <foreach collection="communityIds" item="item" index="index" open="(" close=")" separator=",">
  127. #{item}
  128. </foreach>
  129. </if>
  130. <if test="attrId != null and attrId != ''">
  131. and sa.attr_id = #{attrId}
  132. </if>
  133. </select>
  134. <!-- 查询小区照片信息 add by wuxw 2018-07-03 -->
  135. <select id="getCommunityPhoto" parameterType="Map" resultType="Map">
  136. select sp.community_photo_id,sp.b_id,sp.community_id,sp.community_photo_type_cd,sp.photo,sp.status_cd
  137. from s_community_photo sp
  138. where 1=1
  139. <if test="statusCd != null and statusCd != ''">
  140. and sp.status_cd = #{statusCd}
  141. </if>
  142. <if test="bId != null and bId !=''">
  143. and sp.b_id = #{bId}
  144. </if>
  145. <if test="communityId != null and communityId !=''">
  146. and sp.community_id = #{communityId}
  147. </if>
  148. </select>
  149. <!-- 修改小区信息 add by wuxw 2018-07-03 -->
  150. <update id="updateCommunityInfoInstance" parameterType="Map">
  151. update s_community s set s.status_cd = #{statusCd}
  152. <if test="newBId != null and newBId != ''">
  153. ,s.b_id = #{newBId}
  154. </if>
  155. <if test="name != null and name != ''">
  156. ,s.name = #{name}
  157. </if>
  158. <if test="address != null and address != ''">
  159. ,s.address = #{address}
  160. </if>
  161. <if test="cityCode != null and cityCode != ''">
  162. ,s.city_code = #{cityCode}
  163. </if>
  164. <if test="nearbyLandmarks != null and nearbyLandmarks != ''">
  165. ,s.nearby_landmarks = #{nearbyLandmarks}
  166. </if>
  167. <if test="mapX != null and mapX != ''">
  168. ,s.map_x = #{mapX}
  169. </if>
  170. <if test="mapY != null and mapY != ''">
  171. ,s.map_y = #{mapY}
  172. </if>
  173. <if test="state != null and state != ''">
  174. ,s.state = #{state}
  175. </if>
  176. <if test="communityArea != null and communityArea != ''">
  177. ,s.community_area = #{communityArea}
  178. </if>
  179. where 1=1
  180. <if test="bId != null and bId !=''">
  181. and s.b_id = #{bId}
  182. </if>
  183. <if test="communityId != null and communityId !=''">
  184. and s.community_id = #{communityId}
  185. </if>
  186. </update>
  187. <!-- 修改小区属性信息 add by wuxw 2018-07-03 -->
  188. <update id="updateCommunityAttrInstance" parameterType="Map">
  189. update s_community_attr sa set sa.status_cd = #{statusCd}
  190. <if test="newBId != null and newBId != ''">
  191. ,sa.b_id = #{newBId}
  192. </if>
  193. <if test="value != null and value != ''">
  194. ,sa.value = #{value}
  195. </if>
  196. where 1=1
  197. <if test="bId != null and bId !=''">
  198. and sa.b_id = #{bId}
  199. </if>
  200. <if test="communityId != null and communityId !=''">
  201. and sa.community_id = #{communityId}
  202. </if>
  203. <if test="specCd != null and specCd !=''">
  204. and sa.spec_cd = #{specCd}
  205. </if>
  206. <if test="attrId != null and attrId !=''">
  207. and sa.attr_id = #{attrId}
  208. </if>
  209. </update>
  210. <!-- 修改小区照片信息 add by wuxw 2018-07-03 -->
  211. <update id="updateCommunityPhotoInstance" parameterType="Map">
  212. update s_community_photo sp set sp.status_cd = #{statusCd}
  213. <if test="newBId != null and newBId != ''">
  214. ,sp.b_id = #{newBId}
  215. </if>
  216. <if test="communityPhotoTypeCd != null and communityPhotoTypeCd != ''">
  217. ,sp.community_photo_type_cd = #{communityPhotoTypeCd}
  218. </if>
  219. <if test="photo != null and photo != ''">
  220. ,sp.photo = #{photo}
  221. </if>
  222. where 1=1
  223. <if test="bId != null and bId !=''">
  224. and sp.b_id = #{bId}
  225. </if>
  226. <if test="communityId != null and communityId !=''">
  227. and sp.community_id = #{communityId}
  228. </if>
  229. <if test="communityPhotoId != null and communityPhotoId !=''">
  230. and sp.community_photo_id = #{communityPhotoId}
  231. </if>
  232. </update>
  233. <!--小区成员加入 add by wuxw 2018-10-27 saveBusinessCommunityMember-->
  234. <insert id="saveBusinessCommunityMember" parameterType="Map">
  235. insert into business_community_member(community_member_id,b_id,community_id,member_id,member_type_cd,month,operate,audit_status_cd)
  236. values(#{communityMemberId},#{bId},#{communityId},#{memberId},#{memberTypeCd},#{month},#{operate},#{auditStatusCd})
  237. </insert>
  238. <!-- 小区成员加入 instance表中 add by wuxw 2018-10-27 -->
  239. <insert id="saveCommunityMemberInstance" parameterType="Map">
  240. insert into s_community_member(community_member_id,b_id,community_id,member_id,member_type_cd,status_cd,audit_status_cd)
  241. select ms.community_member_id,ms.b_id,ms.community_id,ms.member_id,ms.member_type_cd,'0',ms.audit_status_cd
  242. from business_community_member ms where
  243. ms.operate = 'ADD' and ms.b_id=#{bId}
  244. <if test="communityId != null and communityId != ''">
  245. and ms.community_id = #{communityId}
  246. </if>
  247. </insert>
  248. <!-- 查询小区成员 add by wuxw 2018-10-27 getBusinessCommunityMember-->
  249. <select id="getBusinessCommunityMember" parameterType="Map" resultType="Map">
  250. select ms.community_member_id,ms.b_id,ms.community_id,ms.member_id,ms.member_type_cd,ms.operate,ms.audit_status_cd
  251. from business_community_member ms where 1 = 1
  252. <if test="operate != null and operate != ''">
  253. and ms.operate = #{operate}
  254. </if>
  255. <if test="bId != null and bId !=''">
  256. and ms.b_id = #{bId}
  257. </if>
  258. <if test="communityId != null and communityId != ''">
  259. and ms.community_id = #{communityId}
  260. </if>
  261. </select>
  262. <!-- 查询小区成员 add by wuxw 2018-07-03 -->
  263. <select id="getCommunityMember" parameterType="Map" resultType="Map">
  264. select ms.community_member_id , ms.b_id,ms.community_id,ms.member_id,ms.member_type_cd,ms.status_cd,ms.audit_status_cd,
  265. ms.community_member_id communityMemberId ,ms.b_id bId,ms.community_id communityId,ms.member_id memberId,ms.member_type_cd memberTypeCd,ms.status_cd statusCd,
  266. ms.audit_status_cd auditStatusCd,
  267. (CASE
  268. WHEN ms.audit_status_cd='1000'
  269. THEN '待审核'
  270. WHEN ms.audit_status_cd = '1100'
  271. THEN '审核完成'
  272. ELSE
  273. '审核拒绝'
  274. END) stateName
  275. <if test="needCommunityInfo == true">
  276. ,sc.name
  277. </if>
  278. from s_community_member ms
  279. <if test="needCommunityInfo == true">
  280. ,s_community sc,
  281. s_community_member msc
  282. </if>
  283. where 1=1
  284. <if test="needCommunityInfo == true">
  285. and sc.`community_id` = ms.`community_id`
  286. AND sc.`status_cd` = '0'
  287. and sc.state='1100'
  288. </if>
  289. <if test="statusCd != null and statusCd != ''">
  290. and ms.status_cd = #{statusCd}
  291. </if>
  292. <if test="bId != null and bId !=''">
  293. and ms.b_id = #{bId}
  294. </if>
  295. <if test="communityMemberId != null and communityMemberId !=''">
  296. and ms.community_member_id = #{communityMemberId}
  297. </if>
  298. <if test="memberId != null and memberId != '' and needCommunityInfo == true">
  299. AND ms.`community_id` = msc.`community_id`
  300. and msc.member_id = #{memberId}
  301. and msc.status_cd = '0'
  302. </if>
  303. <if test="memberId != null and memberId != '' and needCommunityInfo == false">
  304. and ms.member_id = #{memberId}
  305. </if>
  306. <if test="subMemberId != null and subMemberId != ''">
  307. and ms.member_id = #{subMemberId}
  308. </if>
  309. <if test="noAuditEnterCommunity == true">
  310. and ms.member_type_cd not in ('390001200003','390001200005','390001200000')
  311. </if>
  312. <if test="memberTypeCd != null and memberTypeCd != ''">
  313. and ms.member_type_cd = #{memberTypeCd}
  314. </if>
  315. <if test="auditStatusCd != null and auditStatusCd != ''">
  316. and ms.audit_status_cd = #{auditStatusCd}
  317. </if>
  318. <if test="communityId != null and communityId != ''">
  319. and ms.community_id = #{communityId}
  320. </if>
  321. <if test="communityName != null and communityName != '' and needCommunityInfo == true">
  322. and sc.name like concat('%',#{communityName},'%')
  323. </if>
  324. <if test="needCommunityInfo == true">
  325. group by ms.community_id
  326. </if>
  327. order by ms.create_time desc
  328. <if test="page != -1 and page != null">
  329. limit #{page},#{row}
  330. </if>
  331. </select>
  332. <!-- 修改小区成员 add by wuxw 2018-07-03 -->
  333. <update id="updateCommunityMemberInstance" parameterType="Map">
  334. update s_community_member ms set ms.status_cd = #{statusCd}
  335. <if test="newBId != null and newBId != ''">
  336. ,ms.b_id = #{newBId}
  337. </if>
  338. <if test="auditStatusCd !=null and auditStatusCd !=''">
  339. ,ms.audit_status_cd = #{auditStatusCd}
  340. </if>
  341. where 1=1
  342. <if test="bId != null and bId !=''">
  343. and ms.b_id = #{bId}
  344. </if>
  345. <if test="communityMemberId != null and communityMemberId !=''">
  346. and ms.community_member_id = #{communityMemberId}
  347. </if>
  348. </update>
  349. <!-- 查询小区成员 add by wuxw 2018-07-03 -->
  350. <select id="getCommunityMemberCount" parameterType="Map" resultType="Map">
  351. select ms.community_id,count(1) count
  352. from s_community_member ms
  353. <if test="needCommunityInfo == true">
  354. ,s_community sc,
  355. s_community_member msc
  356. </if>
  357. where 1=1
  358. <if test="needCommunityInfo == true">
  359. and sc.`community_id` = ms.`community_id`
  360. AND sc.`status_cd` = '0'
  361. and sc.state='1100'
  362. </if>
  363. <if test="statusCd != null and statusCd != ''">
  364. and ms.status_cd = #{statusCd}
  365. </if>
  366. <if test="bId != null and bId !=''">
  367. and ms.b_id = #{bId}
  368. </if>
  369. <if test="communityMemberId != null and communityMemberId !=''">
  370. and ms.community_member_id = #{communityMemberId}
  371. </if>
  372. <if test="memberId != null and memberId != '' and needCommunityInfo == true">
  373. AND ms.`community_id` = msc.`community_id`
  374. and msc.member_id = #{memberId}
  375. and msc.status_cd = '0'
  376. </if>
  377. <if test="memberId != null and memberId != '' and needCommunityInfo == false">
  378. and ms.member_id = #{memberId}
  379. </if>
  380. <if test="subMemberId != null and subMemberId != ''">
  381. and ms.member_id = #{subMemberId}
  382. </if>
  383. <if test="noAuditEnterCommunity == true">
  384. and ms.member_type_cd not in ('390001200003','390001200005','390001200000')
  385. </if>
  386. <if test="memberTypeCd != null and memberTypeCd != ''">
  387. and ms.member_type_cd = #{memberTypeCd}
  388. </if>
  389. <if test="auditStatusCd != null and auditStatusCd != ''">
  390. and ms.audit_status_cd = #{auditStatusCd}
  391. </if>
  392. <if test="auditStatusCds != null and auditStatusCds != null">
  393. and ms.audit_status_cd in
  394. <foreach collection="auditStatusCds" item="item" open="(" close=")" separator=",">
  395. #{item}
  396. </foreach>
  397. </if>
  398. <if test="communityId != null and communityId != ''">
  399. and ms.community_id = #{communityId}
  400. </if>
  401. <if test="communityName != null and communityName != '' and needCommunityInfo == true">
  402. and sc.name like concat('%',#{communityName},'%')
  403. </if>
  404. <if test="needCommunityInfo == true">
  405. group by ms.community_id
  406. </if>
  407. </select>
  408. <!-- 查询小区信息 add by wuxw 2018-07-03 -->
  409. <select id="getCommunityInfoNew" parameterType="Map" resultType="Map">
  410. select t.address,t.nearby_landmarks,t.nearby_landmarks nearbyLandmarks,
  411. t.city_code,t.city_code cityCode,t.name,t.status_cd,t.status_cd statusCd,
  412. t.community_id,t.community_id communityId,t.b_id,t.b_id bId,t.map_y,t.map_y mapY,
  413. t.map_x,t.map_x mapX,t.state,(CASE
  414. WHEN t.state='1000'
  415. THEN '待审核'
  416. WHEN t.state = '1100'
  417. THEN '审核完成'
  418. ELSE
  419. '审核拒绝'
  420. END) stateName,ca.area_code areaCode,ca.area_name areaName,
  421. ca.parent_area_code parentAreaCode,ca.parent_area_name parentAreaName,
  422. t.community_area communityArea
  423. from s_community t,city_area ca
  424. <if test="memberId !=null and memberId !=''">
  425. ,s_community_member cm
  426. </if>
  427. where 1 =1
  428. and t.city_code = ca.area_code
  429. and ca.status_cd = '0'
  430. <if test="address !=null and address != ''">
  431. and t.address= #{address}
  432. </if>
  433. <if test="nearbyLandmarks !=null and nearbyLandmarks != ''">
  434. and t.nearby_landmarks= #{nearbyLandmarks}
  435. </if>
  436. <if test="cityCode !=null and cityCode != ''">
  437. and t.city_code= #{cityCode}
  438. </if>
  439. <if test="name !=null and name != ''">
  440. and t.name like concat('%',#{name},'%')
  441. </if>
  442. <if test="statusCd !=null and statusCd != ''">
  443. and t.status_cd= #{statusCd}
  444. </if>
  445. <if test="communityId !=null and communityId != ''">
  446. and t.community_id= #{communityId}
  447. </if>
  448. <if test="communityIds !=null">
  449. and t.community_id in
  450. <foreach collection="communityIds" item="item" open="(" close=")" separator=",">
  451. #{item}
  452. </foreach>
  453. </if>
  454. <if test="bId !=null and bId != ''">
  455. and t.b_id= #{bId}
  456. </if>
  457. <if test="mapY !=null and mapY != ''">
  458. and t.map_y= #{mapY}
  459. </if>
  460. <if test="mapX !=null and mapX != ''">
  461. and t.map_x= #{mapX}
  462. </if>
  463. <if test="state !=null and state != ''">
  464. and t.state= #{state}
  465. </if>
  466. <if test="memberId !=null and memberId !=''">
  467. and cm.community_id = t.community_id
  468. and cm.member_id = #{memberId}
  469. and cm.status_cd = '0'
  470. </if>
  471. <if test="memberId !=null and memberId !='' and auditStatusCd != null and auditStatusCd !=''">
  472. and cm.audit_status_cd = #{auditStatusCd}
  473. </if>
  474. <if test="notInCommunityId != null ">
  475. and t.community_id not in
  476. <foreach collection="notInCommunityId" item="item" open="(" close=")" separator=",">
  477. #{item}
  478. </foreach>
  479. </if>
  480. group by t.community_id
  481. <if test="page != -1 and page != null ">
  482. limit #{page}, #{row}
  483. </if>
  484. </select>
  485. <!-- 查询小区数量 add by wuxw 2018-07-03 -->
  486. <select id="queryCommunitysCount" parameterType="Map" resultType="Map">
  487. select count(DISTINCT(t.community_id)) count
  488. from s_community t,city_area ca
  489. <if test="memberId !=null and memberId !=''">
  490. ,s_community_member cm
  491. </if>
  492. where 1 =1
  493. and t.city_code = ca.area_code
  494. and ca.status_cd = '0'
  495. <if test="address !=null and address != ''">
  496. and t.address= #{address}
  497. </if>
  498. <if test="nearbyLandmarks !=null and nearbyLandmarks != ''">
  499. and t.nearby_landmarks= #{nearbyLandmarks}
  500. </if>
  501. <if test="cityCode !=null and cityCode != ''">
  502. and t.city_code= #{cityCode}
  503. </if>
  504. <if test="name !=null and name != ''">
  505. and t.name like concat('%',#{name},'%')
  506. </if>
  507. <if test="statusCd !=null and statusCd != ''">
  508. and t.status_cd= #{statusCd}
  509. </if>
  510. <if test="communityId !=null and communityId != ''">
  511. and t.community_id= #{communityId}
  512. </if>
  513. <if test="communityIds !=null">
  514. and t.community_id in
  515. <foreach collection="communityIds" item="item" open="(" close=")" separator=",">
  516. #{item}
  517. </foreach>
  518. </if>
  519. <if test="bId !=null and bId != ''">
  520. and t.b_id= #{bId}
  521. </if>
  522. <if test="mapY !=null and mapY != ''">
  523. and t.map_y= #{mapY}
  524. </if>
  525. <if test="mapX !=null and mapX != ''">
  526. and t.map_x= #{mapX}
  527. </if>
  528. <if test="state !=null and state != ''">
  529. and t.state= #{state}
  530. </if>
  531. <if test="memberId !=null and memberId !=''">
  532. and cm.community_id = t.community_id
  533. and cm.member_id = #{memberId}
  534. and cm.status_cd = '0'
  535. </if>
  536. <if test="memberId !=null and memberId !='' and auditStatusCd != null and auditStatusCd !=''">
  537. and cm.audit_status_cd = #{auditStatusCd}
  538. </if>
  539. <if test="notInCommunityId != null ">
  540. and t.community_id not in
  541. <foreach collection="notInCommunityId" item="item" open="(" close=")" separator=",">
  542. #{item}
  543. </foreach>
  544. </if>
  545. </select>
  546. </mapper>