feat(house): 添加用户手机号字段并关联查询
- 在 HouseInfo 实体类中新增 userPhone 字段- 配置 userPhone 字段不映射数据库表字段 - 在 HouseInfoMapper.xml 中关联查询用户手机号 - 将用户手机号别名设置为 userPhone 返回前端使用
This commit is contained in:
@@ -148,6 +148,10 @@ public class HouseInfo implements Serializable {
|
|||||||
@Schema(description = "用户ID")
|
@Schema(description = "用户ID")
|
||||||
private Integer userId;
|
private Integer userId;
|
||||||
|
|
||||||
|
@Schema(description = "用户手机号")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String userPhone;
|
||||||
|
|
||||||
@Schema(description = "是否删除, 0否, 1是")
|
@Schema(description = "是否删除, 0否, 1是")
|
||||||
@TableLogic
|
@TableLogic
|
||||||
private Integer deleted;
|
private Integer deleted;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<!-- 关联查询sql -->
|
<!-- 关联查询sql -->
|
||||||
<sql id="selectSql">
|
<sql id="selectSql">
|
||||||
SELECT a.*,
|
SELECT a.*,
|
||||||
b.nickname,b.avatar,b.grade_id
|
b.nickname,b.avatar,b.grade_id, b.phone as userPhone
|
||||||
FROM house_info a
|
FROM house_info a
|
||||||
LEFT JOIN gxwebsoft_core.sys_user b ON a.user_id = b.user_id
|
LEFT JOIN gxwebsoft_core.sys_user b ON a.user_id = b.user_id
|
||||||
<where>
|
<where>
|
||||||
|
|||||||
Reference in New Issue
Block a user