StoreServiceDaoImplMapper.xml 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563
  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="storeServiceDaoImpl">
  6. <!-- 保存商户信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveBusinessStoreInfo" parameterType="Map">
  8. insert into
  9. business_store(store_id,b_id,user_id,name,address,tel,store_type_cd,nearby_landmarks,map_x,map_y,month,operate)
  10. values(#{storeId},#{bId},#{userId},#{name},#{address},#{tel},#{storeTypeCd},#{nearbyLandmarks},#{mapX},#{mapY},#{month},#{operate})
  11. </insert>
  12. <!-- 保存商户属性信息 add by wuxw 2018-07-03 -->
  13. <insert id="saveBusinessStoreAttr" parameterType="Map">
  14. insert into business_store_attr(b_id,attr_id,store_id,spec_cd,value,month,operate)
  15. values(#{bId},#{attrId},#{storeId},#{specCd},#{value},#{month},#{operate})
  16. </insert>
  17. <!-- 保存商户照片信息 add by wuxw 2018-07-03 -->
  18. <insert id="saveBusinessStorePhoto" parameterType="Map">
  19. insert into business_store_photo(store_photo_id,b_id,store_id,store_photo_type_cd,photo,month,operate)
  20. values(#{storePhotoId},#{bId},#{storeId},#{storePhotoTypeCd},#{photo},#{month},#{operate})
  21. </insert>
  22. <!-- 保存商户证件信息 add by wuxw 2018-07-03 -->
  23. <insert id="saveBusinessStoreCerdentials" parameterType="Map">
  24. insert into
  25. business_store_cerdentials(store_cerdentials_id,b_id,store_id,credentials_cd,value,validity_period,positive_photo,negative_photo,month,operate)
  26. values(#{storeCerdentialsId},#{bId},#{storeId},#{credentialsCd},#{value},#{validityPeriod},#{positivePhoto},#{negativePhoto},#{month},#{operate})
  27. </insert>
  28. <!-- 查询商户信息(Business) add by wuxw 2018-07-03 -->
  29. <select id="getBusinessStoreInfo" parameterType="Map" resultType="Map">
  30. select
  31. s.store_id,s.b_id,s.user_id,s.name,s.address,s.tel,s.store_type_cd,s.nearby_landmarks,s.map_x,s.map_y,s.operate
  32. from business_store s where 1 = 1
  33. <if test="operate != null and operate != ''">
  34. and s.operate = #{operate}
  35. </if>
  36. <if test="bId != null and bId !=''">
  37. and s.b_id = #{bId}
  38. </if>
  39. <if test="storeId != null and storeId != ''">
  40. and s.store_id = #{storeId}
  41. </if>
  42. </select>
  43. <!-- 查询商户属性信息(Business) add by wuxw 2018-07-03 -->
  44. <select id="getBusinessStoreAttrs" parameterType="Map" resultType="Map">
  45. select sa.b_id,sa.attr_id,sa.store_id,sa.spec_cd,sa.value,sa.operate
  46. from business_store_attr sa where 1=1
  47. <if test="operate != null and operate != ''">
  48. and sa.operate = #{operate}
  49. </if>
  50. <if test="bId != null and bId !=''">
  51. and sa.b_id = #{bId}
  52. </if>
  53. <if test="storeId != null and storeId != ''">
  54. and sa.store_id = #{storeId}
  55. </if>
  56. <if test="attrId != null and attrId != ''">
  57. and sa.attr_id = #{attrId}
  58. </if>
  59. </select>
  60. <!-- 查询商户照片信息 add by wuxw 2018-07-03 -->
  61. <select id="getBusinessStorePhoto" parameterType="Map" resultType="Map">
  62. select sp.store_photo_id,sp.b_id,sp.store_id,sp.store_photo_type_cd,sp.photo,sp.operate
  63. from business_store_photo sp where 1=1
  64. <if test="bId != null and bId !=''">
  65. and sp.b_id = #{bId}
  66. </if>
  67. <if test="operate != null and operate != ''">
  68. and sp.operate = #{operate}
  69. </if>
  70. <if test="storeId != null and storeId != ''">
  71. and sp.store_id = #{storeId}
  72. </if>
  73. </select>
  74. <!-- 查询商户 证件信息 add by wuxw 2018-07-03 -->
  75. <select id="getBusinessStoreCerdentials" parameterType="Map" resultType="Map">
  76. select
  77. sc.store_cerdentials_id,sc.b_id,sc.store_id,sc.credentials_cd,sc.value,sc.validity_period,sc.positive_photo,sc.negative_photo,sc.operate
  78. from business_store_cerdentials sc where 1 = 1
  79. <if test="bId != null and bId !=''">
  80. and sc.b_id = #{bId}
  81. </if>
  82. <if test="operate != null and operate != ''">
  83. and sc.operate = #{operate}
  84. </if>
  85. <if test="storeId != null and storeId != ''">
  86. and sc.store_id = #{storeId}
  87. </if>
  88. </select>
  89. <!-- 保存商户信息至 instance表中 add by wuxw 2018-07-03 -->
  90. <insert id="saveStoreInfoInstance" parameterType="Map">
  91. insert into s_store(store_id,b_id,user_id,name,address,tel,store_type_cd,nearby_landmarks,map_x,map_y,status_cd)
  92. select s.store_id,s.b_id,s.user_id,s.name,s.address,s.tel,s.store_type_cd,s.nearby_landmarks,s.map_x,s.map_y,'0'
  93. from business_store s where
  94. s.operate = 'ADD' and s.b_id=#{bId}
  95. </insert>
  96. <!-- 保存商户属性信息到 instance add by wuxw 2018-07-03 -->
  97. <insert id="saveStoreAttrsInstance" parameterType="Map">
  98. insert into s_store_attr(b_id,attr_id,store_id,spec_cd,value,status_cd)
  99. select sa.b_id,sa.attr_id,sa.store_id,sa.spec_cd,sa.value,'0'
  100. from business_store_attr sa
  101. where sa.operate = 'ADD' and sa.b_id=#{bId}
  102. </insert>
  103. <!-- 保存 商户照片信息 instance add by wuxw 2018-07-03 -->
  104. <insert id="saveStorePhotoInstance" parameterType="Map">
  105. insert into s_store_photo(store_photo_id,b_id,store_id,store_photo_type_cd,photo,status_cd)
  106. select sp.store_photo_id,sp.b_id,sp.store_id,sp.store_photo_type_cd,sp.photo,'0'
  107. from business_store_photo sp
  108. where sp.operate = 'ADD' and sp.b_id=#{bId}
  109. </insert>
  110. <!-- 保存 商户证件信息 instance add by wuxw 2018-07-03 -->
  111. <insert id="saveStoreCerdentialsInstance" parameterType="Map">
  112. insert into
  113. s_store_cerdentials(store_cerdentials_id,b_id,store_id,credentials_cd,value,validity_period,positive_photo,negative_photo,status_cd)
  114. select
  115. sc.store_cerdentials_id,sc.b_id,sc.store_id,sc.credentials_cd,sc.value,sc.validity_period,sc.positive_photo,sc.negative_photo,'0'
  116. from business_store_cerdentials sc
  117. where sc.operate = 'ADD' and sc.b_id=#{bId}
  118. </insert>
  119. <!-- 查询商户信息 add by wuxw 2018-07-03 -->
  120. <select id="getStoreInfo" parameterType="Map" resultType="Map">
  121. select s.store_id,s.store_id storeId,
  122. s.b_id,
  123. s.user_id,
  124. s.name,
  125. s.address,
  126. s.tel,
  127. s.store_type_cd,
  128. s.nearby_landmarks,
  129. s.map_x,s.map_y,
  130. s.status_cd
  131. from s_store s
  132. where 1=1
  133. <if test="statusCd != null and statusCd != ''">
  134. and s.status_cd = #{statusCd}
  135. </if>
  136. <if test="bId != null and bId !=''">
  137. and s.b_id = #{bId}
  138. </if>
  139. <if test="storeId != null and storeId !=''">
  140. and s.store_id = #{storeId}
  141. </if>
  142. </select>
  143. <!-- 查询商户属性信息 add by wuxw 2018-07-03 -->
  144. <select id="getStoreAttrs" parameterType="Map" resultType="Map">
  145. select sa.b_id,sa.attr_id,sa.attr_id attrId,sa.store_id, sa.store_id storeId,sa.spec_cd,sa.spec_cd
  146. specCd,sa.value,sa.status_cd
  147. from s_store_attr sa
  148. where
  149. 1=1
  150. <if test="statusCd != null and statusCd != ''">
  151. and sa.status_cd = #{statusCd}
  152. </if>
  153. <if test="bId != null and bId !=''">
  154. and sa.b_id = #{bId}
  155. </if>
  156. <if test="storeId != null and storeId !=''">
  157. and sa.store_id = #{storeId}
  158. </if>
  159. <if test="storeIds != null">
  160. and sa.store_id in
  161. <foreach collection="storeIds" open="(" close=")"
  162. separator="," item="item">
  163. #{item}
  164. </foreach>
  165. </if>
  166. <if test="specCd != null and specCd !=''">
  167. and sa.spec_cd = #{specCd}
  168. </if>
  169. <if test="attrId != null and attrId != ''">
  170. and sa.attr_id = #{attrId}
  171. </if>
  172. </select>
  173. <!-- 查询商户照片信息 add by wuxw 2018-07-03 -->
  174. <select id="getStorePhoto" parameterType="Map" resultType="Map">
  175. select sp.store_photo_id,sp.b_id,sp.store_id,sp.store_photo_type_cd,sp.photo,sp.status_cd
  176. from s_store_photo sp
  177. where 1=1
  178. <if test="statusCd != null and statusCd != ''">
  179. and sp.status_cd = #{statusCd}
  180. </if>
  181. <if test="bId != null and bId !=''">
  182. and sp.b_id = #{bId}
  183. </if>
  184. <if test="storeId != null and storeId !=''">
  185. and sp.store_id = #{storeId}
  186. </if>
  187. </select>
  188. <!-- 查询商户证件信息 add by wuxw 2018-07-03 -->
  189. <select id="getStoreCerdentials" parameterType="Map" resultType="Map">
  190. select
  191. sc.store_cerdentials_id,sc.b_id,sc.store_id,sc.credentials_cd,sc.value,sc.validity_period,sc.positive_photo,sc.negative_photo,sc.status_cd
  192. from s_store_cerdentials sc
  193. where 1=1
  194. <if test="statusCd != null and statusCd != ''">
  195. and sc.status_cd = #{statusCd}
  196. </if>
  197. <if test="bId != null and bId !=''">
  198. and sc.b_id = #{bId}
  199. </if>
  200. <if test="storeId != null and storeId !=''">
  201. and sc.store_id = #{storeId}
  202. </if>
  203. </select>
  204. <!-- 修改商户信息 add by wuxw 2018-07-03 -->
  205. <update id="updateStoreInfoInstance" parameterType="Map">
  206. update s_store s set s.status_cd = #{statusCd}
  207. <if test="newBId != null and newBId != ''">
  208. ,s.b_id = #{newBId}
  209. </if>
  210. <if test="userId != null and userId != ''">
  211. ,s.user_id = #{userId}
  212. </if>
  213. <if test="name != null and name != ''">
  214. ,s.name = #{name}
  215. </if>
  216. <if test="address != null and address != ''">
  217. ,s.address = #{address}
  218. </if>
  219. <if test="tel != null and tel != ''">
  220. ,s.tel = #{tel}
  221. </if>
  222. <if test="storeTypeCd != null and storeTypeCd != ''">
  223. ,s.store_type_cd = #{storeTypeCd}
  224. </if>
  225. <if test="nearbyLandmarks != null and nearbyLandmarks != ''">
  226. ,s.nearby_landmarks = #{nearbyLandmarks}
  227. </if>
  228. <if test="mapX != null and mapX != ''">
  229. ,s.map_x = #{mapX}
  230. </if>
  231. <if test="mapY != null and mapY != ''">
  232. ,s.map_y = #{mapY}
  233. </if>
  234. where 1=1
  235. <if test="bId != null and bId !=''">
  236. and s.b_id = #{bId}
  237. </if>
  238. <if test="storeId != null and storeId !=''">
  239. and s.store_id = #{storeId}
  240. </if>
  241. </update>
  242. <!-- 修改商户属性信息 add by wuxw 2018-07-03 -->
  243. <update id="updateStoreAttrInstance" parameterType="Map">
  244. update s_store_attr sa set sa.status_cd = #{statusCd}
  245. <if test="newBId != null and newBId != ''">
  246. ,sa.b_id = #{newBId}
  247. </if>
  248. <if test="value != null and value != ''">
  249. ,sa.value = #{value}
  250. </if>
  251. where 1=1
  252. <if test="bId != null and bId !=''">
  253. and sa.b_id = #{bId}
  254. </if>
  255. <if test="storeId != null and storeId !=''">
  256. and sa.store_id = #{storeId}
  257. </if>
  258. <if test="specCd != null and specCd !=''">
  259. and sa.spec_cd = #{specCd}
  260. </if>
  261. <if test="attrId != null and attrId !=''">
  262. and sa.attr_id = #{attrId}
  263. </if>
  264. </update>
  265. <!-- 修改商户照片信息 add by wuxw 2018-07-03 -->
  266. <update id="updateStorePhotoInstance" parameterType="Map">
  267. update s_store_photo sp set sp.status_cd = #{statusCd}
  268. <if test="newBId != null and newBId != ''">
  269. ,sp.b_id = #{newBId}
  270. </if>
  271. <if test="storePhotoTypeCd != null and storePhotoTypeCd != ''">
  272. ,sp.store_photo_type_cd = #{storePhotoTypeCd}
  273. </if>
  274. <if test="photo != null and photo != ''">
  275. ,sp.photo = #{photo}
  276. </if>
  277. where 1=1
  278. <if test="bId != null and bId !=''">
  279. and sp.b_id = #{bId}
  280. </if>
  281. <if test="storeId != null and storeId !=''">
  282. and sp.store_id = #{storeId}
  283. </if>
  284. <if test="storePhotoId != null and storePhotoId !=''">
  285. and sp.store_photo_id = #{storePhotoId}
  286. </if>
  287. </update>
  288. <!-- 修改商户证件信息 add by wuxw 2018-07-03 -->
  289. <update id="updateStoreCerdentailsInstance" parameterType="Map">
  290. update s_store_cerdentials sc set sc.status_cd = #{statusCd}
  291. <if test="newBId != null and newBId != ''">
  292. ,sc.b_id = #{newBId}
  293. </if>
  294. <if test="credentialsCd != null and credentialsCd != ''">
  295. ,sc.credentials_cd = #{credentialsCd}
  296. </if>
  297. <if test="value != null and value != ''">
  298. ,sc.value = #{value}
  299. </if>
  300. <if test="validityPeriod != null">
  301. ,sc.validity_period = #{validityPeriod}
  302. </if>
  303. <if test="positivePhoto != null and positivePhoto != ''">
  304. ,sc.positive_photo = #{positivePhoto}
  305. </if>
  306. <if test="negativePhoto != null and negativePhoto != ''">
  307. ,sc.negative_photo = #{negativePhoto}
  308. </if>
  309. where 1=1
  310. <if test="bId != null and bId !=''">
  311. and sc.b_id = #{bId}
  312. </if>
  313. <if test="storeId != null and storeId !=''">
  314. and sc.store_id = #{storeId}
  315. </if>
  316. <if test="storeCerdentialsId != null and storeCerdentialsId !=''">
  317. and sc.store_cerdentials_id = #{storeCerdentialsId}
  318. </if>
  319. </update>
  320. <!--商户成员加入 add by wuxw 2018-10-27 saveBusinessMemberStore-->
  321. <insert id="saveBusinessMemberStore" parameterType="Map">
  322. insert into business_member_store(member_store_id,b_id,store_id,member_id,month,operate)
  323. values(#{memberStoreId},#{bId},#{storeId},#{memberId},#{month},#{operate})
  324. </insert>
  325. <!-- 商户成员加入 instance表中 add by wuxw 2018-10-27 -->
  326. <insert id="saveMemberStoreInstance" parameterType="Map">
  327. insert into s_member_store(member_store_id,b_id,store_id,member_id,status_cd)
  328. select ms.member_store_id,ms.b_id,ms.store_id,ms.member_id,'0'
  329. from business_member_store ms where
  330. ms.operate = 'ADD' and ms.b_id=#{bId}
  331. </insert>
  332. <!-- 查询商户成员 add by wuxw 2018-10-27 getBusinessMemberStore-->
  333. <select id="getBusinessMemberStore" parameterType="Map" resultType="Map">
  334. select ms.member_store_id,ms.b_id,ms.store_id,ms.member_id,ms.operate
  335. from business_member_store ms where 1 = 1
  336. <if test="operate != null and operate != ''">
  337. and ms.operate = #{operate}
  338. </if>
  339. <if test="bId != null and bId !=''">
  340. and ms.b_id = #{bId}
  341. </if>
  342. <if test="storeId != null and storeId != ''">
  343. and ms.store_id = #{storeId}
  344. </if>
  345. </select>
  346. <!-- 查询商户成员 add by wuxw 2018-07-03 -->
  347. <select id="getMemberStore" parameterType="Map" resultType="Map">
  348. select ms.member_store_id,ms.b_id,ms.store_id,ms.member_id,ms.status_cd
  349. from business_member_store ms
  350. where 1=1
  351. <if test="statusCd != null and statusCd != ''">
  352. and ms.status_cd = #{statusCd}
  353. </if>
  354. <if test="bId != null and bId !=''">
  355. and ms.b_id = #{bId}
  356. </if>
  357. <if test="storeId != null and storeId !=''">
  358. and ms.member_store_id = #{memberStoreId}
  359. </if>
  360. </select>
  361. <!-- 修改商户成员 add by wuxw 2018-07-03 -->
  362. <update id="updateMemberStoreInstance" parameterType="Map">
  363. update s_member_store ms set ms.status_cd = #{statusCd}
  364. <if test="newBId != null and newBId != ''">
  365. ,ms.b_id = #{newBId}
  366. </if>
  367. where 1=1
  368. <if test="bId != null and bId !=''">
  369. and ms.b_id = #{bId}
  370. </if>
  371. <if test="memberStoreId != null and memberStoreId !=''">
  372. and ms.member_store_id = #{memberStoreId}
  373. </if>
  374. </update>
  375. <!-- 保存物业用户信息 add by wuxw 2018-07-03 -->
  376. <insert id="saveBusinessStoreUser" parameterType="Map">
  377. insert into business_store_user(store_user_id,b_id,store_id,user_id,rel_cd,month,operate)
  378. values(#{storeUserId},#{bId},#{storeId},#{userId},#{relCd},#{month},#{operate})
  379. </insert>
  380. <!-- 查询物业 用户信息 add by wuxw 2018-07-03 -->
  381. <select id="getBusinessStoreUser" parameterType="Map" resultType="Map">
  382. select sc.store_user_id,sc.b_id,sc.store_id,sc.user_id,sc.rel_cd,sc.operate
  383. from business_store_user sc where 1 = 1
  384. <if test="bId != null and bId !=''">
  385. and sc.b_id = #{bId}
  386. </if>
  387. <if test="operate != null and operate != ''">
  388. and sc.operate = #{operate}
  389. </if>
  390. <if test="storeId != null and storeId != ''">
  391. and sc.store_id = #{storeId}
  392. </if>
  393. </select>
  394. <!-- 保存 商户用户信息 instance add by wuxw 2018-07-03 -->
  395. <insert id="saveStoreUserInstance" parameterType="Map">
  396. insert into s_store_user(store_user_id,b_id,store_id,user_id,rel_cd,status_cd)
  397. select sc.store_user_id,sc.b_id,sc.store_id,sc.user_id,sc.rel_cd,'0'
  398. from business_store_user sc
  399. where sc.operate = 'ADD' and sc.b_id=#{bId}
  400. </insert>
  401. <!-- 查询商户证件信息 add by wuxw 2018-07-03 -->
  402. <select id="getStoreUser" parameterType="Map" resultType="Map">
  403. select sc.store_user_id,sc.b_id,sc.store_id,sc.user_id,sc.rel_cd,sc.status_cd
  404. from s_store_user sc
  405. where 1=1
  406. <if test="statusCd != null and statusCd != ''">
  407. and sc.status_cd = #{statusCd}
  408. </if>
  409. <if test="bId != null and bId !=''">
  410. and sc.b_id = #{bId}
  411. </if>
  412. <if test="storeId != null and storeId !=''">
  413. and sc.store_id = #{storeId}
  414. </if>
  415. <if test="userId != null and userId !=''">
  416. and sc.user_id = #{userId}
  417. </if>
  418. </select>
  419. <!-- 修改商户用户信息 add by wuxw 2018-07-03 -->
  420. <update id="updateStoreUserInstance" parameterType="Map">
  421. update s_store_user sc set sc.status_cd = #{statusCd}
  422. <if test="newBId != null and newBId != ''">
  423. ,sc.b_id = #{newBId}
  424. </if>
  425. <if test="relCd != null and relCd != ''">
  426. ,sc.rel_cd = #{relCd}
  427. </if>
  428. where 1=1
  429. <if test="bId != null and bId !=''">
  430. and sc.b_id = #{bId}
  431. </if>
  432. <if test="storeId != null and storeId !=''">
  433. and sc.store_id = #{storeId}
  434. </if>
  435. <if test="storeUserId != null and storeUserId !=''">
  436. and sc.store_user_id = #{storeUserId}
  437. </if>
  438. </update>
  439. <!-- 查询商户 -->
  440. <select id="getStores" parameterType="Map" resultType="Map">
  441. select
  442. s.store_id,
  443. s.b_id,
  444. s.user_id,
  445. s.name,s.name storeName,
  446. s.address,
  447. s.tel,
  448. s.store_id storeId,
  449. s.store_type_cd,s.store_type_cd storeTypeCd,
  450. s.nearby_landmarks,s.nearby_landmarks nearByLandmarks,
  451. s.map_x,s.map_x mapX,
  452. s.map_y,s.map_y mapY,
  453. s.status_cd,
  454. st.name storeTypeName
  455. from s_store s,store_type st
  456. where s.status_cd = '0'
  457. and s.store_type_cd = st.store_type_cd
  458. <if test="userId != null and userId != ''">
  459. and s.user_id = #{userId}
  460. </if>
  461. <if test="name != null and name !=''">
  462. and s.name like concat('%',#{name},'%')
  463. </if>
  464. <if test="address != null and address != ''">
  465. and s.address like concat('%',#{address},'%')
  466. </if>
  467. <if test="tel != null and tel != ''">
  468. and s.tel = #{tel}
  469. </if>
  470. <if test="storeTypeCd != null and storeTypeCd != ''">
  471. and s.store_type_cd = #{storeTypeCd}
  472. </if>
  473. <if test="nearbyLandmarks != null and nearbyLandmarks != ''">
  474. and s.nearby_landmarks = #{nearbyLandmarks}
  475. </if>
  476. <if test="storeId != null and storeId !=''">
  477. and s.store_id = #{storeId}
  478. </if>
  479. <if test="storeIds !=null">
  480. and s.store_id in
  481. <foreach collection="storeIds" open="(" close=")"
  482. separator="," item="item">
  483. #{item}
  484. </foreach>
  485. </if>
  486. order by s.create_time desc
  487. <if test="page != -1 and page != null ">
  488. limit #{page}, #{row}
  489. </if>
  490. </select>
  491. <!-- 查询商户 -->
  492. <select id="getStoreCount" parameterType="Map" resultType="Map">
  493. select count(1) count
  494. from s_store s,store_type st
  495. where s.status_cd = '0'
  496. and s.store_type_cd = st.store_type_cd
  497. <if test="userId != null and userId != ''">
  498. and s.user_id = #{userId}
  499. </if>
  500. <if test="name != null and name !=''">
  501. and s.name like concat('%',#{name},'%')
  502. </if>
  503. <if test="address != null and address != ''">
  504. and s.address like concat('%',#{address},'%')
  505. </if>
  506. <if test="tel != null and tel != ''">
  507. and s.tel = #{tel}
  508. </if>
  509. <if test="storeTypeCd != null and storeTypeCd != ''">
  510. and s.store_type_cd = #{storeTypeCd}
  511. </if>
  512. <if test="nearbyLandmarks != null and nearbyLandmarks != ''">
  513. and s.nearby_landmarks = #{nearbyLandmarks}
  514. </if>
  515. <if test="storeId != null and storeId !=''">
  516. and s.store_id = #{storeId}
  517. </if>
  518. <if test="storeIds !=null">
  519. and s.store_id in
  520. <foreach collection="storeIds" open="(" close=")"
  521. separator="," item="item">
  522. #{item}
  523. </foreach>
  524. </if>
  525. </select>
  526. </mapper>