feat(credit): 添加主体企业名称关联查询功能

- 在多个实体类中添加companyName字段用于显示主体企业名称
- 修改XML映射文件实现与credit_company表的左连接查询
- 将企业名称作为companyName字段返回到查询结果中
- 修复CreditBranch实体类中字段描述的一致性问题
- 更新CreditNearbyCompany的关键词搜索逻辑以支持企业名称搜索
This commit is contained in:
2026-01-22 08:51:32 +08:00
parent a6aba2c49b
commit f40010433d
14 changed files with 37 additions and 8 deletions

View File

@@ -65,6 +65,10 @@ public class CreditAdministrativeLicense implements Serializable {
@Schema(description = "企业ID") @Schema(description = "企业ID")
private Integer companyId; private Integer companyId;
@Schema(description = "主体企业")
@TableField(exist = false)
private String companyName;
@Schema(description = "是否推荐") @Schema(description = "是否推荐")
private Integer recommend; private Integer recommend;

View File

@@ -52,6 +52,10 @@ public class CreditBankruptcy implements Serializable {
@Schema(description = "企业ID") @Schema(description = "企业ID")
private Integer companyId; private Integer companyId;
@Schema(description = "主体企业")
@TableField(exist = false)
private String companyName;
@Schema(description = "是否推荐") @Schema(description = "是否推荐")
private Integer recommend; private Integer recommend;

View File

@@ -52,6 +52,10 @@ public class CreditBranch implements Serializable {
@Schema(description = "企业ID") @Schema(description = "企业ID")
private Integer companyId; private Integer companyId;
@Schema(description = "主题企业")
@TableField(exist = false)
private String companyName;
@Schema(description = "是否推荐") @Schema(description = "是否推荐")
private Integer recommend; private Integer recommend;

View File

@@ -46,6 +46,10 @@ public class CreditHistoricalLegalPerson implements Serializable {
@Schema(description = "企业ID") @Schema(description = "企业ID")
private Integer companyId; private Integer companyId;
@Schema(description = "主体企业")
@TableField(exist = false)
private String companyName;
@Schema(description = "是否推荐") @Schema(description = "是否推荐")
private Integer recommend; private Integer recommend;

View File

@@ -79,6 +79,10 @@ public class CreditNearbyCompany implements Serializable {
@Schema(description = "企业ID") @Schema(description = "企业ID")
private Integer companyId; private Integer companyId;
@Schema(description = "主体企业")
@TableField(exist = false)
private String companyName;
@Schema(description = "纳税人识别号") @Schema(description = "纳税人识别号")
private String taxpayerCode; private String taxpayerCode;

View File

@@ -64,6 +64,10 @@ public class CreditPatent implements Serializable {
@Schema(description = "企业ID") @Schema(description = "企业ID")
private Integer companyId; private Integer companyId;
@Schema(description = "主体企业")
@TableField(exist = false)
private String companyName;
@Schema(description = "是否推荐") @Schema(description = "是否推荐")
private Integer recommend; private Integer recommend;

View File

@@ -61,6 +61,10 @@ public class CreditSuspectedRelationship implements Serializable {
@Schema(description = "企业ID") @Schema(description = "企业ID")
private Integer companyId; private Integer companyId;
@Schema(description = "主体企业")
@TableField(exist = false)
private String companyName;
@Schema(description = "是否推荐") @Schema(description = "是否推荐")
private Integer recommend; private Integer recommend;

View File

@@ -4,7 +4,7 @@
<!-- 关联查询sql --> <!-- 关联查询sql -->
<sql id="selectSql"> <sql id="selectSql">
SELECT a.*, u.real_name AS realName SELECT a.*, b.name AS companyName, u.real_name AS realName
FROM credit_administrative_license a FROM credit_administrative_license a
LEFT JOIN credit_company b ON a.company_id = b.id 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 LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id

View File

@@ -4,8 +4,9 @@
<!-- 关联查询sql --> <!-- 关联查询sql -->
<sql id="selectSql"> <sql id="selectSql">
SELECT a.*, u.real_name AS realName SELECT a.*, b.name AS companyName, u.real_name AS realName
FROM credit_bankruptcy a FROM credit_bankruptcy 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 LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id
<where> <where>

View File

@@ -4,7 +4,7 @@
<!-- 关联查询sql --> <!-- 关联查询sql -->
<sql id="selectSql"> <sql id="selectSql">
SELECT a.*, u.real_name AS realName SELECT a.*, b.name AS companyName, u.real_name AS realName
FROM credit_branch a FROM credit_branch a
LEFT JOIN credit_company b ON a.company_id = b.id 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 LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id

View File

@@ -4,7 +4,7 @@
<!-- 关联查询sql --> <!-- 关联查询sql -->
<sql id="selectSql"> <sql id="selectSql">
SELECT a.*, u.real_name AS realName SELECT a.*, b.name AS companyName, u.real_name AS realName
FROM credit_historical_legal_person a FROM credit_historical_legal_person a
LEFT JOIN credit_company b ON a.company_id = b.id 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 LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id

View File

@@ -4,7 +4,7 @@
<!-- 关联查询sql --> <!-- 关联查询sql -->
<sql id="selectSql"> <sql id="selectSql">
SELECT a.*, u.real_name AS realName SELECT a.*,b.name AS companyName, u.real_name AS realName
FROM credit_nearby_company a FROM credit_nearby_company a
LEFT JOIN credit_company b ON a.company_id = b.id 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 LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id
@@ -204,7 +204,7 @@
<if test="param.keywords != null"> <if test="param.keywords != null">
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%') AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
OR a.name = #{param.keywords} OR a.name = #{param.keywords}
OR b.name LIKE CONCAT('%', #{param.keywords}, '%') OR b.name LIKE CONCAT('%', #{param.keywords}, '%')
) )
</if> </if>
</where> </where>

View File

@@ -4,7 +4,7 @@
<!-- 关联查询sql --> <!-- 关联查询sql -->
<sql id="selectSql"> <sql id="selectSql">
SELECT a.*, u.real_name AS realName SELECT a.*, b.name AS companyName, u.real_name AS realName
FROM credit_patent a FROM credit_patent a
LEFT JOIN credit_company b ON a.company_id = b.id 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 LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id

View File

@@ -4,7 +4,7 @@
<!-- 关联查询sql --> <!-- 关联查询sql -->
<sql id="selectSql"> <sql id="selectSql">
SELECT a.*, u.real_name AS realName SELECT a.*, b.name AS companyName, u.real_name AS realName
FROM credit_suspected_relationship a FROM credit_suspected_relationship a
LEFT JOIN credit_company b ON a.company_id = b.id 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 LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id