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