diff --git a/src/main/java/com/biutag/supervision/repository/complaintCollection/ComplaintCollectionResourceService.java b/src/main/java/com/biutag/supervision/repository/complaintCollection/ComplaintCollectionResourceService.java index a235a50..b6338cf 100644 --- a/src/main/java/com/biutag/supervision/repository/complaintCollection/ComplaintCollectionResourceService.java +++ b/src/main/java/com/biutag/supervision/repository/complaintCollection/ComplaintCollectionResourceService.java @@ -148,9 +148,6 @@ public class ComplaintCollectionResourceService extends BaseDAO { if (param.getSourceTable() != null) { uw.set(ComplaintCollection::getSourceTable, param.getSourceTable()); } - if (param.getTag() != null) { - uw.set(ComplaintCollection::getTag, param.getTag()); - } if (param.getInvolveProblem() != null) { uw.set(ComplaintCollection::getInvolveProblem, param.getInvolveProblem()); } @@ -230,13 +227,19 @@ public class ComplaintCollectionResourceService extends BaseDAO { if (param.getGwf3()!=null){ uw.set(ComplaintCollection::getGwf3, param.getGwf3()); } - uw.set(ComplaintCollection::getTag, param.getTags() != null ? StringUtils.join(param.getTags(), ",") : null); + if (param.getTags() != null){ + uw.set(ComplaintCollection::getTag, StringUtils.join(param.getTags(), ",") ); + } uw.set(ComplaintCollection::getUpdateBy, UserContextHolder.getCurrentUser().getUserName()); uw.set(ComplaintCollection::getUpdateTime, LocalDateTime.now()); if (uw.getExpression() == null || uw.getExpression().getSqlSegment().isEmpty()) { throw new IllegalStateException("更新条件不能为空,防止全表更新"); } - return complaintCollectionMapper.update(null, uw) > 0; + int affected = complaintCollectionMapper.update(null, uw); + if (affected > 1) { + throw new IllegalStateException("更新命中多条数据,疑似ID不唯一:" + id); + } + return affected == 1; } public boolean exists(ComplaintCollectionExistParam param) {