From e01ddf0b9c011dedbbdbfca3bff19ea96ef8b860 Mon Sep 17 00:00:00 2001 From: dzq Date: Mon, 7 Apr 2025 14:58:27 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=BE=AE=E4=BF=A1=E7=94=A8=E6=88=B7):=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=BE=AE=E4=BF=A1=E7=94=A8=E6=88=B7=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增微信用户管理模块,包括实体类、Mapper、Service、DTO、查询条件、命令类、模型工厂、应用服务及控制器,实现对微信用户信息的增删改查功能。 --- .../controller/shop/WxUserInfoController.java | 68 +++++++++++++++++++ .../wxuser/WxUserInfoApplicationService.java | 51 ++++++++++++++ .../wxuser/command/AddWxUserInfoCommand.java | 11 +++ .../command/UpdateWxUserInfoCommand.java | 16 +++++ .../shop/wxuser/db/WxUserInfoEntity.java | 56 +++++++++++++++ .../shop/wxuser/db/WxUserInfoMapper.java | 46 +++++++++++++ .../shop/wxuser/db/WxUserInfoService.java | 27 ++++++++ .../shop/wxuser/db/WxUserInfoServiceImpl.java | 46 +++++++++++++ .../domain/shop/wxuser/dto/WxUserInfoDTO.java | 48 +++++++++++++ .../shop/wxuser/model/WxUserInfoModel.java | 37 ++++++++++ .../wxuser/model/WxUserInfoModelFactory.java | 27 ++++++++ .../wxuser/query/SearchWxUserInfoQuery.java | 38 +++++++++++ .../mapper/shop/WxUserInfoMapper.xml | 5 ++ .../mybatisplus/CodeGenerator.java | 2 +- 14 files changed, 477 insertions(+), 1 deletion(-) create mode 100644 agileboot-admin/src/main/java/com/agileboot/admin/controller/shop/WxUserInfoController.java create mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/shop/wxuser/WxUserInfoApplicationService.java create mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/shop/wxuser/command/AddWxUserInfoCommand.java create mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/shop/wxuser/command/UpdateWxUserInfoCommand.java create mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/shop/wxuser/db/WxUserInfoEntity.java create mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/shop/wxuser/db/WxUserInfoMapper.java create mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/shop/wxuser/db/WxUserInfoService.java create mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/shop/wxuser/db/WxUserInfoServiceImpl.java create mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/shop/wxuser/dto/WxUserInfoDTO.java create mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/shop/wxuser/model/WxUserInfoModel.java create mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/shop/wxuser/model/WxUserInfoModelFactory.java create mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/shop/wxuser/query/SearchWxUserInfoQuery.java create mode 100644 agileboot-domain/src/main/resources/mapper/shop/WxUserInfoMapper.xml diff --git a/agileboot-admin/src/main/java/com/agileboot/admin/controller/shop/WxUserInfoController.java b/agileboot-admin/src/main/java/com/agileboot/admin/controller/shop/WxUserInfoController.java new file mode 100644 index 0000000..004f960 --- /dev/null +++ b/agileboot-admin/src/main/java/com/agileboot/admin/controller/shop/WxUserInfoController.java @@ -0,0 +1,68 @@ +package com.agileboot.admin.controller.shop; + +import com.agileboot.admin.customize.aop.accessLog.AccessLog; +import com.agileboot.common.core.base.BaseController; +import com.agileboot.common.core.dto.ResponseDTO; +import com.agileboot.common.core.page.PageDTO; +import com.agileboot.common.enums.common.BusinessTypeEnum; +import com.agileboot.domain.common.command.BulkOperationCommand; +import com.agileboot.domain.shop.wxuser.WxUserInfoApplicationService; +import com.agileboot.domain.shop.wxuser.command.AddWxUserInfoCommand; +import com.agileboot.domain.shop.wxuser.command.UpdateWxUserInfoCommand; +import com.agileboot.domain.shop.wxuser.db.WxUserInfoEntity; +import com.agileboot.domain.shop.wxuser.dto.WxUserInfoDTO; +import com.agileboot.domain.shop.wxuser.query.SearchWxUserInfoQuery; +import io.swagger.v3.oas.annotations.Operation; +import java.util.List; +import javax.validation.constraints.NotNull; +import lombok.RequiredArgsConstructor; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/shop/wxuser") +@RequiredArgsConstructor +@Validated +public class WxUserInfoController extends BaseController { + + private final WxUserInfoApplicationService applicationService; + + @Operation(summary = "微信用户列表") + @GetMapping + public ResponseDTO> list(SearchWxUserInfoQuery query) { + PageDTO page = applicationService.getWxUserList(query); + return ResponseDTO.ok(page); + } + + @Operation(summary = "新增微信用户") + @AccessLog(title = "微信用户管理", businessType = BusinessTypeEnum.ADD) + @PostMapping + public ResponseDTO add(@Validated @RequestBody AddWxUserInfoCommand command) { + applicationService.addWxUser(command); + return ResponseDTO.ok(); + } + + @Operation(summary = "修改微信用户") + @AccessLog(title = "微信用户管理", businessType = BusinessTypeEnum.MODIFY) + @PutMapping("/{id}") + public ResponseDTO edit(@PathVariable Long id, @Validated @RequestBody UpdateWxUserInfoCommand command) { + command.setWxUserId(id); + applicationService.updateWxUser(command); + return ResponseDTO.ok(); + } + + @Operation(summary = "删除微信用户") + @AccessLog(title = "微信用户管理", businessType = BusinessTypeEnum.DELETE) + @DeleteMapping("/{ids}") + public ResponseDTO remove(@PathVariable @NotNull List ids) { + applicationService.deleteWxUser(new BulkOperationCommand<>(ids)); + return ResponseDTO.ok(); + } +} \ No newline at end of file diff --git a/agileboot-domain/src/main/java/com/agileboot/domain/shop/wxuser/WxUserInfoApplicationService.java b/agileboot-domain/src/main/java/com/agileboot/domain/shop/wxuser/WxUserInfoApplicationService.java new file mode 100644 index 0000000..ab10715 --- /dev/null +++ b/agileboot-domain/src/main/java/com/agileboot/domain/shop/wxuser/WxUserInfoApplicationService.java @@ -0,0 +1,51 @@ +package com.agileboot.domain.shop.wxuser; + +import com.agileboot.common.core.page.PageDTO; +import com.agileboot.domain.common.command.BulkOperationCommand; +import com.agileboot.domain.shop.wxuser.command.AddWxUserInfoCommand; +import com.agileboot.domain.shop.wxuser.command.UpdateWxUserInfoCommand; +import com.agileboot.domain.shop.wxuser.db.WxUserInfoEntity; +import com.agileboot.domain.shop.wxuser.db.WxUserInfoService; +import com.agileboot.domain.shop.wxuser.dto.WxUserInfoDTO; +import com.agileboot.domain.shop.wxuser.model.WxUserInfoModel; +import com.agileboot.domain.shop.wxuser.model.WxUserInfoModelFactory; +import com.agileboot.domain.shop.wxuser.query.SearchWxUserInfoQuery; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import java.util.List; +import java.util.stream.Collectors; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +@Service +@RequiredArgsConstructor +public class WxUserInfoApplicationService { + private final WxUserInfoService wxUserInfoService; + private final WxUserInfoModelFactory wxUserInfoModelFactory; + + public PageDTO getWxUserList(SearchWxUserInfoQuery query) { + Page page = wxUserInfoService.getWxUserInfoList(query); + List dtoList = page.getRecords().stream() + .map(WxUserInfoDTO::new) + .collect(Collectors.toList()); + return new PageDTO<>(dtoList, page.getTotal()); + } + + public void addWxUser(AddWxUserInfoCommand command) { + WxUserInfoModel model = wxUserInfoModelFactory.create(); + model.loadAddCommand(command); + model.insert(); + } + + public void updateWxUser(UpdateWxUserInfoCommand command) { + WxUserInfoModel model = wxUserInfoModelFactory.loadById(command.getWxUserId()); + model.loadUpdateCommand(command); + model.updateById(); + } + + public void deleteWxUser(BulkOperationCommand command) { + for (Long id : command.getIds()) { + WxUserInfoModel model = wxUserInfoModelFactory.loadById(id); + model.deleteById(); + } + } +} \ No newline at end of file diff --git a/agileboot-domain/src/main/java/com/agileboot/domain/shop/wxuser/command/AddWxUserInfoCommand.java b/agileboot-domain/src/main/java/com/agileboot/domain/shop/wxuser/command/AddWxUserInfoCommand.java new file mode 100644 index 0000000..720c514 --- /dev/null +++ b/agileboot-domain/src/main/java/com/agileboot/domain/shop/wxuser/command/AddWxUserInfoCommand.java @@ -0,0 +1,11 @@ +package com.agileboot.domain.shop.wxuser.command; + +import com.agileboot.domain.shop.wxuser.db.WxUserInfoEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +@EqualsAndHashCode(callSuper = true) +@Data +public class AddWxUserInfoCommand extends WxUserInfoEntity { + +} \ No newline at end of file diff --git a/agileboot-domain/src/main/java/com/agileboot/domain/shop/wxuser/command/UpdateWxUserInfoCommand.java b/agileboot-domain/src/main/java/com/agileboot/domain/shop/wxuser/command/UpdateWxUserInfoCommand.java new file mode 100644 index 0000000..a1634de --- /dev/null +++ b/agileboot-domain/src/main/java/com/agileboot/domain/shop/wxuser/command/UpdateWxUserInfoCommand.java @@ -0,0 +1,16 @@ +package com.agileboot.domain.shop.wxuser.command; + +import javax.validation.constraints.NotNull; +import javax.validation.constraints.PositiveOrZero; +import lombok.Data; +import lombok.EqualsAndHashCode; + +@EqualsAndHashCode(callSuper = true) +@Data +public class UpdateWxUserInfoCommand extends AddWxUserInfoCommand { + + @NotNull + @PositiveOrZero + private Long wxUserId; + +} \ No newline at end of file diff --git a/agileboot-domain/src/main/java/com/agileboot/domain/shop/wxuser/db/WxUserInfoEntity.java b/agileboot-domain/src/main/java/com/agileboot/domain/shop/wxuser/db/WxUserInfoEntity.java new file mode 100644 index 0000000..8f18fb1 --- /dev/null +++ b/agileboot-domain/src/main/java/com/agileboot/domain/shop/wxuser/db/WxUserInfoEntity.java @@ -0,0 +1,56 @@ +package com.agileboot.domain.shop.wxuser.db; + +import com.agileboot.common.core.base.BaseEntity; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import java.io.Serializable; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Getter; +import lombok.Setter; + +/** + *

