feat(credit): 添加用户真实姓名关联查询功能

- 在多个实体类中添加 realName 字段用于显示用户真实姓名
- 更新 XML 映射文件以关联查询 sys_user 表中的真实姓名
- 统一为所有信用相关实体添加真实姓名查询支持
- 修复了多个实体缺少 TableField 注解导入的问题
- 实现了跨库关联查询以获取用户的完整信息
This commit is contained in:
2026-01-20 01:41:44 +08:00
parent e647a5d066
commit e36524de3a
52 changed files with 163 additions and 26 deletions

View File

@@ -81,6 +81,10 @@ public class CreditAdministrativeLicense implements Serializable {
@Schema(description = "用户ID")
private Integer userId;
@Schema(description = "真实姓名")
@TableField(exist = false)
private String realName;
@Schema(description = "租户id")
private Integer tenantId;

View File

@@ -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 com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;
@@ -67,6 +68,10 @@ public class CreditBankruptcy implements Serializable {
@Schema(description = "用户ID")
private Integer userId;
@Schema(description = "真实姓名")
@TableField(exist = false)
private String realName;
@Schema(description = "租户id")
private Integer tenantId;

View File

@@ -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 com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;
@@ -67,6 +68,10 @@ public class CreditBranch implements Serializable {
@Schema(description = "用户ID")
private Integer userId;
@Schema(description = "真实姓名")
@TableField(exist = false)
private String realName;
@Schema(description = "租户id")
private Integer tenantId;

View File

@@ -93,6 +93,10 @@ public class CreditBreachOfTrust implements Serializable {
@Schema(description = "用户ID")
private Integer userId;
@Schema(description = "真实姓名")
@TableField(exist = false)
private String realName;
@Schema(description = "租户id")
private Integer tenantId;

View File

@@ -90,6 +90,10 @@ public class CreditCaseFiling implements Serializable {
@Schema(description = "用户ID")
private Integer userId;
@Schema(description = "真实姓名")
@TableField(exist = false)
private String realName;
@Schema(description = "租户id")
private Integer tenantId;

View File

@@ -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 com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;
@@ -200,6 +201,10 @@ public class CreditCompany implements Serializable {
@Schema(description = "用户ID")
private Integer userId;
@Schema(description = "真实姓名")
@TableField(exist = false)
private String realName;
@Schema(description = "租户id")
private Integer tenantId;

View File

@@ -84,6 +84,10 @@ public class CreditCompetitor implements Serializable {
@Schema(description = "用户ID")
private Integer userId;
@Schema(description = "真实姓名")
@TableField(exist = false)
private String realName;
@Schema(description = "租户id")
private Integer tenantId;

View File

@@ -89,6 +89,10 @@ public class CreditCourtAnnouncement implements Serializable {
@Schema(description = "用户ID")
private Integer userId;
@Schema(description = "真实姓名")
@TableField(exist = false)
private String realName;
@Schema(description = "租户id")
private Integer tenantId;

View File

@@ -90,6 +90,10 @@ public class CreditCourtSession implements Serializable {
@Schema(description = "用户ID")
private Integer userId;
@Schema(description = "真实姓名")
@TableField(exist = false)
private String realName;
@Schema(description = "租户id")
private Integer tenantId;

View File

@@ -74,6 +74,10 @@ public class CreditCustomer implements Serializable {
@Schema(description = "用户ID")
private Integer userId;
@Schema(description = "真实姓名")
@TableField(exist = false)
private String realName;
@Schema(description = "租户id")
private Integer tenantId;

View File

@@ -90,6 +90,10 @@ public class CreditDeliveryNotice implements Serializable {
@Schema(description = "用户ID")
private Integer userId;
@Schema(description = "真实姓名")
@TableField(exist = false)
private String realName;
@Schema(description = "租户id")
private Integer tenantId;

View File

@@ -101,6 +101,10 @@ public class CreditExternal implements Serializable {
@Schema(description = "用户ID")
private Integer userId;
@Schema(description = "真实姓名")
@TableField(exist = false)
private String realName;
@Schema(description = "租户id")
private Integer tenantId;

View File

@@ -83,6 +83,10 @@ public class CreditFinalVersion implements Serializable {
@Schema(description = "用户ID")
private Integer userId;
@Schema(description = "真实姓名")
@TableField(exist = false)
private String realName;
@Schema(description = "租户id")
private Integer tenantId;

View File

@@ -89,6 +89,10 @@ public class CreditGqdj implements Serializable {
@Schema(description = "用户ID")
private Integer userId;
@Schema(description = "真实姓名")
@TableField(exist = false)
private String realName;
@Schema(description = "租户id")
private Integer tenantId;

View File

@@ -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 com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;
@@ -61,6 +62,10 @@ public class CreditHistoricalLegalPerson implements Serializable {
@Schema(description = "用户ID")
private Integer userId;
@Schema(description = "真实姓名")
@TableField(exist = false)
private String realName;
@Schema(description = "租户id")
private Integer tenantId;

View File

@@ -84,6 +84,10 @@ public class CreditJudgmentDebtor implements Serializable {
@Schema(description = "用户ID")
private Integer userId;
@Schema(description = "真实姓名")
@TableField(exist = false)
private String realName;
@Schema(description = "租户id")
private Integer tenantId;

View File

@@ -93,6 +93,10 @@ public class CreditJudicialDocument implements Serializable {
@Schema(description = "用户ID")
private Integer userId;
@Schema(description = "真实姓名")
@TableField(exist = false)
private String realName;
@Schema(description = "租户id")
private Integer tenantId;

View File

@@ -109,6 +109,10 @@ public class CreditJudiciary implements Serializable {
@Schema(description = "用户ID")
private Integer userId;
@Schema(description = "真实姓名")
@TableField(exist = false)
private String realName;
@Schema(description = "租户id")
private Integer tenantId;

View File

@@ -90,6 +90,10 @@ public class CreditMediation implements Serializable {
@Schema(description = "用户ID")
private Integer userId;
@Schema(description = "真实姓名")
@TableField(exist = false)
private String realName;
@Schema(description = "租户id")
private Integer tenantId;

View File

@@ -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 com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;
@@ -208,6 +209,10 @@ public class CreditNearbyCompany implements Serializable {
@Schema(description = "用户ID")
private Integer userId;
@Schema(description = "真实姓名")
@TableField(exist = false)
private String realName;
@Schema(description = "租户id")
private Integer tenantId;

View File

@@ -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 com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;
@@ -79,6 +80,10 @@ public class CreditPatent implements Serializable {
@Schema(description = "用户ID")
private Integer userId;
@Schema(description = "真实姓名")
@TableField(exist = false)
private String realName;
@Schema(description = "租户id")
private Integer tenantId;

View File

@@ -73,6 +73,10 @@ public class CreditRiskRelation implements Serializable {
@Schema(description = "用户ID")
private Integer userId;
@Schema(description = "真实姓名")
@TableField(exist = false)
private String realName;
@Schema(description = "租户id")
private Integer tenantId;

View File

@@ -74,6 +74,10 @@ public class CreditSupplier implements Serializable {
@Schema(description = "用户ID")
private Integer userId;
@Schema(description = "真实姓名")
@TableField(exist = false)
private String realName;
@Schema(description = "租户id")
private Integer tenantId;

View File

@@ -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 com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;
@@ -76,6 +77,10 @@ public class CreditSuspectedRelationship implements Serializable {
@Schema(description = "用户ID")
private Integer userId;
@Schema(description = "真实姓名")
@TableField(exist = false)
private String realName;
@Schema(description = "租户id")
private Integer tenantId;

View File

@@ -101,6 +101,10 @@ public class CreditUser implements Serializable {
@Schema(description = "用户ID")
private Integer userId;
@Schema(description = "真实姓名")
@TableField(exist = false)
private String realName;
@Schema(description = "租户id")
private Integer tenantId;

View File

@@ -92,6 +92,10 @@ public class CreditXgxf implements Serializable {
@Schema(description = "用户ID")
private Integer userId;
@Schema(description = "真实姓名")
@TableField(exist = false)
private String realName;
@Schema(description = "租户id")
private Integer tenantId;

View File

@@ -4,9 +4,10 @@
<!-- 关联查询sql -->
<sql id="selectSql">
SELECT a.*
SELECT a.*, u.real_name AS realName
FROM credit_administrative_license a
LEFT JOIN credit_company b ON a.company_id = b.id
LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id
<where>
<if test="param.id != null">
AND a.id = #{param.id}

View File

@@ -4,8 +4,9 @@
<!-- 关联查询sql -->
<sql id="selectSql">
SELECT a.*
SELECT a.*, u.real_name AS realName
FROM credit_bankruptcy a
LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id
<where>
<if test="param.id != null">

View File

@@ -4,9 +4,10 @@
<!-- 关联查询sql -->
<sql id="selectSql">
SELECT a.*
SELECT a.*, u.real_name AS realName
FROM credit_branch a
LEFT JOIN credit_company b ON a.company_id = b.id
LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id
<where>
<if test="param.id != null">
AND a.id = #{param.id}

View File

@@ -4,9 +4,10 @@
<!-- 关联查询sql -->
<sql id="selectSql">
SELECT a.*, b.name AS companyName
SELECT a.*, b.name AS companyName, u.real_name AS realName
FROM credit_breach_of_trust a
LEFT JOIN credit_company b ON a.company_id = b.id
LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id
<where>
<if test="param.id != null">
AND a.id = #{param.id}

View File

@@ -4,9 +4,10 @@
<!-- 关联查询sql -->
<sql id="selectSql">
SELECT a.*, b.name AS companyName
SELECT a.*, b.name AS companyName, u.real_name AS realName
FROM credit_case_filing a
LEFT JOIN credit_company b ON a.company_id = b.id
LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id
<where>
<if test="param.id != null">
AND a.id = #{param.id}

View File

@@ -4,8 +4,9 @@
<!-- 关联查询sql -->
<sql id="selectSql">
SELECT a.*
SELECT a.*, u.real_name AS realName
FROM credit_company a
LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id
<where>
<if test="param.id != null">
AND a.id = #{param.id}

View File

@@ -4,9 +4,10 @@
<!-- 关联查询sql -->
<sql id="selectSql">
SELECT a.*, b.name AS mainCompanyName
SELECT a.*, b.name AS mainCompanyName, u.real_name AS realName
FROM credit_competitor a
LEFT JOIN credit_company b ON a.company_id = b.id
LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id
<where>
<if test="param.id != null">
AND a.id = #{param.id}

View File

@@ -4,9 +4,10 @@
<!-- 关联查询sql -->
<sql id="selectSql">
SELECT a.*, b.name AS companyName
SELECT a.*, b.name AS companyName, u.real_name AS realName
FROM credit_court_announcement a
LEFT JOIN credit_company b ON a.company_id = b.id
LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id
<where>
<if test="param.id != null">
AND a.id = #{param.id}

View File

@@ -4,9 +4,10 @@
<!-- 关联查询sql -->
<sql id="selectSql">
SELECT a.*, b.name AS companyName
SELECT a.*, b.name AS companyName, u.real_name AS realName
FROM credit_court_session a
LEFT JOIN credit_company b ON a.company_id = b.id
LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id
<where>
<if test="param.id != null">
AND a.id = #{param.id}

View File

@@ -4,9 +4,10 @@
<!-- 关联查询sql -->
<sql id="selectSql">
SELECT a.*, b.name AS companyName
SELECT a.*, b.name AS companyName, u.real_name AS realName
FROM credit_customer a
LEFT JOIN credit_company b ON a.company_id = b.id
LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id
<where>
<if test="param.id != null">
AND a.id = #{param.id}

View File

@@ -4,9 +4,10 @@
<!-- 关联查询sql -->
<sql id="selectSql">
SELECT a.*, b.name AS companyName
SELECT a.*, b.name AS companyName, u.real_name AS realName
FROM credit_delivery_notice a
LEFT JOIN credit_company b ON a.company_id = b.id
LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id
<where>
<if test="param.id != null">
AND a.id = #{param.id}

View File

@@ -4,9 +4,10 @@
<!-- 关联查询sql -->
<sql id="selectSql">
SELECT a.*, b.name AS companyName
SELECT a.*, b.name AS companyName, u.real_name AS realName
FROM credit_external a
LEFT JOIN credit_company b ON a.company_id = b.id
LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id
<where>
<if test="param.id != null">
AND a.id = #{param.id}

View File

@@ -4,9 +4,10 @@
<!-- 关联查询sql -->
<sql id="selectSql">
SELECT a.*, b.name AS companyName
SELECT a.*, b.name AS companyName, u.real_name AS realName
FROM credit_final_version a
LEFT JOIN credit_company b ON a.company_id = b.id
LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id
<where>
<if test="param.id != null">
AND a.id = #{param.id}

View File

@@ -4,9 +4,10 @@
<!-- 关联查询sql -->
<sql id="selectSql">
SELECT a.*, b.name AS companyName
SELECT a.*, b.name AS companyName, u.real_name AS realName
FROM credit_gqdj a
LEFT JOIN credit_company b ON a.company_id = b.id
LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id
<where>
<if test="param.id != null">
AND a.id = #{param.id}

View File

@@ -4,9 +4,10 @@
<!-- 关联查询sql -->
<sql id="selectSql">
SELECT a.*
SELECT a.*, u.real_name AS realName
FROM credit_historical_legal_person a
LEFT JOIN credit_company b ON a.company_id = b.id
LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id
<where>
<if test="param.id != null">
AND a.id = #{param.id}

View File

@@ -4,9 +4,10 @@
<!-- 关联查询sql -->
<sql id="selectSql">
SELECT a.*, b.name AS companyName
SELECT a.*, b.name AS companyName, u.real_name AS realName
FROM credit_judgment_debtor a
LEFT JOIN credit_company b ON a.company_id = b.id
LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id
<where>
<if test="param.id != null">
AND a.id = #{param.id}

View File

@@ -4,9 +4,10 @@
<!-- 关联查询sql -->
<sql id="selectSql">
SELECT a.*, b.name AS companyName
SELECT a.*, b.name AS companyName, u.real_name AS realName
FROM credit_judicial_document a
LEFT JOIN credit_company b ON a.company_id = b.id
LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id
<where>
<if test="param.id != null">
AND a.id = #{param.id}

View File

@@ -4,9 +4,10 @@
<!-- 关联查询sql -->
<sql id="selectSql">
SELECT a.*, b.name AS companyName
SELECT a.*, b.name AS companyName, u.real_name AS realName
FROM credit_judiciary a
LEFT JOIN credit_company b ON a.company_id = b.id
LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id
<where>
<if test="param.id != null">
AND a.id = #{param.id}

View File

@@ -4,9 +4,10 @@
<!-- 关联查询sql -->
<sql id="selectSql">
SELECT a.*, b.name AS companyName
SELECT a.*, b.name AS companyName, u.real_name AS realName
FROM credit_mediation a
LEFT JOIN credit_company b ON a.company_id = b.id
LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id
<where>
<if test="param.id != null">
AND a.id = #{param.id}

View File

@@ -4,9 +4,10 @@
<!-- 关联查询sql -->
<sql id="selectSql">
SELECT a.*
SELECT a.*, u.real_name AS realName
FROM credit_nearby_company a
LEFT JOIN credit_company b ON a.company_id = b.id
LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id
<where>
<if test="param.id != null">
AND a.id = #{param.id}

View File

@@ -4,9 +4,10 @@
<!-- 关联查询sql -->
<sql id="selectSql">
SELECT a.*
SELECT a.*, u.real_name AS realName
FROM credit_patent a
LEFT JOIN credit_company b ON a.company_id = b.id
LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id
<where>
<if test="param.id != null">
AND a.id = #{param.id}

View File

@@ -4,9 +4,10 @@
<!-- 关联查询sql -->
<sql id="selectSql">
SELECT a.*, b.name AS companyName
SELECT a.*, b.name AS companyName, u.real_name AS realName
FROM credit_risk_relation a
LEFT JOIN credit_company b ON a.company_id = b.id
LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id
<where>
<if test="param.id != null">
AND a.id = #{param.id}

View File

@@ -4,9 +4,10 @@
<!-- 关联查询sql -->
<sql id="selectSql">
SELECT a.*, b.name AS companyName
SELECT a.*, b.name AS companyName, u.real_name AS realName
FROM credit_supplier a
LEFT JOIN credit_company b ON a.company_id = b.id
LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id
<where>
<if test="param.id != null">
AND a.id = #{param.id}

View File

@@ -4,9 +4,10 @@
<!-- 关联查询sql -->
<sql id="selectSql">
SELECT a.*
SELECT a.*, u.real_name AS realName
FROM credit_suspected_relationship a
LEFT JOIN credit_company b ON a.company_id = b.id
LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id
<where>
<if test="param.id != null">
AND a.id = #{param.id}

View File

@@ -4,9 +4,10 @@
<!-- 关联查询sql -->
<sql id="selectSql">
SELECT a.*, b.name AS companyName
SELECT a.*, b.name AS companyName, u.real_name AS realName
FROM credit_user a
LEFT JOIN credit_company b ON a.company_id = b.id
LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id
<where>
<if test="param.id != null">
AND a.id = #{param.id}

View File

@@ -4,9 +4,10 @@
<!-- 关联查询sql -->
<sql id="selectSql">
SELECT a.*, b.name AS companyName
SELECT a.*, b.name AS companyName, u.real_name AS realName
FROM credit_xgxf a
LEFT JOIN credit_company b ON a.company_id = b.id
LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id
<where>
<if test="param.id != null">
AND a.id = #{param.id}