feat(mapper): 添加公司关联查询和关键词搜索功能

- 在多个Mapper XML文件中添加LEFT JOIN credit_company表关联
- 扩展关键词搜索范围,支持通过公司名称进行搜索匹配
- 更新CreditNearbyCompany相关功能,支持按公司ID筛选和导入
- 修改CreditNearbyCompanyParam中companyId字段类型为String
- 暂时注释掉纳税人识别号相关的搜索条件
- 统一各信用数据映射文件中的关键词搜索逻辑
This commit is contained in:
2026-01-15 23:33:42 +08:00
parent e810136fbb
commit 2116856167
26 changed files with 42 additions and 5 deletions

View File

@@ -137,6 +137,7 @@ public class CreditNearbyCompanyController extends BaseController {
@Operation(summary = "批量导入附近企业")
@PostMapping("/import")
public ApiResult<List<String>> importBatch(@RequestParam("file") MultipartFile file,
@RequestParam(value = "companyId", required = false) Integer companyId,
@RequestParam(value = "parentId", required = false) Integer parentId,
@RequestParam(value = "type", required = false) Integer type) {
List<String> errorMessages = new ArrayList<>();
@@ -181,6 +182,9 @@ public class CreditNearbyCompanyController extends BaseController {
if (item.getType() == null && type != null) {
item.setType(type);
}
if (item.getCompanyId() == null && companyId != null) {
item.setCompanyId(companyId);
}
if (item.getUserId() == null && currentUserId != null) {
item.setUserId(currentUserId);
}
@@ -208,6 +212,7 @@ public class CreditNearbyCompanyController extends BaseController {
CreditNearbyCompany existing = creditNearbyCompanyService.lambdaQuery()
.eq(!ImportHelper.isBlank(item.getCode()), CreditNearbyCompany::getCode, item.getCode())
.eq(ImportHelper.isBlank(item.getCode()), CreditNearbyCompany::getName, item.getName())
.eq(companyId != null, CreditNearbyCompany::getCompanyId, companyId)
.eq(parentId != null, CreditNearbyCompany::getParentId, parentId)
.eq(type != null, CreditNearbyCompany::getType, type)
.one();