+ * 微信用户基本信息表 + *

+ * + * @author valarchie + * @since 2025-04-07 + */ +@Getter +@Setter +@TableName("wx_user_info") +@ApiModel(value = "WxUserInfoEntity对象", description = "微信用户基本信息表") +public class WxUserInfoEntity extends BaseEntity { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("微信用户唯一ID") + @TableId(value = "wx_user_id", type = IdType.AUTO) + private Long wxUserId; + + @ApiModelProperty("微信开放平台唯一标识") + @TableField("openid") + private String openid; + + @ApiModelProperty("用户昵称") + @TableField("nickname") + private String nickname; + + @ApiModelProperty("性别(0未知 1男 2女)") + @TableField("sex") + private Integer sex; + + @ApiModelProperty("手机号码") + @TableField("mobile") + private String mobile; + + + @Override + public Serializable pkVal() { + return this.wxUserId; + } + +} diff --git a/agileboot-domain/src/main/java/com/agileboot/domain/shop/wxuser/db/WxUserInfoMapper.java b/agileboot-domain/src/main/java/com/agileboot/domain/shop/wxuser/db/WxUserInfoMapper.java new file mode 100644 index 0000000..3e84e4d --- /dev/null +++ b/agileboot-domain/src/main/java/com/agileboot/domain/shop/wxuser/db/WxUserInfoMapper.java @@ -0,0 +1,46 @@ +package com.agileboot.domain.shop.wxuser.db; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import java.util.List; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; + +/** + *

+ * 微信用户基本信息表 Mapper 接口 + *

+ * + * @author valarchie + * @since 2025-04-07 + */ +public interface WxUserInfoMapper extends BaseMapper { + @Select("SELECT wx_user_id, openid, nickname, sex, mobile " + + "FROM wx_user_info " + + "${ew.customSqlSegment}") + Page getWxUserInfoList( + Page page, + @Param(Constants.WRAPPER) Wrapper queryWrapper + ); + + @Select("SELECT * " + + "FROM wx_user_info " + + "WHERE enable = '1' " + + "ORDER BY create_time DESC " + + "LIMIT 1") + WxUserInfoEntity selectFirstEnabled(); + + @Select("SELECT * " + + "FROM wx_user_info " + + "WHERE enable = '1' " + + "ORDER BY create_time DESC") + List selectAllEnabled(); + + @Select("SELECT * FROM wx_user_info WHERE openid = #{openid} LIMIT 1") + WxUserInfoEntity selectByOpenid(String openid); + + @Select("SELECT * FROM wx_user_info WHERE wx_user_id = #{wxUserId} LIMIT 1") + WxUserInfoEntity selectByWxUserId(Long wxUserId); +} diff --git a/agileboot-domain/src/main/java/com/agileboot/domain/shop/wxuser/db/WxUserInfoService.java b/agileboot-domain/src/main/java/com/agileboot/domain/shop/wxuser/db/WxUserInfoService.java new file mode 100644 index 0000000..40ab40b --- /dev/null +++ b/agileboot-domain/src/main/java/com/agileboot/domain/shop/wxuser/db/WxUserInfoService.java @@ -0,0 +1,27 @@ +package com.agileboot.domain.shop.wxuser.db; + +import com.agileboot.common.core.page.AbstractPageQuery; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.List; + +/** + *

+ * 微信用户基本信息表 服务类 + *

+ * + * @author valarchie + * @since 2025-04-07 + */ +public interface WxUserInfoService extends IService { + Page getWxUserInfoList(AbstractPageQuery query); + + List selectAllEnabled(); + + WxUserInfoEntity selectFirstEnabled(); + + WxUserInfoEntity selectByOpenid(String openid); + + WxUserInfoEntity selectByWxUserId(Long wxUserId); +} diff --git a/agileboot-domain/src/main/java/com/agileboot/domain/shop/wxuser/db/WxUserInfoServiceImpl.java b/agileboot-domain/src/main/java/com/agileboot/domain/shop/wxuser/db/WxUserInfoServiceImpl.java new file mode 100644 index 0000000..e85bf62 --- /dev/null +++ b/agileboot-domain/src/main/java/com/agileboot/domain/shop/wxuser/db/WxUserInfoServiceImpl.java @@ -0,0 +1,46 @@ +package com.agileboot.domain.shop.wxuser.db; + +import com.agileboot.common.core.page.AbstractPageQuery; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + *

