|
@@ -1,7 +1,7 @@
|
|
|
package com.etotem.cfc.controller.admin;
|
|
package com.etotem.cfc.controller.admin;
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
-import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.etotem.cfc.common.Result;
|
|
import com.etotem.cfc.common.Result;
|
|
|
import com.etotem.cfc.entity.*;
|
|
import com.etotem.cfc.entity.*;
|
|
@@ -120,13 +120,15 @@ public class ReportParserAdminController {
|
|
|
if (type.getId() != null) {
|
|
if (type.getId() != null) {
|
|
|
type.setUpdatedAt(new Date());
|
|
type.setUpdatedAt(new Date());
|
|
|
typeRegistryMapper.updateById(type);
|
|
typeRegistryMapper.updateById(type);
|
|
|
- // MyBatis-Plus updateById 默认忽略 null 字段,linkedProductId 允许清空(=NULL 表示不可链接),需显式置空
|
|
|
|
|
|
|
+ // MyBatis-Plus updateById 默认忽略 null 字段,linkedProductId 允许清空(=NULL 表示不可链接),需显式置空。
|
|
|
|
|
+ // 使用字符串列名版 UpdateWrapper(非 Lambda 版),避免纯 Mockito 单测无 MyBatis-Plus 运行时环境
|
|
|
|
|
+ // 构造 LambdaUpdateWrapper 时抛 "can not find lambda cache for this entity"。
|
|
|
if (type.getLinkedProductId() == null) {
|
|
if (type.getLinkedProductId() == null) {
|
|
|
typeRegistryMapper.update(null,
|
|
typeRegistryMapper.update(null,
|
|
|
- new LambdaUpdateWrapper<ReportTypeRegistry>()
|
|
|
|
|
- .eq(ReportTypeRegistry::getId, type.getId())
|
|
|
|
|
- .set(ReportTypeRegistry::getLinkedProductId, null)
|
|
|
|
|
- .set(ReportTypeRegistry::getUpdatedAt, type.getUpdatedAt()));
|
|
|
|
|
|
|
+ new UpdateWrapper<ReportTypeRegistry>()
|
|
|
|
|
+ .eq("id", type.getId())
|
|
|
|
|
+ .set("linked_product_id", null)
|
|
|
|
|
+ .set("updated_at", type.getUpdatedAt()));
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
Long exists = typeRegistryMapper.selectCount(
|
|
Long exists = typeRegistryMapper.selectCount(
|