| @@ -0,0 +1,108 @@ | |||||
| package com.iformall.controller.mem; | |||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.annotation.SystemControllerLog; | |||||
| import com.iformall.common.ErrorCode; | |||||
| import com.iformall.common.Result; | |||||
| import com.iformall.common.ResultData; | |||||
| import com.iformall.controller.base.BaseController; | |||||
| import com.iformall.domain.po.*; | |||||
| import com.iformall.service.*; | |||||
| import io.swagger.annotations.Api; | |||||
| import io.swagger.annotations.ApiImplicitParam; | |||||
| import io.swagger.annotations.ApiImplicitParams; | |||||
| import io.swagger.annotations.ApiOperation; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| @RestController | |||||
| @RequestMapping("userBasicInfoAddress") | |||||
| @Api(description = "会员地址相关接口") | |||||
| public class UserBasicInfoAddressController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| private UserBasicInfoAddressService userBasicInfoAddressService; | |||||
| @ApiOperation("分页列表接口") | |||||
| @GetMapping("list") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| @SystemControllerLog(description = "会员地址-列表") | |||||
| public ResultData list(@ModelAttribute UserBasicInfoAddress userBasicInfoAddress, Integer pageNum, Integer pageSize) { | |||||
| logger.debug("[" + getIpAddr() + "] UserBasicInfoAddressController::list"); | |||||
| if (null == userBasicInfoAddress) { | |||||
| userBasicInfoAddress = new UserBasicInfoAddress(); | |||||
| } | |||||
| if(userBasicInfoAddress.getUserId() == null){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "用户ID为空"); | |||||
| } | |||||
| userBasicInfoAddress.undateFinalTenantId(ifParentUpdateTenantInfo()); | |||||
| PageInfo<UserBasicInfoAddress> page = userBasicInfoAddressService.listAsPage(userBasicInfoAddress, pageNum, pageSize); | |||||
| return new ResultData(page); | |||||
| } | |||||
| @PostMapping("saveOrUpdate") | |||||
| @SystemControllerLog(description = "会员地址-保存更新") | |||||
| public ResultData saveOrUpdate(@RequestBody UserBasicInfoAddress userBasicInfoAddress) { | |||||
| logger.debug("[" + getIpAddr() + "] userBasicInfoAddress::saveOrUpdate"); | |||||
| if(userBasicInfoAddress == null){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||||
| } | |||||
| userBasicInfoAddress.undateFinalTenantId(ifParentUpdateTenantInfo()); | |||||
| userBasicInfoAddressService.saveOrUpdate(userBasicInfoAddress); | |||||
| return new ResultData(); | |||||
| } | |||||
| @PostMapping("setUpDefault") | |||||
| @SystemControllerLog(description = "会员地址-默认") | |||||
| public ResultData setUpDefault(@RequestBody UserBasicInfoAddress userBasicInfoAddress) { | |||||
| logger.debug("[" + getIpAddr() + "] userBasicInfoAddress::setUpDefault"); | |||||
| if(userBasicInfoAddress == null){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||||
| } | |||||
| if(userBasicInfoAddress.getId() == null || userBasicInfoAddress.getUserId() == null){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "用户ID或者Id为空"); | |||||
| } | |||||
| userBasicInfoAddress.undateFinalTenantId(ifParentUpdateTenantInfo()); | |||||
| userBasicInfoAddressService.updateDefault(userBasicInfoAddress); | |||||
| return new ResultData(); | |||||
| } | |||||
| @ApiOperation("消息模板-删除") | |||||
| @GetMapping("/del") | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "String", paramType = "query", required = true) | |||||
| @SystemControllerLog(description = "消息验证模板-删除") | |||||
| public ResultData delete(Long id) { | |||||
| logger.debug("[" + getIpAddr() + "] userBasicInfoAddress::delete"); | |||||
| if(id == null){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "Id为空"); | |||||
| } | |||||
| UserBasicInfoAddress userBasicInfoAddress = new UserBasicInfoAddress(); | |||||
| userBasicInfoAddress.setId(id); | |||||
| userBasicInfoAddress.undateFinalTenantId(ifParentUpdateTenantInfo()); | |||||
| userBasicInfoAddressService.deleteById(userBasicInfoAddress); | |||||
| return new ResultData(Result.SUCCESS, "删除成功", null); | |||||
| } | |||||
| @ApiOperation("消息模板-查询") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "String", paramType = "query", required = true) | |||||
| @SystemControllerLog(description = "消息验证模板-查询") | |||||
| public ResultData findById(Long id) { | |||||
| logger.debug("[" + getIpAddr() + "] userBasicInfoAddress::findById"); | |||||
| if(id == null){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "Id为空"); | |||||
| } | |||||
| UserBasicInfoAddress userBasicInfoAddress = new UserBasicInfoAddress(); | |||||
| userBasicInfoAddress.setId(id); | |||||
| userBasicInfoAddress.undateFinalTenantId(ifParentUpdateTenantInfo()); | |||||
| userBasicInfoAddressService.findById(userBasicInfoAddress); | |||||
| return new ResultData(Result.SUCCESS, "查询成功", null); | |||||
| } | |||||
| } | |||||
| @@ -40,6 +40,7 @@ public class TenantInfoImpl implements TenantInfo { | |||||
| "wx_score_rules", | "wx_score_rules", | ||||
| "wx_level_config", | "wx_level_config", | ||||
| "wx_c_user_basic_info", | "wx_c_user_basic_info", | ||||
| "user_basic_info_address", | |||||
| "wx_c_user_basic_child", | "wx_c_user_basic_child", | ||||
| "wx_c_user_basic_sign", | "wx_c_user_basic_sign", | ||||
| "wx_credit_history", | "wx_credit_history", | ||||
| @@ -79,6 +80,7 @@ public class TenantInfoImpl implements TenantInfo { | |||||
| "wx_weapp_code_status", | "wx_weapp_code_status", | ||||
| "wx_weapp_release_status", | "wx_weapp_release_status", | ||||
| "wx_c_user_basic_info", | "wx_c_user_basic_info", | ||||
| "user_basic_info_address", | |||||
| "wx_c_user_basic_child", | "wx_c_user_basic_child", | ||||
| "wx_c_user_basic_sign", | "wx_c_user_basic_sign", | ||||
| "mem_coupon_from_dsp", | "mem_coupon_from_dsp", | ||||
| @@ -0,0 +1,9 @@ | |||||
| --加可配送商品 | |||||
| INSERT INTO `mallink`.`mall_permission`(`id`, `name`, `parent_id`, `available`, `permission`, `resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`, `sort`) VALUES (665, '可配送商品', 604, 'Y', NULL, 1, NULL, NULL, 'distributableCoupon', null, 0, 665); | |||||
| --加商品订单 | |||||
| INSERT INTO `mallink`.`mall_permission`(`id`, `name`, `parent_id`, `available`, `permission`, `resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`, `sort`) VALUES (714, '商品订单', 610, 'Y', NULL, 1, NULL, NULL, 'distributableOrder', NULL, 0, 714); | |||||
| --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, 201, 202, 203, 204, 205, 206, 209, 211, 212, 221, 222, 251, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 420, 421, 422, 501, 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, 614, 621, 622, 623, 624, 625, 626, 627, 641, 642, 643, 644, 645, 646, 651, 661, 662, 663, 664, 665, 671, 672, 673, 674, 675, 681, 682, 683, 684, 685, 686, 691, 692, 693, 694, 695, 701, 702, 703, 704, 711, 712, 713, 714, 901, 902, 903, 904, 905, 931, 932, 951, 952, 961, 962, 963, 965, 966, 967, 968, 1001, 1002, 1003, 1004, 60701, 60702]' WHERE `id` = 1; | |||||
| 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, 201, 202, 203, 204, 205, 206, 209, 211, 212, 221, 222, 251, 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, 501, 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, 614, 621, 622, 623, 624, 625, 626, 627, 641, 642, 643, 644, 645, 646, 651, 661, 662, 663, 664, 665, 671, 672, 673, 674, 675, 681, 682, 683, 684, 685, 686, 691, 692, 693, 694, 695, 701, 702, 703, 704, 711, 712, 713, 714, 901, 902, 903, 904, 905, 931, 932, 951, 952, 961, 962, 963, 965, 966, 967, 968, 1001, 1002, 1003, 1004, 60701, 60702]' WHERE `id` = 1; | |||||
| @@ -0,0 +1,124 @@ | |||||
| CREATE TABLE `user_basic_info_address` ( | |||||
| `id` bigint(20) NOT NULL COMMENT '主键ID', | |||||
| `tenant_id` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '租户ID', | |||||
| `parent_tenant_id` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '父租户ID', | |||||
| `final_tenant_id` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '归属租户ID', | |||||
| `user_id` bigint(20) DEFAULT NULL, | |||||
| `consignee` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '收货人', | |||||
| `country` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '国家', | |||||
| `province` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '省', | |||||
| `city` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '市', | |||||
| `district` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '区', | |||||
| `region` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '所属地区', | |||||
| `address` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '详细地址', | |||||
| `zipcode` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '邮政编码', | |||||
| `mobile` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '手机号', | |||||
| `is_default` tinyint(1) DEFAULT 0 COMMENT '是否默认,0否,1是。', | |||||
| `mark` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '标识', | |||||
| `is_del` tinyint(1) DEFAULT 0 COMMENT '0否,1是。', | |||||
| `create_date` datetime(0) DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', | |||||
| `update_date` datetime(0) DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间', | |||||
| PRIMARY KEY (`id`) USING BTREE, | |||||
| UNIQUE INDEX `id_UNIQUE`(`id`) USING BTREE | |||||
| ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户收获地址表' ROW_FORMAT = Dynamic; | |||||
| CREATE TABLE user_basic_info_address_0 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_1 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_2 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_3 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_4 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_5 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_6 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_7 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_8 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_9 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_10 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_11 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_12 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_13 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_14 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_15 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_16 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_17 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_18 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_19 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_20 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_21 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_22 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_23 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_24 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_25 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_26 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_27 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_28 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_29 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_30 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_31 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_32 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_33 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_34 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_35 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_36 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_37 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_38 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_39 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_40 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_41 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_42 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_43 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_44 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_45 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_46 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_47 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_48 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_49 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_50 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_51 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_52 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_53 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_54 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_55 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_56 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_57 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_58 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_59 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_60 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_61 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_62 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_63 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_64 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_65 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_66 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_67 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_68 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_69 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_70 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_71 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_72 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_73 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_74 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_75 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_76 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_77 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_78 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_79 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_80 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_81 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_82 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_83 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_84 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_85 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_86 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_87 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_88 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_89 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_90 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_91 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_92 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_93 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_94 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_95 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_96 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_97 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_98 LIKE user_basic_info_address; | |||||
| CREATE TABLE user_basic_info_address_99 LIKE user_basic_info_address; | |||||
| @@ -35,6 +35,7 @@ public class TenantInfoImpl implements TenantInfo { | |||||
| "wx_score_rules", | "wx_score_rules", | ||||
| "wx_level_config", | "wx_level_config", | ||||
| "wx_c_user_basic_info", | "wx_c_user_basic_info", | ||||
| "user_basic_info_address", | |||||
| "wx_c_user_basic_child", | "wx_c_user_basic_child", | ||||
| "wx_c_user_basic_sign", | "wx_c_user_basic_sign", | ||||
| "wx_credit_history", | "wx_credit_history", | ||||
| @@ -50,6 +51,7 @@ public class TenantInfoImpl implements TenantInfo { | |||||
| "wx_authorizer_info", | "wx_authorizer_info", | ||||
| "wx_c_user", | "wx_c_user", | ||||
| "wx_c_user_basic_info", | "wx_c_user_basic_info", | ||||
| "user_basic_info_address", | |||||
| "wx_c_user_basic_child", | "wx_c_user_basic_child", | ||||
| "wx_c_user_basic_sign", | "wx_c_user_basic_sign", | ||||
| "wx_c_user_car", | "wx_c_user_car", | ||||
| @@ -0,0 +1,119 @@ | |||||
| package com.iformall.controller; | |||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.common.ErrorCode; | |||||
| import com.iformall.common.Result; | |||||
| import com.iformall.common.ResultData; | |||||
| import com.iformall.domain.po.UserBasicInfoAddress; | |||||
| import com.iformall.service.UserBasicInfoAddressService; | |||||
| import io.swagger.annotations.Api; | |||||
| import io.swagger.annotations.ApiImplicitParam; | |||||
| import io.swagger.annotations.ApiImplicitParams; | |||||
| import io.swagger.annotations.ApiOperation; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| @RestController | |||||
| @RequestMapping("userBasicInfoAddress") | |||||
| @Api(description = "会员地址相关接口") | |||||
| public class UserBasicInfoAddressController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| private UserBasicInfoAddressService userBasicInfoAddressService; | |||||
| @ApiOperation("分页列表接口") | |||||
| @GetMapping("list") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData list(@ModelAttribute UserBasicInfoAddress userBasicInfoAddress, Integer pageNum, Integer pageSize) { | |||||
| logger.debug("[" + getIpAddr() + "] UserBasicInfoAddressController::list"); | |||||
| if (null == userBasicInfoAddress) { | |||||
| userBasicInfoAddress = new UserBasicInfoAddress(); | |||||
| } | |||||
| Long memberId; | |||||
| try { | |||||
| memberId = getMemberId(); | |||||
| } catch (Exception e) { | |||||
| return new ResultData(Result.ERROR,e.getMessage()); | |||||
| } | |||||
| userBasicInfoAddress.setUserId(memberId); | |||||
| userBasicInfoAddress.undateFinalTenantId(getTenantInfo()); | |||||
| PageInfo<UserBasicInfoAddress> page = userBasicInfoAddressService.listAsPage(userBasicInfoAddress, pageNum, pageSize); | |||||
| return new ResultData(page); | |||||
| } | |||||
| @PostMapping("saveOrUpdate") | |||||
| public ResultData saveOrUpdate(@RequestBody UserBasicInfoAddress userBasicInfoAddress) { | |||||
| logger.debug("[" + getIpAddr() + "] userBasicInfoAddress::saveOrUpdate"); | |||||
| if(userBasicInfoAddress == null){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||||
| } | |||||
| Long memberId; | |||||
| try { | |||||
| memberId = getMemberId(); | |||||
| } catch (Exception e) { | |||||
| return new ResultData(Result.ERROR,e.getMessage()); | |||||
| } | |||||
| userBasicInfoAddress.setUserId(memberId); | |||||
| userBasicInfoAddress.undateFinalTenantId(getTenantInfo()); | |||||
| userBasicInfoAddressService.saveOrUpdate(userBasicInfoAddress); | |||||
| return new ResultData(); | |||||
| } | |||||
| @PostMapping("setUpDefault") | |||||
| public ResultData setUpDefault(@RequestBody UserBasicInfoAddress userBasicInfoAddress) { | |||||
| logger.debug("[" + getIpAddr() + "] userBasicInfoAddress::setUpDefault"); | |||||
| if(userBasicInfoAddress == null){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||||
| } | |||||
| if(userBasicInfoAddress.getId() == null){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "Id为空"); | |||||
| } | |||||
| Long memberId; | |||||
| try { | |||||
| memberId = getMemberId(); | |||||
| } catch (Exception e) { | |||||
| return new ResultData(Result.ERROR,e.getMessage()); | |||||
| } | |||||
| userBasicInfoAddress.setUserId(memberId); | |||||
| userBasicInfoAddress.undateFinalTenantId(getTenantInfo()); | |||||
| userBasicInfoAddressService.updateDefault(userBasicInfoAddress); | |||||
| return new ResultData(); | |||||
| } | |||||
| @ApiOperation("消息模板-删除") | |||||
| @GetMapping("/del") | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "String", paramType = "query", required = true) | |||||
| public ResultData delete(Long id) { | |||||
| logger.debug("[" + getIpAddr() + "] userBasicInfoAddress::delete"); | |||||
| if(id == null){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "Id为空"); | |||||
| } | |||||
| UserBasicInfoAddress userBasicInfoAddress = new UserBasicInfoAddress(); | |||||
| userBasicInfoAddress.setId(id); | |||||
| userBasicInfoAddress.undateFinalTenantId(getTenantInfo()); | |||||
| userBasicInfoAddressService.deleteById(userBasicInfoAddress); | |||||
| return new ResultData(Result.SUCCESS, "删除成功", null); | |||||
| } | |||||
| @ApiOperation("消息模板-查询") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "String", paramType = "query", required = true) | |||||
| public ResultData findById(Long id) { | |||||
| logger.debug("[" + getIpAddr() + "] userBasicInfoAddress::findById"); | |||||
| if(id == null){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "Id为空"); | |||||
| } | |||||
| UserBasicInfoAddress userBasicInfoAddress = new UserBasicInfoAddress(); | |||||
| userBasicInfoAddress.setId(id); | |||||
| userBasicInfoAddress.undateFinalTenantId(getTenantInfo()); | |||||
| userBasicInfoAddressService.findById(userBasicInfoAddress); | |||||
| return new ResultData(Result.SUCCESS, "查询成功", null); | |||||
| } | |||||
| } | |||||
| @@ -894,6 +894,8 @@ public class WxUserGrantController extends BaseController { | |||||
| record.setAvatarUrl(wxCUserBasicInfo.getAvatarUrl()); | record.setAvatarUrl(wxCUserBasicInfo.getAvatarUrl()); | ||||
| record.setBirthdate(wxCUserBasicInfo.getBirthdate()); | record.setBirthdate(wxCUserBasicInfo.getBirthdate()); | ||||
| record.setSex(wxCUserBasicInfo.getSex()); | record.setSex(wxCUserBasicInfo.getSex()); | ||||
| record.setWeight(wxCUserBasicInfo.getWeight()); | |||||
| record.setHeight(wxCUserBasicInfo.getHeight()); | |||||
| record.setAddress(wxCUserBasicInfo.getAddress()); | record.setAddress(wxCUserBasicInfo.getAddress()); | ||||
| record.setUpdateDate(new Date()); | record.setUpdateDate(new Date()); | ||||
| record.setFinalTenantId(tenantEntity.getFinalTenantId()); | record.setFinalTenantId(tenantEntity.getFinalTenantId()); | ||||
| @@ -35,6 +35,7 @@ public class TenantInfoImpl implements TenantInfo { | |||||
| "wx_score_rules", | "wx_score_rules", | ||||
| "wx_level_config", | "wx_level_config", | ||||
| "wx_c_user_basic_info", | "wx_c_user_basic_info", | ||||
| "user_basic_info_address", | |||||
| "wx_c_user_basic_child", | "wx_c_user_basic_child", | ||||
| "wx_c_user_basic_sign", | "wx_c_user_basic_sign", | ||||
| "wx_credit_history", | "wx_credit_history", | ||||
| @@ -56,6 +57,7 @@ public class TenantInfoImpl implements TenantInfo { | |||||
| "wx_authorizer_info", | "wx_authorizer_info", | ||||
| "wx_c_user", | "wx_c_user", | ||||
| "wx_c_user_basic_info", | "wx_c_user_basic_info", | ||||
| "user_basic_info_address", | |||||
| "wx_c_user_basic_child", | "wx_c_user_basic_child", | ||||
| "wx_c_user_basic_sign", | "wx_c_user_basic_sign", | ||||
| "wx_c_user_car", | "wx_c_user_car", | ||||
| @@ -35,6 +35,7 @@ public class TenantInfoImpl implements TenantInfo { | |||||
| "wx_score_rules", | "wx_score_rules", | ||||
| "wx_level_config", | "wx_level_config", | ||||
| "wx_c_user_basic_info", | "wx_c_user_basic_info", | ||||
| "user_basic_info_address", | |||||
| "wx_c_user_basic_child", | "wx_c_user_basic_child", | ||||
| "wx_c_user_basic_sign", | "wx_c_user_basic_sign", | ||||
| "wx_credit_history", | "wx_credit_history", | ||||
| @@ -56,6 +57,7 @@ public class TenantInfoImpl implements TenantInfo { | |||||
| "wx_authorizer_info", | "wx_authorizer_info", | ||||
| "wx_c_user", | "wx_c_user", | ||||
| "wx_c_user_basic_info", | "wx_c_user_basic_info", | ||||
| "user_basic_info_address", | |||||
| "wx_c_user_basic_child", | "wx_c_user_basic_child", | ||||
| "wx_c_user_basic_sign", | "wx_c_user_basic_sign", | ||||
| "wx_c_user_car", | "wx_c_user_car", | ||||
| @@ -76,6 +76,13 @@ public class BaseMyBatisConfiguration { | |||||
| basicInfoSharding.setRule(EnumShardingRule.HASH.getCode()); | basicInfoSharding.setRule(EnumShardingRule.HASH.getCode()); | ||||
| shardingList.add(basicInfoSharding); | shardingList.add(basicInfoSharding); | ||||
| ShardingSphere basicInfoAddressSharding = new ShardingSphere(); | |||||
| basicInfoAddressSharding.setColumn("final_tenant_id"); | |||||
| basicInfoAddressSharding.setTableName("user_basic_info_address"); | |||||
| basicInfoAddressSharding.setCount(100); | |||||
| basicInfoAddressSharding.setRule(EnumShardingRule.HASH.getCode()); | |||||
| shardingList.add(basicInfoAddressSharding); | |||||
| ShardingSphere basicSignSharding = new ShardingSphere(); | ShardingSphere basicSignSharding = new ShardingSphere(); | ||||
| basicSignSharding.setColumn("tenant_id"); | basicSignSharding.setColumn("tenant_id"); | ||||
| basicSignSharding.setTableName("wx_c_user_basic_sign"); | basicSignSharding.setTableName("wx_c_user_basic_sign"); | ||||
| @@ -0,0 +1,86 @@ | |||||
| package com.iformall.domain.po; | |||||
| import com.baomidou.mybatisplus.annotation.TableField; | |||||
| import com.baomidou.mybatisplus.annotation.TableName; | |||||
| import com.fasterxml.jackson.annotation.JsonIgnore; | |||||
| import com.iformall.domain.po.base.TenantEntity; | |||||
| import com.iformall.domain.po.base.TenantEntityWithoutFinalTenantId; | |||||
| import lombok.Data; | |||||
| import lombok.EqualsAndHashCode; | |||||
| import lombok.ToString; | |||||
| import org.apache.commons.lang3.StringUtils; | |||||
| import java.util.Date; | |||||
| @TableName(value = "user_basic_info_address") | |||||
| @Data | |||||
| @ToString(callSuper = true) | |||||
| @EqualsAndHashCode(callSuper = true) | |||||
| public class UserBasicInfoAddress extends TenantEntityWithoutFinalTenantId { | |||||
| protected Long id; | |||||
| @io.swagger.annotations.ApiModelProperty(value="如果是集团版的,存集团版的tenantId,如果是商场,则存商场",name="finalTenantId") | |||||
| private String finalTenantId; | |||||
| @JsonIgnore | |||||
| @TableField(exist = false) | |||||
| protected String shardFinalTableSuffix; | |||||
| public String getShardFinalTableSuffix(){ | |||||
| if(StringUtils.isNotBlank(finalTenantId)){ | |||||
| shardFinalTableSuffix = "_" + Integer.parseInt(finalTenantId)%100; | |||||
| } | |||||
| return shardFinalTableSuffix; | |||||
| } | |||||
| @io.swagger.annotations.ApiModelProperty(value="",name="userId") | |||||
| private Long userId; | |||||
| @io.swagger.annotations.ApiModelProperty(value="收货人",name="consignee") | |||||
| private String consignee; | |||||
| @io.swagger.annotations.ApiModelProperty(value="国家",name="country") | |||||
| private String country; | |||||
| @io.swagger.annotations.ApiModelProperty(value="省",name="province") | |||||
| private String province; | |||||
| @io.swagger.annotations.ApiModelProperty(value="市",name="city") | |||||
| private String city; | |||||
| @io.swagger.annotations.ApiModelProperty(value="区",name="district") | |||||
| private String district; | |||||
| @io.swagger.annotations.ApiModelProperty(value="所属地区",name="region") | |||||
| private String region; | |||||
| private String address; | |||||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | |||||
| private Date updateDate; | |||||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | |||||
| private Date createDate; | |||||
| @io.swagger.annotations.ApiModelProperty(value="邮编",name="zipcode") | |||||
| private String zipcode; | |||||
| @io.swagger.annotations.ApiModelProperty(value="手机号",name="mobile") | |||||
| private String mobile; | |||||
| @io.swagger.annotations.ApiModelProperty(value="",name="isDefault") | |||||
| private Integer isDefault; | |||||
| @io.swagger.annotations.ApiModelProperty(value="标识",name="mark") | |||||
| private String mark; | |||||
| public void undateFinalTenantId(TenantEntity tenantEntity){ | |||||
| setFinalTenantId(tenantEntity.getTenantId()); | |||||
| if(StringUtils.isNotBlank(tenantEntity.getParentTenantId())){ | |||||
| setFinalTenantId(tenantEntity.getParentTenantId()); | |||||
| } | |||||
| } | |||||
| } | |||||
| @@ -189,7 +189,7 @@ public class WxCouponOrderBVo extends WxCouponOrder { | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private Long couponId; | private Long couponId; | ||||
| @Excel(name = "券类型", width = 50, orderNum = "15", replace = {"满减券_1", "代金券_2", "团购券_3", "礼品券_4", "停车券_5", "通用券_6", "砍价券_8", "团购券_9", "预购商品_10", "积分券_50", "积分停车券_51", "消费卡_100"}) | |||||
| @Excel(name = "券类型", width = 50, orderNum = "15", replace = {"满减券_1", "代金券_2", "团购券_3", "礼品券_4", "停车券_5", "通用券_6", "砍价券_8", "团购券_9", "预购商品_10", "可配送商品_11", "积分券_50", "积分停车券_51", "消费卡_100"}) | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private Integer couponType; | private Integer couponType; | ||||
| @@ -16,6 +16,7 @@ public enum EnumCouponType { | |||||
| COUPON_PRESS(8, "砍价券"), | COUPON_PRESS(8, "砍价券"), | ||||
| COUPON_GROUP(9, "团购券"), | COUPON_GROUP(9, "团购券"), | ||||
| COUPON_PREORDER(10, "预购商品"), | COUPON_PREORDER(10, "预购商品"), | ||||
| COUPON_DISTRIBUTION(11, "可配送商品"), | |||||
| COUPON_CREDIT(50,"积分券"), | COUPON_CREDIT(50,"积分券"), | ||||
| COUPON_CREDIT_PARK(51,"积分停车券"), | COUPON_CREDIT_PARK(51,"积分停车券"), | ||||
| CARD_MULTIMCH(100, "消费卡"), | CARD_MULTIMCH(100, "消费卡"), | ||||
| @@ -0,0 +1,19 @@ | |||||
| package com.iformall.mapper; | |||||
| import com.iformall.common.CommonMapper; | |||||
| import com.iformall.domain.po.UserBasicInfoAddress; | |||||
| import com.iformall.domain.po.WxCUserBasicInfo; | |||||
| import java.util.List; | |||||
| public interface UserBasicInfoAddressMapper extends CommonMapper<UserBasicInfoAddress, String> { | |||||
| List<WxCUserBasicInfo> findList(UserBasicInfoAddress record); | |||||
| int deleteById(UserBasicInfoAddress record); | |||||
| int updateDefault(UserBasicInfoAddress record); | |||||
| int updateUnDefault(UserBasicInfoAddress record); | |||||
| } | |||||
| @@ -0,0 +1,27 @@ | |||||
| package com.iformall.service; | |||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.common.ResultData; | |||||
| import com.iformall.domain.po.*; | |||||
| public interface UserBasicInfoAddressService { | |||||
| /** | |||||
| * 根据实体查询分页列表 | |||||
| * | |||||
| * @param record | |||||
| * @param pageIndex | |||||
| * @param pageSize | |||||
| * @return | |||||
| */ | |||||
| PageInfo<UserBasicInfoAddress> listAsPage(UserBasicInfoAddress record, Integer pageIndex, Integer pageSize); | |||||
| void saveOrUpdate(UserBasicInfoAddress userBasicInfoAddress); | |||||
| Integer deleteById(UserBasicInfoAddress record); | |||||
| void updateDefault(UserBasicInfoAddress record); | |||||
| UserBasicInfoAddress findById(UserBasicInfoAddress userBasicInfoAddress); | |||||
| } | |||||
| @@ -0,0 +1,70 @@ | |||||
| package com.iformall.service.impl; | |||||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |||||
| import com.github.pagehelper.PageHelper; | |||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.common.IdWorker; | |||||
| import com.iformall.common.ResultData; | |||||
| import com.iformall.domain.po.*; | |||||
| import com.iformall.enums.EnumCarVendor; | |||||
| import com.iformall.mapper.*; | |||||
| import com.iformall.service.*; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.stereotype.Service; | |||||
| import org.springframework.transaction.annotation.Propagation; | |||||
| import org.springframework.transaction.annotation.Transactional; | |||||
| import java.util.Date; | |||||
| @Service | |||||
| public class UserBasicInfoAddressServiceImpl implements UserBasicInfoAddressService { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| UserBasicInfoAddressMapper userBasicInfoAddressMapper; | |||||
| @Override | |||||
| public PageInfo<UserBasicInfoAddress> listAsPage(UserBasicInfoAddress record, Integer pageIndex, Integer pageSize) { | |||||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> userBasicInfoAddressMapper.findList(record)); | |||||
| } | |||||
| @Override | |||||
| public void saveOrUpdate(UserBasicInfoAddress record) { | |||||
| Date now = new Date(); | |||||
| if (record.getId() == null) { | |||||
| final IdWorker idWorker = IdWorker.get(); | |||||
| record.setId(idWorker.nextId()); | |||||
| record.setCreateDate(now); | |||||
| record.setUpdateDate(now); | |||||
| userBasicInfoAddressMapper.insert(record); | |||||
| } else { | |||||
| record.setUpdateDate(now); | |||||
| userBasicInfoAddressMapper.updateById(record); | |||||
| } | |||||
| } | |||||
| @Override | |||||
| public Integer deleteById(UserBasicInfoAddress record) { | |||||
| return userBasicInfoAddressMapper.deleteById(record); | |||||
| } | |||||
| @Override | |||||
| @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | |||||
| public void updateDefault(UserBasicInfoAddress record) { | |||||
| userBasicInfoAddressMapper.updateDefault(record); | |||||
| userBasicInfoAddressMapper.updateUnDefault(record); | |||||
| } | |||||
| @Override | |||||
| public UserBasicInfoAddress findById(UserBasicInfoAddress userBasicInfoAddress) { | |||||
| return userBasicInfoAddressMapper.selectOne(new QueryWrapper<>(userBasicInfoAddress)); | |||||
| } | |||||
| } | |||||
| @@ -1376,7 +1376,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||||
| if (couponOrder.getCouponType().equals(EnumCouponType.COUPON_MANJIAN.getCode())) { | if (couponOrder.getCouponType().equals(EnumCouponType.COUPON_MANJIAN.getCode())) { | ||||
| if (payPrice < wxCoupon.getUsePrice()) { | if (payPrice < wxCoupon.getUsePrice()) { | ||||
| logger.error("券达不到满减条件: couponOrder-" + couponOrder.getId()); | logger.error("券达不到满减条件: couponOrder-" + couponOrder.getId()); | ||||
| throw new MallinkException(ErrorCode.COUPON_ORDER_IS_PRE_VERIFY); | |||||
| throw new MallinkException(ErrorCode.COUPON_MANJIAN_USE_PRICE_NO_ALLOW_); | |||||
| } | } | ||||
| } | } | ||||
| @@ -1005,7 +1005,7 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { | |||||
| WxAppinfo appinfo = wxAppinfoService.getCAppInfo(order,payWay); | WxAppinfo appinfo = wxAppinfoService.getCAppInfo(order,payWay); | ||||
| if (record.getPayAmount().intValue() == 0 || record.getPayAmount().equals(order.getTotalPayment())) { | |||||
| if (record.getPayAmount().intValue() == 0 || record.getPayAmount().equals(order.getPayment())) { | |||||
| doCouponPayOrder(user, record, order,payWay); | doCouponPayOrder(user, record, order,payWay); | ||||
| } else { | } else { | ||||
| throw new MallinkException(ErrorCode.PAY_ORDER_ERROR); | throw new MallinkException(ErrorCode.PAY_ORDER_ERROR); | ||||
| @@ -0,0 +1,76 @@ | |||||
| <?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="com.iformall.mapper.UserBasicInfoAddressMapper"> | |||||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.UserBasicInfoAddress"> | |||||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | |||||
| <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId"/> | |||||
| <result column="final_tenant_id" jdbcType="VARCHAR" property="finalTenantId"/> | |||||
| <result column="user_id" jdbcType="BIGINT" property="userId"/> | |||||
| <result column="consignee" jdbcType="VARCHAR" property="consignee"/> | |||||
| <result column="country" jdbcType="VARCHAR" property="country"/> | |||||
| <result column="province" jdbcType="VARCHAR" property="province"/> | |||||
| <result column="city" jdbcType="VARCHAR" property="city"/> | |||||
| <result column="district" jdbcType="VARCHAR" property="district"/> | |||||
| <result column="region" jdbcType="VARCHAR" property="region"/> | |||||
| <result column="address" jdbcType="VARCHAR" property="address"/> | |||||
| <result column="zipcode" jdbcType="VARCHAR" property="zipcode"/> | |||||
| <result column="mobile" jdbcType="VARCHAR" property="mobile"/> | |||||
| <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/> | |||||
| <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/> | |||||
| <result column="is_default" jdbcType="INTEGER" property="isDefault"/> | |||||
| <result column="mark" jdbcType="VARCHAR" property="mark"/> | |||||
| </resultMap> | |||||
| <sql id="allColumns"> | |||||
| `id`,`tenant_id`,`parent_tenant_id`,`final_tenant_id`,`user_id`,`consignee`,`country`,`province`,`city`,`district`,`region`,`address`,`zipcode`,`mobile`, | |||||
| `create_date`,`update_date`,`is_default`,`mark` | |||||
| </sql> | |||||
| <sql id="dynamicWhereConditions"> | |||||
| where `is_del` = 0 | |||||
| <if test=" null != id "> | |||||
| and `id` = #{id} | |||||
| </if> | |||||
| <if test=" null != finalTenantId and '' != finalTenantId"> | |||||
| and `final_tenant_id` = #{finalTenantId} | |||||
| </if> | |||||
| <if test=" null != userId "> | |||||
| and `user_id` = #{userId} | |||||
| </if> | |||||
| order by `is_default` desc,`update_date` desc | |||||
| </sql> | |||||
| <select id="findList" parameterType="com.iformall.domain.po.UserBasicInfoAddress" resultMap="BaseResultMap"> | |||||
| select | |||||
| <include refid="allColumns"/> | |||||
| from user_basic_info_address | |||||
| <include refid="dynamicWhereConditions"/> | |||||
| </select> | |||||
| <update id="deleteById" parameterType="com.iformall.domain.po.UserBasicInfoAddress"> | |||||
| update user_basic_info_address set is_del = 1, update_date=now() where id = #{id} | |||||
| </update> | |||||
| <update id="updateDefault" parameterType="com.iformall.domain.po.UserBasicInfoAddress"> | |||||
| update user_basic_info_address | |||||
| set is_default = 1, update_date=now() | |||||
| where id = #{id} | |||||
| </update> | |||||
| <update id="updateUnDefault" parameterType="com.iformall.domain.po.UserBasicInfoAddress"> | |||||
| update user_basic_info_address | |||||
| set is_default = 0, update_date=now() | |||||
| where user_id = #{userId} | |||||
| and id != #{id} | |||||
| </update> | |||||
| </mapper> | |||||