+ * 微信用户基本信息表 服务实现类 + *

+ * + * @author valarchie + * @since 2025-04-07 + */ +@Service +public class WxUserInfoServiceImpl extends ServiceImpl implements WxUserInfoService { + + @Override + public Page getWxUserInfoList(AbstractPageQuery query) { + return this.page(query.toPage(), query.toQueryWrapper()); + } + + @Override + public List selectAllEnabled() { + return baseMapper.selectAllEnabled(); + } + + @Override + public WxUserInfoEntity selectFirstEnabled() { + return baseMapper.selectFirstEnabled(); + } + + @Override + public WxUserInfoEntity selectByOpenid(String openid) { + return baseMapper.selectByOpenid(openid); + } + + @Override + public WxUserInfoEntity selectByWxUserId(Long wxUserId) { + return baseMapper.selectByWxUserId(wxUserId); + } +} diff --git a/agileboot-domain/src/main/java/com/agileboot/domain/shop/wxuser/dto/WxUserInfoDTO.java b/agileboot-domain/src/main/java/com/agileboot/domain/shop/wxuser/dto/WxUserInfoDTO.java new file mode 100644 index 0000000..17945e5 --- /dev/null +++ b/agileboot-domain/src/main/java/com/agileboot/domain/shop/wxuser/dto/WxUserInfoDTO.java @@ -0,0 +1,48 @@ +package com.agileboot.domain.shop.wxuser.dto; + +import cn.hutool.core.bean.BeanUtil; +import com.agileboot.common.annotation.ExcelColumn; +import com.agileboot.common.annotation.ExcelSheet; +import com.agileboot.domain.common.cache.CacheCenter; +import com.agileboot.domain.shop.wxuser.db.WxUserInfoEntity; +import com.agileboot.domain.system.user.db.SysUserEntity; +import lombok.Data; + +@ExcelSheet(name = "微信用户信息列表") +@Data +public class WxUserInfoDTO { + + public WxUserInfoDTO(WxUserInfoEntity entity) { + if (entity != null) { + BeanUtil.copyProperties(entity, this); + + switch (entity.getSex()) { + case 1: + this.sexStr = "男"; + break; + case 2: + this.sexStr = "女"; + break; + default: + this.sexStr = "未知"; + } + } + } + + @ExcelColumn(name = "微信用户ID") + private Long wxUserId; + + @ExcelColumn(name = "微信开放平台ID") + private String openid; + + @ExcelColumn(name = "用户昵称") + private String nickname; + + private Integer sex; + + @ExcelColumn(name = "性别") + private String sexStr; + + @ExcelColumn(name = "手机号码") + private String mobile; +} \ No newline at end of file diff --git a/agileboot-domain/src/main/java/com/agileboot/domain/shop/wxuser/model/WxUserInfoModel.java b/agileboot-domain/src/main/java/com/agileboot/domain/shop/wxuser/model/WxUserInfoModel.java new file mode 100644 index 0000000..8d14489 --- /dev/null +++ b/agileboot-domain/src/main/java/com/agileboot/domain/shop/wxuser/model/WxUserInfoModel.java @@ -0,0 +1,37 @@ +package com.agileboot.domain.shop.wxuser.model; + +import cn.hutool.core.bean.BeanUtil; +import com.agileboot.domain.shop.wxuser.db.WxUserInfoEntity; +import com.agileboot.domain.shop.wxuser.db.WxUserInfoService; +import lombok.Data; +import lombok.EqualsAndHashCode; + +@EqualsAndHashCode(callSuper = true) +@Data +public class WxUserInfoModel extends WxUserInfoEntity { + + private WxUserInfoService wxUserInfoService; + + public WxUserInfoModel(WxUserInfoEntity entity, WxUserInfoService wxUserInfoService) { + this(wxUserInfoService); + if (entity != null) { + BeanUtil.copyProperties(entity, this); + } + } + + public WxUserInfoModel(WxUserInfoService wxUserInfoService) { + this.wxUserInfoService = wxUserInfoService; + } + + public void loadAddCommand(Object addCommand) { + if (addCommand != null) { + BeanUtil.copyProperties(addCommand, this, "id"); + } + } + + public void loadUpdateCommand(Object updateCommand) { + if (updateCommand != null) { + loadAddCommand(updateCommand); + } + } +} \ No newline at end of file diff --git a/agileboot-domain/src/main/java/com/agileboot/domain/shop/wxuser/model/WxUserInfoModelFactory.java b/agileboot-domain/src/main/java/com/agileboot/domain/shop/wxuser/model/WxUserInfoModelFactory.java new file mode 100644 index 0000000..d876f99 --- /dev/null +++ b/agileboot-domain/src/main/java/com/agileboot/domain/shop/wxuser/model/WxUserInfoModelFactory.java @@ -0,0 +1,27 @@ +package com.agileboot.domain.shop.wxuser.model; + +import com.agileboot.common.exception.ApiException; +import com.agileboot.common.exception.error.ErrorCode; +import com.agileboot.domain.shop.wxuser.db.WxUserInfoEntity; +import com.agileboot.domain.shop.wxuser.db.WxUserInfoService; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Component; + +@Component +@RequiredArgsConstructor +public class WxUserInfoModelFactory { + + private final WxUserInfoService wxUserInfoService; + + public WxUserInfoModel loadById(Long wxUserId) { + WxUserInfoEntity entity = wxUserInfoService.getById(wxUserId); + if (entity == null) { + throw new ApiException(ErrorCode.Business.COMMON_OBJECT_NOT_FOUND, wxUserId, "微信用户"); + } + return new WxUserInfoModel(entity, wxUserInfoService); + } + + public WxUserInfoModel create() { + return new WxUserInfoModel(wxUserInfoService); + } +} \ No newline at end of file diff --git a/agileboot-domain/src/main/java/com/agileboot/domain/shop/wxuser/query/SearchWxUserInfoQuery.java b/agileboot-domain/src/main/java/com/agileboot/domain/shop/wxuser/query/SearchWxUserInfoQuery.java new file mode 100644 index 0000000..08605fc --- /dev/null +++ b/agileboot-domain/src/main/java/com/agileboot/domain/shop/wxuser/query/SearchWxUserInfoQuery.java @@ -0,0 +1,38 @@ +package com.agileboot.domain.shop.wxuser.query; + +import cn.hutool.core.util.StrUtil; +import com.agileboot.common.core.page.AbstractPageQuery; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import java.util.Date; +import lombok.Data; +import lombok.EqualsAndHashCode; + +@EqualsAndHashCode(callSuper = true) +@Data +public class SearchWxUserInfoQuery extends AbstractPageQuery { + + private Long wxUserId; + private String openid; + private String nickname; + private Integer sex; + private String mobile; + private Date startTime; + private Date endTime; + + @Override + public QueryWrapper addQueryCondition() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + + queryWrapper + .eq(wxUserId != null, "wx_user_id", wxUserId) + .eq(StrUtil.isNotEmpty(openid), "openid", openid) + .like(StrUtil.isNotEmpty(nickname), "nickname", nickname) + .eq(sex != null, "sex", sex) + .eq(StrUtil.isNotEmpty(mobile), "mobile", mobile) + .between(startTime != null && endTime != null, "create_time", startTime, endTime); + + this.timeRangeColumn = "create_time"; + + return queryWrapper; + } +} \ No newline at end of file diff --git a/agileboot-domain/src/main/resources/mapper/shop/WxUserInfoMapper.xml b/agileboot-domain/src/main/resources/mapper/shop/WxUserInfoMapper.xml new file mode 100644 index 0000000..2825ce8 --- /dev/null +++ b/agileboot-domain/src/main/resources/mapper/shop/WxUserInfoMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/agileboot-infrastructure/src/main/java/com/agileboot/infrastructure/mybatisplus/CodeGenerator.java b/agileboot-infrastructure/src/main/java/com/agileboot/infrastructure/mybatisplus/CodeGenerator.java index 8ef4bdb..d810fa6 100644 --- a/agileboot-infrastructure/src/main/java/com/agileboot/infrastructure/mybatisplus/CodeGenerator.java +++ b/agileboot-infrastructure/src/main/java/com/agileboot/infrastructure/mybatisplus/CodeGenerator.java @@ -61,7 +61,7 @@ public class CodeGenerator { //生成的类 放在orm子模块下的/target/generated-code目录底下 .module("/agileboot-orm/target/generated-code") .parentPackage("com.agileboot") - .tableName("return_approval") + .tableName("wx_user_info") // 决定是否继承基类 .isExtendsFromBaseEntity(true) .build();