miemie 5 년 전
부모
커밋
2fab12eaa7
1개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 4 4
      mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/conditions/segments/NormalSegmentList.java

+ 4 - 4
mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/conditions/segments/NormalSegmentList.java

@@ -67,10 +67,6 @@ public class NormalSegmentList extends AbstractISegmentList {
                 return false;
             }
         } else {
-            if (!executeNot) {
-                list.add(0, SqlKeyword.NOT);
-                executeNot = true;
-            }
             if (MatchSegment.APPLY.match(firstSegment)) {
                 list.remove(0);
             }
@@ -80,6 +76,10 @@ public class NormalSegmentList extends AbstractISegmentList {
             if (!MatchSegment.AND_OR.match(lastValue) && !isEmpty()) {
                 add(SqlKeyword.AND);
             }
+            if (!executeNot) {
+                list.add(0, SqlKeyword.NOT);
+                executeNot = true;
+            }
         }
         return true;
     }