ShopServiceDaoImplMapper.xml 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622
  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="shopServiceDaoImpl">
  6. <!-- 保存商品信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveBusinessShopInfo" parameterType="Map">
  8. insert into business_shop(shop_id,b_id,catalog_id,store_id,name,hot_buy,sale_price,open_shop_count,shop_count,start_date,end_date,month,operate)
  9. values(#{shopId},#{bId},#{catalogId},#{storeId},#{name},#{hotBuy},#{salePrice},#{openShopCount},#{shopCount},#{startDate},#{endDate},#{month},#{operate})
  10. </insert>
  11. <!-- 保存商品属性信息 add by wuxw 2018-07-03 -->
  12. <insert id="saveBusinessShopAttr" parameterType="Map">
  13. insert into business_shop_attr(b_id,attr_id,shop_id,spec_cd,value,month,operate)
  14. values(#{bId},#{attrId},#{shopId},#{specCd},#{value},#{month},#{operate})
  15. </insert>
  16. <insert id="saveBusinessShopAttrParam" parameterType="Map">
  17. insert into business_shop_attr_param(attr_param_id,b_id,shop_id,spec_cd,param,month,operate)
  18. values(#{attrParamId},#{bId},#{shopId},#{specCd},#{param},#{month},#{operate})
  19. </insert>
  20. <!-- 保存商品照片信息 add by wuxw 2018-07-03 -->
  21. <insert id="saveBusinessShopPhoto" parameterType="Map">
  22. insert into business_shop_photo(shop_photo_id,b_id,shop_id,shop_photo_type_cd,photo,month,operate)
  23. values(#{shopPhotoId},#{bId},#{shopId},#{shopPhotoTypeCd},#{photo},#{month},#{operate})
  24. </insert>
  25. <!-- 保存商品优惠信息 add by wuxw 2018-07-03 -->
  26. <insert id="saveBusinessShopPreferential" parameterType="Map">
  27. insert into business_shop_preferential(shop_preferential_id,b_id,shop_id,original_price,discount_rate,show_original_price,preferential_start_date,preferential_end_date,month,operate)
  28. values(#{shopPreferentialId},#{bId},#{shopId},#{originalPrice},#{discountRate},#{showOriginalPrice},#{preferentialStartDate},#{preferentialEndDate},#{month},#{operate})
  29. </insert>
  30. <insert id="saveBusinessShopDesc" parameterType="Map">
  31. insert into business_shop_desc(shop_desc_id,shop_id,b_id,shop_describe,month,operate)
  32. values(#{shopDescId},#{shopId},#{bId},#{shopDescribe},#{month},#{operate})
  33. </insert>
  34. <!-- 商品目录 add by wuxw 2018-07-08 -->
  35. <insert id="saveBusinessShopCatalog" parameterType="Map">
  36. insert into business_shop_catalog(catalog_id,b_id,store_id,name,level,parent_catalog_id,month,operate)
  37. values(#{catalogId},#{bId},#{storeId},#{name},#{level},#{parentCatalogId},#{month},#{operate})
  38. </insert>
  39. <!-- 查询商品信息(Business) add by wuxw 2018-07-03 -->
  40. <select id="getBusinessShopInfo" parameterType="Map" resultType="Map">
  41. select s.shop_id,s.b_id,s.catalog_id,s.store_id,s.name,s.hot_buy,s.sale_price,s.open_shop_count,s.shop_count,s.start_date,s.end_date,s.operate
  42. from business_shop s where 1 = 1
  43. <if test="operate != null and operate != ''">
  44. and s.operate = #{operate}
  45. </if>
  46. <if test="bId != null and bId !=''">
  47. and s.b_id = #{bId}
  48. </if>
  49. <if test="shopId != null and shopId != ''">
  50. and s.shop_id = #{shopId}
  51. </if>
  52. </select>
  53. <!-- 查询商品属性信息(Business) add by wuxw 2018-07-03 -->
  54. <select id="getBusinessShopAttrs" parameterType="Map" resultType="Map">
  55. select sa.b_id,sa.attr_id,sa.shop_id,sa.spec_cd,sa.value,sa.operate
  56. from business_shop_attr sa where 1=1
  57. <if test="operate != null and operate != ''">
  58. and sa.operate = #{operate}
  59. </if>
  60. <if test="bId != null and bId !=''">
  61. and sa.b_id = #{bId}
  62. </if>
  63. <if test="shopId != null and shopId != ''">
  64. and sa.shop_id = #{shopId}
  65. </if>
  66. <if test="attrId != null and attrId != ''">
  67. and sa.attr_id = #{attrId}
  68. </if>
  69. </select>
  70. <!-- 查询 商品 属性参数 add by wuxw 2018-07-03 -->
  71. <select id="getBusinessShopAttrParams" parameterType="Map" resultType="Map">
  72. select sap.attr_param_id,sap.b_id,sap.shop_id,sap.spec_cd,sap.param,sap.operate
  73. from business_shop_attr_param sap where 1=1
  74. <if test="operate != null and operate != ''">
  75. and sap.operate = #{operate}
  76. </if>
  77. <if test="bId != null and bId !=''">
  78. and sap.b_id = #{bId}
  79. </if>
  80. <if test="shopId != null and shopId != ''">
  81. and sa.shop_id = #{shopId}
  82. </if>
  83. <if test="attrParamId != null and attrParamId != ''">
  84. and sa.attr_param_id = #{attrParamId}
  85. </if>
  86. </select>
  87. <!-- 查询商品照片信息 add by wuxw 2018-07-03 -->
  88. <select id="getBusinessShopPhoto" parameterType="Map" resultType="Map">
  89. select sp.shop_photo_id,sp.b_id,sp.shop_id,sp.shop_photo_type_cd,sp.photo,sp.operate
  90. from business_shop_photo sp where 1=1
  91. <if test="bId != null and bId !=''">
  92. and sp.b_id = #{bId}
  93. </if>
  94. <if test="operate != null and operate != ''">
  95. and sp.operate = #{operate}
  96. </if>
  97. <if test="shopId != null and shopId != ''">
  98. and sp.shop_id = #{shopId}
  99. </if>
  100. </select>
  101. <!-- 查询商品 证件信息 add by wuxw 2018-07-03 -->
  102. <select id="getBusinessShopPreferential" parameterType="Map" resultType="Map">
  103. select sp.shop_preferential_id,sp.b_id,sc.shop_id,sp.original_price,sp.discount_rate,sp.show_original_price,sp.preferential_start_date,sp.preferential_end_date,sp.operate
  104. from business_shop_preferential sp where 1 = 1
  105. <if test="bId != null and bId !=''">
  106. and sp.b_id = #{bId}
  107. </if>
  108. <if test="operate != null and operate != ''">
  109. and sp.operate = #{operate}
  110. </if>
  111. <if test="shopId != null and shopId != ''">
  112. and sp.shop_id = #{shopId}
  113. </if>
  114. </select>
  115. <!-- 查询商品 描述信息 add by wuxw 2018-07-03 -->
  116. <select id="getBusinessShopDesc" parameterType="Map" resultType="Map">
  117. select sd.shop_desc_id,sd.b_id,sd.shop_id,sd.shop_describe,sd.operate
  118. from business_shop_desc sd where 1 = 1
  119. <if test="bId != null and bId !=''">
  120. and sd.b_id = #{bId}
  121. </if>
  122. <if test="operate != null and operate != ''">
  123. and sd.operate = #{operate}
  124. </if>
  125. <if test="shopId != null and shopId != ''">
  126. and sd.shop_id = #{shopId}
  127. </if>
  128. </select>
  129. <!-- 查询商品目录(business) add by wuxw 2018-07-03 -->
  130. <select id="getBusinessShopCatalog" parameterType="Map" resultType="Map">
  131. select sc.catalog_id,sc.b_id,sc.store_id,sc.name,sc.level,sc.parent_catalog_id,sc.operate
  132. from business_shop_catalog sc where 1=1
  133. <if test="bId != null and bId !=''">
  134. and sc.b_id = #{bId}
  135. </if>
  136. <if test="operate != null and operate != ''">
  137. and sc.operate = #{operate}
  138. </if>
  139. <if test="shopId != null and shopId != ''">
  140. and sc.store_id = #{storeId}
  141. </if>
  142. </select>
  143. <!-- 保存商品信息至 instance表中 add by wuxw 2018-07-03 -->
  144. <insert id="saveShopInfoInstance" parameterType="Map">
  145. insert into s_shop(shop_id,b_id,catalog_id,store_id,name,hot_buy,sale_price,open_shop_count,shop_count,start_date,end_date,status_cd)
  146. select s.shop_id,s.b_id,s.catalog_id,s.store_id,s.name,s.hot_buy,s.sale_price,s.open_shop_count,s.shop_count,s.start_date,s.end_date,'0'
  147. from business_shop s where
  148. s.operate = 'ADD' and s.b_id=#{bId}
  149. </insert>
  150. <!-- 保存商品属性信息到 instance add by wuxw 2018-07-03 -->
  151. <insert id="saveShopAttrsInstance" parameterType="Map">
  152. insert into s_shop_attr(b_id,attr_id,shop_id,spec_cd,value,status_cd)
  153. select sa.b_id,sa.attr_id,sa.shop_id,sa.spec_cd,sa.value,'0'
  154. from business_shop_attr sa
  155. where sa.operate = 'ADD' and sa.b_id=#{bId}
  156. </insert>
  157. <!-- 保存商品属性参数 instance add by wuxw 2018-07-07 -->
  158. <insert id="saveShopAttrParamsInstance" parameterType="Map">
  159. insert into s_shop_attr_param(attr_param_id,b_id,shop_id,spec_cd,param,status_cd)
  160. select sap.attr_param_id,sap.b_id,sap.shop_id,sap.spec_cd,sap.param,'0'
  161. from business_shop_attr_param sa
  162. where sa.operate = 'ADD' and sa.b_id=#{bId}
  163. </insert>
  164. <!-- 保存 商品照片信息 instance add by wuxw 2018-07-03 -->
  165. <insert id="saveShopPhotoInstance" parameterType="Map">
  166. insert into s_shop_photo(shop_photo_id,b_id,shop_id,shop_photo_type_cd,photo,status_cd)
  167. select sp.shop_photo_id,sp.b_id,sp.shop_id,sp.shop_photo_type_cd,sp.photo,'0'
  168. from business_shop_photo sp
  169. where sp.operate = 'ADD' and sp.b_id=#{bId}
  170. </insert>
  171. <!-- 保存 商品证件信息 instance add by wuxw 2018-07-03 -->
  172. <insert id="saveShopPreferentialInstance" parameterType="Map">
  173. insert into s_shop_preferential(shop_preferential_id,b_id,shop_id,original_price,discount_rate,show_original_price,preferential_start_date,preferential_end_date,status_cd)
  174. select sp.shop_preferential_id,sp.b_id,sc.shop_id,sp.original_price,sp.discount_rate,sp.show_original_price,sp.preferential_start_date,sp.preferential_end_date,'0'
  175. from business_shop_preferential sp
  176. where sp.operate = 'ADD' and sp.b_id=#{bId}
  177. </insert>
  178. <!-- 保存 商品描述信息 instance add by wuxw 2018-07-03 -->
  179. <insert id="saveShopDescInstance" parameterType="Map">
  180. insert into s_shop_desc(shop_desc_id,b_id,shop_id,shop_describe,status_cd)
  181. select sd.shop_desc_id,sd.b_id,sd.shop_id,sd.shop_describe,'0'
  182. from business_shop_desc sd
  183. where sd.operate = 'ADD' and sd.b_id=#{bId}
  184. </insert>
  185. <!-- 保存 商品目录 信息 instance add by wuxw 2018-07-08 -->
  186. <insert id="saveShopCatalogInstance" parameterType="Map">
  187. insert into s_shop_catalog(catalog_id,b_id,store_id,name,level,parent_catalog_id,status_cd)
  188. select sc.catalog_id,sc.b_id,sc.store_id,sc.name,sc.level,sc.parent_catalog_id,'0'
  189. from business_shop_catalog sc
  190. where sc.operate = 'ADD' and sc.b_id=#{bId}
  191. </insert>
  192. <!-- 商品购买记录 保存 add by wuxw 2018-07-08 -->
  193. <insert id="saveBuyShopInstance" parameterType="Map">
  194. insert into s_buy_shop(buy_id,b_id,shop_id,buy_count,month,status_cd)
  195. values(#{buyId},#{bId},#{shopId},#{buyCount},#{month},'0')
  196. </insert>
  197. <!-- 保存购买记录属性 add by wuxw 2018-07-08 -->
  198. <insert id="saveBuyShopAttrInstance" parameterType="Map">
  199. insert into s_buy_shop_attr(buy_id,b_id,attr_id,spec_cd,value,month,status_cd)
  200. values(#{buyId},#{bId},#{attrId},#{specCd},#{value},#{month},'0')
  201. </insert>
  202. <!-- 查询商品信息 add by wuxw 2018-07-03 -->
  203. <select id="getShopInfo" parameterType="Map" resultType="Map">
  204. select s.shop_id,s.b_id,s.catalog_id,s.store_id,s.name,s.hot_buy,s.sale_price,s.open_shop_count,s.shop_count,s.start_date,s.end_date,s.status_cd
  205. from s_shop s
  206. where 1=1
  207. <if test="statusCd != null and statusCd != ''">
  208. and s.status_cd = #{statusCd}
  209. </if>
  210. <if test="bId != null and bId !=''">
  211. and s.b_id = #{bId}
  212. </if>
  213. <if test="shopId != null and shopId !=''">
  214. and s.shop_id = #{shopId}
  215. </if>
  216. </select>
  217. <!-- 查询商品属性信息 add by wuxw 2018-07-03 -->
  218. <select id="getShopAttrs" parameterType="Map" resultType="Map">
  219. select sa.b_id,sa.attr_id,sa.shop_id,sa.spec_cd,sa.value,sa.status_cd
  220. from s_shop_attr sa
  221. where
  222. 1=1
  223. <if test="statusCd != null and statusCd != ''">
  224. and sa.status_cd = #{statusCd}
  225. </if>
  226. <if test="bId != null and bId !=''">
  227. and sa.b_id = #{bId}
  228. </if>
  229. <if test="shopId != null and shopId !=''">
  230. and sa.shop_id = #{shopId}
  231. </if>
  232. <if test="attrId != null and attrId != ''">
  233. and sa.attr_id = #{attrId}
  234. </if>
  235. </select>
  236. <!-- 查询商品属性参数信息 add by wuxw 2018-07-06 -->
  237. <select id="getShopAttrParams" parameterType="Map" resultType="Map">
  238. select sap.attr_param_id,sap.b_id,sap.shop_id,sap.spec_cd,sap.param,sap.status_cd
  239. from s_shop_attr_param sap
  240. where
  241. 1=1
  242. <if test="statusCd != null and statusCd != ''">
  243. and sap.status_cd = #{statusCd}
  244. </if>
  245. <if test="bId != null and bId !=''">
  246. and sap.b_id = #{bId}
  247. </if>
  248. <if test="shopId != null and shopId !=''">
  249. and sap.shop_id = #{shopId}
  250. </if>
  251. <if test="attrParamId != null and attrParamId != ''">
  252. and sap.attr_param_id = #{attrParamId}
  253. </if>
  254. </select>
  255. <!-- 查询商品照片信息 add by wuxw 2018-07-03 -->
  256. <select id="getShopPhoto" parameterType="Map" resultType="Map">
  257. select sp.shop_photo_id,sp.b_id,sp.shop_id,sp.shop_photo_type_cd,sp.photo,sp.status_cd
  258. from s_shop_photo sp
  259. where 1=1
  260. <if test="statusCd != null and statusCd != ''">
  261. and sp.status_cd = #{statusCd}
  262. </if>
  263. <if test="bId != null and bId !=''">
  264. and sp.b_id = #{bId}
  265. </if>
  266. <if test="shopId != null and shopId !=''">
  267. and sp.shop_id = #{shopId}
  268. </if>
  269. </select>
  270. <!-- 查询商品证件信息 add by wuxw 2018-07-03 -->
  271. <select id="getShopPreferential" parameterType="Map" resultType="Map">
  272. select sp.shop_preferential_id,sp.b_id,sc.shop_id,sp.original_price,sp.discount_rate,sp.show_original_price,sp.preferential_start_date,sp.preferential_end_date,sc.status_cd
  273. from s_shop_preferential sp
  274. where 1=1
  275. <if test="statusCd != null and statusCd != ''">
  276. and sp.status_cd = #{statusCd}
  277. </if>
  278. <if test="bId != null and bId !=''">
  279. and sp.b_id = #{bId}
  280. </if>
  281. <if test="shopId != null and shopId !=''">
  282. and sp.shop_id = #{shopId}
  283. </if>
  284. </select>
  285. <!-- 查询商品证件信息 add by wuxw 2018-07-03 -->
  286. <select id="getShopDesc" parameterType="Map" resultType="Map">
  287. select sd.shop_desc_id,sd.b_id,sd.shop_id,sd.shop_describe,sd.status_cd
  288. from s_shop_desc sd
  289. where 1=1
  290. <if test="statusCd != null and statusCd != ''">
  291. and sd.status_cd = #{statusCd}
  292. </if>
  293. <if test="bId != null and bId !=''">
  294. and sd.b_id = #{bId}
  295. </if>
  296. <if test="shopId != null and shopId !=''">
  297. and sd.shop_id = #{shopId}
  298. </if>
  299. </select>
  300. <!-- 查询商品目录 instance add by wuxw 2018-07-08 -->
  301. <select id="getShopCatalog" parameterType="Map" resultType="Map">
  302. select sc.catalog_id,sc.b_id,sc.store_id,sc.name,sc.level,sc.parent_catalog_id,sc.status_cd
  303. from s_shop_catalog sc
  304. where 1=1
  305. <if test="statusCd != null and statusCd != ''">
  306. and sd.status_cd = #{statusCd}
  307. </if>
  308. <if test="bId != null and bId !=''">
  309. and sd.b_id = #{bId}
  310. </if>
  311. <if test="catalogId != null and catalogId !=''">
  312. and sd.catalog_id = #{catalogId}
  313. </if>
  314. </select>
  315. <!-- 查询商品目录 instance add by wuxw 2018-07-08 -->
  316. <select id="getBuyShop" parameterType="Map" resultType="Map">
  317. select bs.buy_id,bs.b_id,bs.shop_id,bs.buy_count,bs.month,bs.status_cd
  318. from s_buy_shop bs
  319. where 1=1
  320. <if test="statusCd != null and statusCd != ''">
  321. and bs.status_cd = #{statusCd}
  322. </if>
  323. <if test="bId != null and bId !=''">
  324. and bs.b_id = #{bId}
  325. </if>
  326. <if test="buyId != null and buyId !=''">
  327. and bs.buy_id = #{buyId}
  328. </if>
  329. </select>
  330. <!-- 查询购买记录属性信息 add by wuxw 2018-07-03 -->
  331. <select id="getBuyShopAttrs" parameterType="Map" resultType="Map">
  332. select bs.b_id,bs.attr_id,bs.buy_id,bs.spec_cd,bs.value,bs.status_cd
  333. from s_buy_shop_attr bs
  334. where
  335. 1=1
  336. <if test="statusCd != null and statusCd != ''">
  337. and bs.status_cd = #{statusCd}
  338. </if>
  339. <if test="bId != null and bId !=''">
  340. and bs.b_id = #{bId}
  341. </if>
  342. <if test="buyId != null and buyId !=''">
  343. and bs.buy_id = #{buyId}
  344. </if>
  345. <if test="attrId != null and attrId != ''">
  346. and bs.attr_id = #{attrId}
  347. </if>
  348. </select>
  349. <!-- 修改商品信息 add by wuxw 2018-07-03 -->
  350. <update id="updateShopInfoInstance" parameterType="Map">
  351. update s_shop s set s.status_cd = #{statusCd}
  352. <if test="newBId != null and newBId != ''">
  353. ,s.b_id = #{newBId}
  354. </if>
  355. <if test="storeId != null and storeId != ''">
  356. ,s.store_id = #{storeId}
  357. </if>
  358. <if test="catalogId != null and catalogId != ''">
  359. ,s.catalog_id = #{catalogId}
  360. </if>
  361. <if test="name != null and name != ''">
  362. ,s.name = #{name}
  363. </if>
  364. <if test="hotBuy != null and hotBuy != ''">
  365. ,s.hot_buy = #{hotBuy}
  366. </if>
  367. <if test="salePrice != null and salePrice != ''">
  368. ,s.sale_price = #{salePrice}
  369. </if>
  370. <if test="openShopCount != null and openShopCount != ''">
  371. ,s.open_shop_count = #{openShopCount}
  372. </if>
  373. <if test="shopCount != null and shopCount != ''">
  374. ,s.shop_count = #{shopCount}
  375. </if>
  376. <if test="startDate != null and startDate != ''">
  377. ,s.start_date = #{startDate}
  378. </if>
  379. <if test="endDate != null and endDate != ''">
  380. ,s.end_date = #{endDate}
  381. </if>
  382. where 1=1
  383. <if test="bId != null and bId !=''">
  384. and s.b_id = #{bId}
  385. </if>
  386. <if test="shopId != null and shopId !=''">
  387. and s.shop_id = #{shopId}
  388. </if>
  389. </update>
  390. <!-- 修改商品属性信息 add by wuxw 2018-07-03 -->
  391. <update id="updateShopAttrInstance" parameterType="Map">
  392. update s_shop_attr sa set sa.status_cd = #{statusCd}
  393. <if test="newBId != null and newBId != ''">
  394. ,sa.b_id = #{newBId}
  395. </if>
  396. <if test="value != null and value != ''">
  397. ,sa.value = #{value}
  398. </if>
  399. where 1=1
  400. <if test="bId != null and bId !=''">
  401. and sa.b_id = #{bId}
  402. </if>
  403. <if test="shopId != null and shopId !=''">
  404. and sa.shop_id = #{shopId}
  405. </if>
  406. <if test="specCd != null and specCd !=''">
  407. and sa.spec_cd = #{specCd}
  408. </if>
  409. <if test="attrId != null and attrId !=''">
  410. and sa.attr_id = #{attrId}
  411. </if>
  412. </update>
  413. <!-- 修改商品属性参数信息 add by wuxw 2018-07-03 -->
  414. <update id="updateShopAttrParamInstance" parameterType="Map">
  415. update s_shop_attr_param sap set sap.status_cd = #{statusCd}
  416. <if test="newBId != null and newBId != ''">
  417. ,sap.b_id = #{newBId}
  418. </if>
  419. <if test="param != null and param != ''">
  420. ,sap.param = #{param}
  421. </if>
  422. where 1=1
  423. <if test="bId != null and bId !=''">
  424. and sap.b_id = #{bId}
  425. </if>
  426. <if test="shopId != null and shopId !=''">
  427. and sap.shop_id = #{shopId}
  428. </if>
  429. <if test="specCd != null and specCd !=''">
  430. and sap.spec_cd = #{specCd}
  431. </if>
  432. <if test="attrParamId != null and attrParamId !=''">
  433. and sap.attr_param_id = #{attrParamId}
  434. </if>
  435. </update>
  436. <!-- 修改商品照片信息 add by wuxw 2018-07-03 -->
  437. <update id="updateShopPhotoInstance" parameterType="Map">
  438. update s_shop_photo sp set sp.status_cd = #{statusCd}
  439. <if test="newBId != null and newBId != ''">
  440. ,sp.b_id = #{newBId}
  441. </if>
  442. <if test="shopPhotoTypeCd != null and shopPhotoTypeCd != ''">
  443. ,sp.shop_photo_type_cd = #{shopPhotoTypeCd}
  444. </if>
  445. <if test="photo != null and photo != ''">
  446. ,sp.photo = #{photo}
  447. </if>
  448. where 1=1
  449. <if test="bId != null and bId !=''">
  450. and sp.b_id = #{bId}
  451. </if>
  452. <if test="shopId != null and shopId !=''">
  453. and sp.shop_id = #{shopId}
  454. </if>
  455. <if test="shopPhotoId != null and shopPhotoId !=''">
  456. and sp.shop_photo_id = #{shopPhotoId}
  457. </if>
  458. </update>
  459. <!-- 修改商品优惠信息 add by wuxw 2018-07-03 -->
  460. <update id="updateShopPreferentialInstance" parameterType="Map">
  461. update s_shop_preferential sp set sp.status_cd = #{statusCd}
  462. <if test="newBId != null and newBId != ''">
  463. ,sp.b_id = #{newBId}
  464. </if>
  465. <if test="originalPrice != null and originalPrice != ''">
  466. ,sp.original_price = #{originalPrice}
  467. </if>
  468. <if test="discountRate != null and discountRate != ''">
  469. ,sp.discount_rate = #{discountRate}
  470. </if>
  471. <if test="showOriginalPrice != null and showOriginalPrice != ''">
  472. ,sp.show_original_price = #{showOriginalPrice}
  473. </if>
  474. <if test="preferentialStartDate != null ">
  475. ,sp.preferential_start_date = #{preferentialStartDate}
  476. </if>
  477. <if test="preferentialEndDate != null ">
  478. ,sp.preferential_end_date = #{preferentialEndDate}
  479. </if>
  480. where 1=1
  481. <if test="bId != null and bId !=''">
  482. and sp.b_id = #{bId}
  483. </if>
  484. <if test="shopId != null and shopId !=''">
  485. and sp.shop_id = #{shopId}
  486. </if>
  487. <if test="shopPreferentialId != null and shopPreferentialId !=''">
  488. and sp.shop_preferential_id = #{shopPreferentialId}
  489. </if>
  490. </update>
  491. <!-- 修改商品优惠信息 add by wuxw 2018-07-03 -->
  492. <update id="updateShopDescInstance" parameterType="Map">
  493. update s_shop_desc sd set sd.status_cd = #{statusCd}
  494. <if test="newBId != null and newBId != ''">
  495. ,sd.b_id = #{newBId}
  496. </if>
  497. <if test="shopDescribe != null and shopDescribe != ''">
  498. ,sd.shop_describe = #{shopDescribe}
  499. </if>
  500. where 1=1
  501. <if test="bId != null and bId !=''">
  502. and sd.b_id = #{bId}
  503. </if>
  504. <if test="shopId != null and shopId !=''">
  505. and sd.shop_id = #{shopId}
  506. </if>
  507. <if test="shopDescId != null and shopDescId !=''">
  508. and sd.shop_desc_id = #{shopDescId}
  509. </if>
  510. </update>
  511. <!-- 修改 商品目录信息 add by wuxw 2018-07-08 -->
  512. <update id="updateShopCatalogInstance" parameterType="Map">
  513. update s_shop_catalog sc set sc.status_cd = #{statusCd}
  514. <if test="newBId != null and newBId != ''">
  515. ,sc.b_id = #{newBId}
  516. </if>
  517. <if test="name != null and name != ''">
  518. ,sc.name = #{name}
  519. </if>
  520. <if test="level != null and level != ''">
  521. ,sc.level = #{level}
  522. </if>
  523. <if test="parentCatalogId != null and parentCatalogId != ''">
  524. ,sc.parent_catalog_id = #{parentCatalogId}
  525. </if>
  526. where 1=1
  527. <if test="bId != null and bId !=''">
  528. and sc.b_id = #{bId}
  529. </if>
  530. <if test="storeId != null and storeId !=''">
  531. and sc.store_id = #{storeId}
  532. </if>
  533. <if test="catalogId != null and catalogId !=''">
  534. and sc.catalog_id = #{catalogId}
  535. </if>
  536. </update>
  537. <!-- 修改 商品购买信息 add by wuxw 2018-07-08 -->
  538. <update id="updateBuyShopInstance" parameterType="Map">
  539. update s_buy_shop bs set bs.status_cd = #{statusCd}
  540. <if test="newBId != null and newBId != ''">
  541. ,bs.b_id = #{newBId}
  542. </if>
  543. <if test="buyCount != null and buyCount != ''">
  544. ,bs.buy_count = #{buy_count}
  545. </if>
  546. where 1=1
  547. <if test="bId != null and bId !=''">
  548. and bs.b_id = #{bId}
  549. </if>
  550. <if test="shopId != null and shopId !=''">
  551. and bs.shop_id = #{shopId}
  552. </if>
  553. <if test="buyId != null and buyId !=''">
  554. and bs.buy_id = #{buyId}
  555. </if>
  556. </update>
  557. <!-- 修改商品属性信息 add by wuxw 2018-07-03 -->
  558. <update id="updateBuyShopAttrInstance" parameterType="Map">
  559. update s_buy_shop_attr bsa set bsa.status_cd = #{statusCd}
  560. <if test="newBId != null and newBId != ''">
  561. ,bsa.b_id = #{newBId}
  562. </if>
  563. <if test="value != null and value != ''">
  564. ,bsa.value = #{value}
  565. </if>
  566. where 1=1
  567. <if test="bId != null and bId !=''">
  568. and bsa.b_id = #{bId}
  569. </if>
  570. <if test="buyId != null and buyId !=''">
  571. and bsa.buy_id = #{buyId}
  572. </if>
  573. <if test="specCd != null and specCd !=''">
  574. and bsa.spec_cd = #{specCd}
  575. </if>
  576. <if test="attrId != null and attrId !=''">
  577. and bsa.attr_id = #{attrId}
  578. </if>
  579. </update>
  580. </mapper>