feat(customer): 添加客户实体用户关联字段支持
- 修改application.yml配置文件激活环境从glt2切换到ysb2 - 在CreditMpCustomer实体类中新增nickname、phone、avatar三个关联字段 - 为新增字段添加TableField注解标记为非数据库字段 - 更新CreditMpCustomerMapper.xml中的关联查询SQL - 添加LEFT JOIN子句关联sys_user表获取用户信息 - 查询结果中包含用户昵称、头像、手机号等扩展信息
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.gxwebsoft.credit.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
@@ -79,6 +80,18 @@ public class CreditMpCustomer implements Serializable {
|
||||
@Schema(description = "用户ID")
|
||||
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 = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
|
||||
@@ -4,8 +4,9 @@
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
SELECT a.*, u.nickname AS nickname, u.avatar AS avatar, u.phone AS phone
|
||||
FROM credit_mp_customer a
|
||||
LEFT JOIN gxwebsoft_core.sys_user u ON u.id = a.user_id
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
|
||||
@@ -4,7 +4,7 @@ server:
|
||||
# 多环境配置
|
||||
spring:
|
||||
profiles:
|
||||
active: glt2
|
||||
active: ysb2
|
||||
|
||||
application:
|
||||
name: server
|
||||
|
||||
Reference in New Issue
Block a user