From e2e3cff11fcf974f0c8d8e371808cc5459bc5a54 Mon Sep 17 00:00:00 2001 From: xhxu Date: Thu, 13 Jul 2023 18:44:08 +0800 Subject: [PATCH] //..coupon --- ...3071200001_marketingMangage_permission.sql | 8 + .../db/migration/V2023071200002_coupon.sql | 801 ++++++++++++++++++ .../controller/WxCouponController.java | 2 - .../java/com/iformall/domain/po/WxCoupon.java | 9 +- .../com/iformall/enums/EnumCouponVersion.java | 43 + .../com/iformall/mapper/WxCouponMapper.java | 5 +- .../service/impl/WxCouponServiceImpl.java | 5 +- .../main/resources/mapper/WxCouponMapper.xml | 126 ++- .../mapper/WxCouponPasswordMapper.xml | 2 +- 9 files changed, 944 insertions(+), 57 deletions(-) create mode 100644 mallinkAdmin/src/main/resources/db/migration/V2023071200001_marketingMangage_permission.sql create mode 100644 mallinkAdmin/src/main/resources/db/migration/V2023071200002_coupon.sql create mode 100644 mallinkService/src/main/java/com/iformall/enums/EnumCouponVersion.java diff --git a/mallinkAdmin/src/main/resources/db/migration/V2023071200001_marketingMangage_permission.sql b/mallinkAdmin/src/main/resources/db/migration/V2023071200001_marketingMangage_permission.sql new file mode 100644 index 000000000..17e37485b --- /dev/null +++ b/mallinkAdmin/src/main/resources/db/migration/V2023071200001_marketingMangage_permission.sql @@ -0,0 +1,8 @@ +INSERT INTO `mallink`.`mall_permission`(`id`, `name`, `parent_id`, `available`, `permission`, `resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`, `sort`) VALUES (424, '抖音分账对账统计', 416, 'Y', NULL, 1, NULL, NULL, 'marketingMangage', NULL, 0, 412); + + +UPDATE `mallink`.`mall_sale_type` SET `menus` = '[1, 2, 4, 5, 6, 50, 105, 110, 201, 205, 202, 210, 211, 212, 221, 222, 223, 224, 251, 261, 409, 410, 411, 416, 424, 502, 504, 505, 506, 507, 511, 512, 521, 522, 523, 591, 592, 595, 601, 602, 605, 606, 610, 612, 615, 622, 647, 676, 680, 711, 901, 902, 904, 907, 5502, 61202, 61501, 61502]' WHERE `id` = 11; +UPDATE `mallink`.`mall_sale_type` SET `menus` = '[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 50, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 201, 202, 203, 204, 205, 206, 209, 210, 211, 212, 221, 222, 223, 224, 225, 251, 261, 299, 300, 301, 302, 303, 304, 305, 306, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 420, 421, 422, 423, 424, 431, 432, 502, 503, 504, 505, 506, 507, 508, 509, 511, 512, 513, 514, 521, 522, 523, 531, 532, 533, 591, 592, 595, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 615, 616, 621, 622, 623, 624, 625, 626, 627, 641, 642, 643, 644, 645, 646, 647, 651, 652, 653, 661, 662, 663, 664, 665, 666, 671, 672, 673, 674, 675, 676, 680, 681, 682, 683, 684, 685, 687, 691, 692, 693, 694, 695, 701, 702, 703, 704, 711, 713, 714, 715, 901, 902, 903, 904, 905, 906, 907, 908, 910, 931, 932, 951, 952, 961, 962, 963, 965, 966, 967, 968, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 5502, 6610, 6611, 41701, 41702, 60701, 60702, 61201, 61202, 61501, 61502]' WHERE `id` = 12; +UPDATE `mallink`.`mall_sale_type` SET `menus` = '[1, 2, 4, 5, 6, 50, 105, 110, 201, 205, 202, 210, 211, 212, 221, 222, 223, 224, 226, 251, 261, 409, 410, 411, 416, 424, 502, 504, 505, 506, 507, 511, 512, 521, 522, 523, 591, 592, 595, 601, 602, 605, 606, 610, 612, 615, 622, 676, 680, 711, 716, 901, 902, 904, 907, 5502, 60201, 61202, 61501, 61502]' WHERE `id` = 13; +UPDATE `mallink`.`mall_sale_type` SET `menus` = '[1, 2, 4, 5, 6, 50, 105, 110, 201, 205, 202, 210, 211, 212, 221, 222, 223, 224, 251, 261, 409, 410, 411, 416, 424, 504, 505, 506, 507, 511, 512, 521, 522, 523, 591, 592, 595, 601, 602, 605, 606, 610, 612, 615, 622, 647, 650, 676, 680, 711, 901, 902, 904, 907, 5502, 41001, 60202, 61202, 61501, 61502, 71101]' WHERE `id` = 102; +UPDATE `mallink`.`mall_sale_type` SET `menus` = '[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 50, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 201, 202, 203, 204, 205, 206, 209, 210, 211, 212, 221, 222, 225, 223, 224, 251, 261, 299, 300, 307, 308, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 420, 421, 422, 423, 424, 431, 432, 502, 503, 504, 505, 506, 507, 508, 509, 511, 512, 513, 514, 521, 522, 523, 531, 532, 533, 591, 592, 595, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 615, 616, 621, 622, 623, 624, 625, 626, 627, 641, 642, 643, 644, 645, 646, 647, 651, 652, 653, 661, 662, 663, 664, 665, 666, 671, 672, 673, 674, 675, 676, 680, 681, 682, 683, 684, 685, 687, 691, 692, 693, 694, 695, 701, 702, 703, 704, 711, 713, 714, 715, 901, 902, 903, 904, 905, 906, 907, 908, 910, 931, 932, 951, 952, 961, 962, 963, 965, 966, 967, 968, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 5502, 6610, 6611, 41701, 41702, 60701, 60702, 61201, 61202, 61501, 61502]' WHERE `id` = 103500103610; diff --git a/mallinkAdmin/src/main/resources/db/migration/V2023071200002_coupon.sql b/mallinkAdmin/src/main/resources/db/migration/V2023071200002_coupon.sql new file mode 100644 index 000000000..1383f3249 --- /dev/null +++ b/mallinkAdmin/src/main/resources/db/migration/V2023071200002_coupon.sql @@ -0,0 +1,801 @@ +ALTER TABLE `mallink`.`wx_coupon_0` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_0 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_0` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_1` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_1 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_1` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_2` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_2 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_2` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_3` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_3 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_3` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_4` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_4 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_4` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_5` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_5 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_5` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_6` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_6 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_6` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_7` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_7 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_7` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_8` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_8 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_8` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_9` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_9 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_9` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_10` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_10 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_10` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_11` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_11 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_11` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_12` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_12 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_12` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_13` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_13 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_13` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_14` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_14 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_14` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_15` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_15 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_15` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_16` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_16 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_16` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_17` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_17 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_17` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_18` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_18 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_18` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_19` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_19 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_19` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_20` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_20 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_20` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_21` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_21 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_21` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_22` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_22 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_22` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_23` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_23 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_23` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_24` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_24 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_24` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_25` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_25 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_25` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_26` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_26 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_26` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_27` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_27 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_27` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_28` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_28 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_28` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_29` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_29 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_29` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_30` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_30 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_30` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_31` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_31 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_31` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_32` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_32 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_32` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_33` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_33 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_33` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_34` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_34 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_34` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_35` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_35 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_35` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_36` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_36 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_36` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_37` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_37 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_37` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_38` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_38 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_38` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_39` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_39 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_39` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_40` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_40 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_40` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_41` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_41 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_41` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_42` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_42 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_42` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_43` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_43 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_43` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_44` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_44 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_44` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_45` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_45 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_45` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_46` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_46 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_46` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_47` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_47 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_47` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_48` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_48 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_48` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_49` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_49 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_49` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_50` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_50 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_50` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_51` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_51 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_51` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_52` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_52 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_52` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_53` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_53 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_53` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_54` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_54 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_54` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_55` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_55 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_55` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_56` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_56 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_56` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_57` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_57 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_57` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_58` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_58 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_58` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_59` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_59 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_59` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_60` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_60 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_60` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_61` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_61 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_61` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_62` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_62 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_62` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_63` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_63 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_63` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_64` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_64 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_64` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_65` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_65 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_65` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_66` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_66 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_66` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_67` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_67 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_67` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_68` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_68 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_68` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_69` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_69 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_69` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_70` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_70 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_70` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_71` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_71 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_71` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_72` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_72 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_72` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_73` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_73 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_73` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_74` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_74 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_74` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_75` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_75 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_75` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_76` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_76 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_76` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_77` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_77 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_77` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_78` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_78 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_78` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_79` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_79 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_79` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_80` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_80 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_80` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_81` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_81 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_81` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_82` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_82 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_82` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_83` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_83 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_83` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_84` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_84 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_84` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_85` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_85 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_85` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_86` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_86 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_86` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_87` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_87 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_87` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_88` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_88 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_88` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_89` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_89 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_89` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_90` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_90 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_90` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_91` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_91 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_91` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_92` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_92 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_92` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_93` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_93 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_93` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_94` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_94 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_94` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_95` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_95 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_95` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_96` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_96 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_96` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_97` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_97 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_97` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_98` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_98 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_98` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + +ALTER TABLE `mallink`.`wx_coupon_99` +ADD COLUMN `coupon_id` bigint(20) AFTER `id`; +update wx_coupon_99 set coupon_id = id; +ALTER TABLE `mallink`.`wx_coupon_99` +MODIFY COLUMN `coupon_id` bigint(20) NOT NULL AFTER `id`; + + +ALTER TABLE `mallink`.`wx_coupon_0` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_1` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_2` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_3` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_4` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_5` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_6` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_7` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_8` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_9` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_10` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_11` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_12` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_13` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_14` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_15` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_16` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_17` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_18` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_19` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_20` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_21` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_22` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_23` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_24` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_25` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_26` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_27` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_28` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_29` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_30` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_31` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_32` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_33` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_34` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_35` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_36` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_37` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_38` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_39` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_40` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_41` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_42` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_43` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_44` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_45` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_46` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_47` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_48` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_49` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_50` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_51` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_52` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_53` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_54` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_55` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_56` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_57` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_58` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_59` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_60` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_61` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_62` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_63` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_64` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_65` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_66` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_67` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_68` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_69` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_70` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_71` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_72` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_73` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_74` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_75` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_76` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_77` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_78` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_79` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_80` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_81` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_82` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_83` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_84` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_85` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_86` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_87` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_88` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_89` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_90` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_91` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_92` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_93` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_94` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_95` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_96` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_97` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_98` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; +ALTER TABLE `mallink`.`wx_coupon_99` +ADD COLUMN `version` smallint(1) NOT NULL DEFAULT 0 AFTER `is_after_set_price`; diff --git a/mallinkCApi/src/main/java/com/iformall/controller/WxCouponController.java b/mallinkCApi/src/main/java/com/iformall/controller/WxCouponController.java index c8830d6da..41f39d70b 100644 --- a/mallinkCApi/src/main/java/com/iformall/controller/WxCouponController.java +++ b/mallinkCApi/src/main/java/com/iformall/controller/WxCouponController.java @@ -113,7 +113,6 @@ public class WxCouponController extends BaseController { coupon.setGiftCouponList(couponService.list(couponQ)); } } - coupon.setCouponId(coupon.getId()); CouponCacheUtils.setOnlyCouponCache(redisTemplate, couponId, coupon); } return new ResultData(coupon); @@ -175,7 +174,6 @@ public class WxCouponController extends BaseController { coupon.setGiftCouponList(couponService.list(couponQ)); } } - coupon.setCouponId(coupon.getId()); coupon.setCouponChannelId(couponChannel.getId()); CouponCacheUtils.setCouponCache(redisTemplate, couponChannel.getCouponId(), coupon); } diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java b/mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java index 2634a7898..00517276e 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java @@ -32,6 +32,9 @@ public class WxCoupon extends TenantEntity { protected Long id; + @io.swagger.annotations.ApiModelProperty(value="商品ID",name="couponId") + private Long couponId; + @TableField(exist = false) protected List types; @@ -227,9 +230,6 @@ public class WxCoupon extends TenantEntity { @TableField(exist = false) @io.swagger.annotations.ApiModelProperty(value="投放频道参数,用来过滤",name="targetAd") private Integer targetAd; - @TableField(exist = false) - @io.swagger.annotations.ApiModelProperty(value="投放频道参数,用来过滤",name="couponId") - private Long couponId; @TableField(exist = false) @io.swagger.annotations.ApiModelProperty(value = "用户积分,用来过滤", name = "userCredit") @@ -517,5 +517,8 @@ public class WxCoupon extends TenantEntity { } return valid_date; } + + @io.swagger.annotations.ApiModelProperty(value = "商品版本 EnumCouponVersion", name = "version") + private Integer version; } diff --git a/mallinkService/src/main/java/com/iformall/enums/EnumCouponVersion.java b/mallinkService/src/main/java/com/iformall/enums/EnumCouponVersion.java new file mode 100644 index 000000000..592a99432 --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/enums/EnumCouponVersion.java @@ -0,0 +1,43 @@ +package com.iformall.enums; + +/** + * Created by Stormeye on 2018/08/09. + */ +public enum EnumCouponVersion { + + /** + * //初始状态为线上版本。 + * //当抖音线上版本需要修改时会新增草稿版本 + * //此时修改草稿版本数据 + * //草稿版本审核通过后会同步数据到线上版本 + * //实现不下架修改 + */ + online(0, "线上版本"), + draft(1, "草稿版本"), + ; + + public static EnumCouponVersion getEnum(Integer code) { + for (EnumCouponVersion value : values()) { + if (value.getCode().equals(code)) { + return value; + } + } + return null; + } + + private Integer code; + private String message; + + EnumCouponVersion(Integer code, String message) { + this.code = code; + this.message = message; + } + + public Integer getCode() { + return code; + } + + public String getMessage() { + return message; + } +} diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java index 88eadde43..c1d27a7ad 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java @@ -42,8 +42,6 @@ public interface WxCouponMapper extends CommonMapper { void deleteById(@Param("id")Long id,@Param("tenantId")String tenantId); - Integer setPrice(WxCoupon wxCoupon); - Integer reduceInventory(@Param("id")Long id,@Param("tenantId")String tenantId,@Param("number")Integer number); @@ -127,6 +125,5 @@ public interface WxCouponMapper extends CommonMapper { List ttCouponList(TtCouponVo ttCouponVo); Integer findCategoryIdById(@Param("id")Long id,@Param("tenantId")String tenantId); - - void setMakeMerchantId(WxCoupon couponQ); + } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java index 8399dfe32..f17829e33 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java @@ -607,6 +607,9 @@ public class WxCouponServiceImpl implements WxCouponService { final IdWorker idWorker = IdWorker.get(); if (record.getId() == null) { record.setId(idWorker.nextId()); + if(record.getCouponId() == null){ + record.setCouponId(record.getId()); + } if (EnumCouponType.checkCreateWithMerchants(record.getType())) { for (Iterator it = tenantMerchantMap.keySet().iterator();it.hasNext();) { TenantEntity mallTenant = it.next(); @@ -1266,7 +1269,7 @@ public class WxCouponServiceImpl implements WxCouponService { @Override public void exportPressData(WxCoupon record, List tenantEntitys, HttpServletRequest request, HttpServletResponse response) { - Map map = new HashMap(); + Map map = new HashMap(); map.put("record", record); map.put("tenantEntitys", tenantEntitys); excelService.exportBigExcel(pressDataExporter,map, null, "砍价营销数据信息", WxPressData.class, "砍价营销数据.xlsx", response, false); diff --git a/mallinkService/src/main/resources/mapper/WxCouponMapper.xml b/mallinkService/src/main/resources/mapper/WxCouponMapper.xml index a2b7e2f7d..017cbedf2 100644 --- a/mallinkService/src/main/resources/mapper/WxCouponMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCouponMapper.xml @@ -3,6 +3,8 @@ + + @@ -76,6 +78,8 @@ + + @@ -131,7 +135,7 @@ - c.`id`,c.`tenant_id`,c.`parent_tenant_id`,c.`make_merchant_id`,c.`brand`,c.`type`,c.`cover_img`,c.`cover_picture`,c.`detail_picture`, + c.`id`,c.`coupon_id`,c.`version`,c.`tenant_id`,c.`parent_tenant_id`,c.`make_merchant_id`,c.`brand`,c.`type`,c.`cover_img`,c.`cover_picture`,c.`detail_picture`, c.`title`,c.`sub_title`,c.`item_group`,c.`sale_price`,c.`freight_price`,c.`use_price`,c.`use_limit_rule`,c.`use_limit_quantity`,c.`send_type`, c.`sold_start_time`,c.`sold_end_time`,c.`valid_type`,c.`valid_start_date`,c.`valid_end_date`,c.`valid_days`,c.`detail`,c.`price`,c.tail_price,c.orig_price,c.`unit`,c.`remain_inventory`,c.`inventory`, c.`remark`,c.`status`,c.`create_date`,c.`update_date`,c.`business`,c.`sub_business`,c.`support_transfer`,c.`subsidy_num`,c.`subsidy_type`,c.`is_after_set_price`,c.`card_score_rule`, @@ -139,17 +143,17 @@ c.`conditions`,c.approval_type,c.content_type,c.source_type,c.merchant_type,c.password_support,c.is_recharge,c.used_password,c.gift_list,c.product_type,c.category_id,c.goods_id - - `id`,`remain_inventory`,`status` - - - where 1 = 1 + where version = 0 and `id` = #{id} + + and `coupon_id` = #{couponId} + + and `tenant_id` = #{tenantId} @@ -381,6 +385,8 @@ + + @@ -388,16 +394,20 @@ select id from wx_coupon c - + select - c.id,c.remain_inventory, c.use_limit_rule,c.use_limit_quantity, c.inventory, c.valid_start_date, c.valid_end_date,c.valid_type,c.valid_days - from wx_coupon c where c.`tenant_id` = #{tenantId} + c.id,c.coupon_id,c.version,c.remain_inventory, c.use_limit_rule,c.use_limit_quantity, c.inventory, c.valid_start_date, c.valid_end_date,c.valid_type,c.valid_days + from wx_coupon c + where c.`version` = 0 and c.`tenant_id` = #{tenantId} and id in @@ -509,14 +525,14 @@ SET `remain_inventory` = #{remainInventory}, `inventory` = #{inventory}, `valid_type` = #{validType}, `valid_end_date` = #{validEndDate}, `valid_days` = #{validDays} - WHERE 1=1 + WHERE id = #{id} and `tenant_id` = #{tenantId} and `parent_tenant_id` = #{parentTenantId} - and id = #{id} and `remain_inventory` = #{orgRemainInventory} and `inventory` = #{orgInventory} + and `remain_inventory` = #{orgRemainInventory} and `inventory` = #{orgInventory} @@ -526,6 +542,10 @@ and c.`id` = #{id} + + and c.`coupon_id` = #{couponId} + + and c.`tenant_id` = #{tenantId} @@ -736,7 +756,7 @@ left join tt_coupon_channel_poi poi on poi.id = c.id - where c.is_del = 0 + where c.is_del = 0 and c.version = 0 and poi.`spu_id` = #{spuId} @@ -765,7 +785,7 @@ left join tt_coupon_channel_poi poi on poi.id = c.id - where c.is_del = 0 + where c.is_del = 0 and c.version = 0 and poi.`spu_id` = #{spuId} @@ -784,6 +804,8 @@ + + @@ -839,7 +861,10 @@ + + + @@ -893,7 +918,7 @@ @@ -934,7 +959,8 @@ - select DATE_FORMAT(wcs.create_date,'%Y-%m-%d') xtime,sum(round(wcs.real_payment/100,2)) xcount from wx_card_info ci + select DATE_FORMAT(wcs.create_date,'%Y-%m-%d') xtime,sum(round(wcs.real_payment/100,2)) xcount + from wx_card_info ci left join ( SELECT * from wx_coupon${tenantEntity.shardTableSuffix} ) c on c.id = ci.coupon_id @@ -1030,7 +1057,7 @@ from ( SELECT * from wx_coupon${tenantEntity.shardTableSuffix} - ) c where c.type = 100 + ) c where c.version = 0 and c.type = 100 and c.title like concat('%', #{wxCoupon.title},'%') @@ -1086,7 +1113,7 @@ where wc.id = c.id) as sum_subsidy from ( SELECT * from wx_coupon${tenantEntity.shardTableSuffix} - ) c where c.type not in(8,9,100) + ) c where c.version = 0 and c.type not in(8,9,100) and c.sale_price > 0 @@ -1160,7 +1187,7 @@ and `parent_tenant_id` = #{wxCoupon.parentTenantId} group by coupon_id) cop on cop.coupon_id = c.id - where c.type = 8 + where c.version = 0 and c.type = 8 and c.`tenant_id` = #{wxCoupon.tenantId} @@ -1266,7 +1293,8 @@ + + + + - select id,remain_inventory,inventory,cover_img,title,sub_title,item_group,sale_price,use_price,price,tail_price, + select id,coupon_id,version,remain_inventory,inventory,cover_img,title,sub_title,item_group,sale_price,use_price,price,tail_price, orig_price,unit,use_limit_rule,use_limit_quantity,send_type,support_transfer,press_limit_num,auto_refund, conditions,valid_type,sold_start_time,sold_end_time,valid_start_date,valid_end_date,valid_days,credit_price, remark,content_type,source_type,merchant_type - from wx_coupon where `tenant_id` = #{tenantId} + from wx_coupon + where `version` = 0 + and `tenant_id` = #{tenantId} and `id` = #{id} @@ -1429,16 +1463,20 @@ + + @@ -1482,7 +1520,7 @@ - - - update wx_coupon set make_merchant_id = #{makeMerchantId} where id = #{id} and tenant_id = #{tenantId} - - - - update wx_coupon set price = #{price},subsidy_num=#{subsidyNum} where id = #{id} and tenant_id = #{tenantId} and price = 0 - diff --git a/mallinkService/src/main/resources/mapper/WxCouponPasswordMapper.xml b/mallinkService/src/main/resources/mapper/WxCouponPasswordMapper.xml index d82bf45ea..6257ee2c8 100644 --- a/mallinkService/src/main/resources/mapper/WxCouponPasswordMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCouponPasswordMapper.xml @@ -180,7 +180,7 @@ and `parent_tenant_id` = #{parentTenantId} group by coupon_id) cp - inner join wx_coupon c on cp.coupon_id = c.id + left join wx_coupon c on cp.coupon_id = c.id where c.status=0 and c.put_apply_status in(0,2) and c.`tenant_id` = #{tenantId}