feat(order): 添加订单实体扩展字段和用户关联查询

- 在GltTicketOrder实体中添加address、province、city、region等地址相关字段
- 在GltTicketOrder实体中添加nickname、phone、avatar等用户信息字段
- 所有新增字段均使用@TableField(exist = false)注解标记为非数据库字段
- 更新GltTicketOrderMapper.xml中的关联
This commit is contained in:
2026-02-06 13:36:19 +08:00
parent 46b5ce3971
commit 6285429753
2 changed files with 29 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
package com.gxwebsoft.glt.entity; package com.gxwebsoft.glt.entity;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic; import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
@@ -43,8 +44,21 @@ public class GltTicketOrder implements Serializable {
private Integer addressId; private Integer addressId;
@Schema(description = "收货地址") @Schema(description = "收货地址")
@TableField(exist = false)
private String address; private String address;
@Schema(description = "")
@TableField(exist = false)
private String province;
@Schema(description = "")
@TableField(exist = false)
private String city;
@Schema(description = "")
@TableField(exist = false)
private String region;
@Schema(description = "买家留言") @Schema(description = "买家留言")
private String buyerRemarks; private String buyerRemarks;
@@ -61,6 +75,18 @@ public class GltTicketOrder implements Serializable {
@Schema(description = "用户ID") @Schema(description = "用户ID")
private Integer userId; private Integer userId;
@Schema(description = "昵称")
@TableField(exist = false)
private String nickname;
@Schema(description = "手机号")
@TableField(exist = false)
private String phone;
@Schema(description = "头像")
@TableField(exist = false)
private String avatar;
@Schema(description = "排序(数字越小越靠前)") @Schema(description = "排序(数字越小越靠前)")
private Integer sortNumber; private Integer sortNumber;

View File

@@ -4,8 +4,10 @@
<!-- 关联查询sql --> <!-- 关联查询sql -->
<sql id="selectSql"> <sql id="selectSql">
SELECT a.* SELECT a.*, u.nickname, u.phone, u.avatar
FROM glt_ticket_order a FROM glt_ticket_order a
LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id
<where> <where>
<if test="param.id != null"> <if test="param.id != null">
AND a.id = #{param.id} AND a.id = #{param.id}