Browse Source

fix: id非空 组装id条件

master
niushuai233 2 years ago
parent
commit
46d58159c7
  1. 5
      src/main/java/cc/niushuai/bastionserver/common/base/controller/BaseController.java

5
src/main/java/cc/niushuai/bastionserver/common/base/controller/BaseController.java

@ -244,7 +244,10 @@ public class BaseController<T, S extends IService<T>> { @@ -244,7 +244,10 @@ public class BaseController<T, S extends IService<T>> {
wrapper.eq(fn, fn.apply(obj));
}
wrapper.ne(null != id, id, id.apply(obj));
if (null != id) {
// id非空 组装id条件
wrapper.ne(id, id.apply(obj));
}
boolean exists = service.getBaseMapper().exists(wrapper);
if (exists) {

Loading…
Cancel
Save