@@ -0,0 +1,1427 @@
+package com.baomidou.mybatisplus.core.test;%0A%0Aimport org.junit.Assert;%0Aimport org.junit.Test;%0A%0Aimport net.sf.jsqlparser.expression.operators.conditional.AndExpression;%0Aimport net.sf.jsqlparser.parser.CCJSqlParserUtil;%0Aimport net.sf.jsqlparser.statement.delete.Delete;%0Aimport net.sf.jsqlparser.statement.select.PlainSelect;%0Aimport net.sf.jsqlparser.statement.select.Select;%0Aimport net.sf.jsqlparser.statement.update.Update;%0A%0A/**%0A * SQL %E8%A7%A3%E6%9E%90%E6%B5%8B%E8%AF%95%0A */%0Apublic class JSqlParserTest %7B%0A%0A%0A    @Test%0A    public void parser() throws Exception %7B%0A        Select select = (Select) CCJSqlParserUtil.parse(%22SELECT a,b,c FROM tableName t WHERE t.col = 9 and b=c LIMIT 3, ?%22);%0A%0A        PlainSelect ps = (PlainSelect) select.getSelectBody();%0A%0A        System.out.println(ps.getWhere().toString());%0A        System.out.println(ps.getSelectItems().get(1).toString());%0A%0A        AndExpression e = (AndExpression) ps.getWhere();%0A        System.out.println(e.getLeftExpression());%0A    %7D%0A%0A%0A    @Test%0A    public void updateWhereParser() throws Exception %7B%0A        Update update = (Update) CCJSqlParserUtil.parse(%22Update tableName t SET t.a=(select c from tn where tn.id=t.id),b=2,c=3 %22);%0A        Assert.assertTrue(null == update.getWhere());%0A    %7D%0A%0A%0A    @Test%0A    public void deleteWhereParser() throws Exception %7B%0A        Delete delete = (Delete) CCJSqlParserUtil.parse(%22delete from tableName t%22);%0A        Assert.assertTrue(null == delete.getWhere());%0A    %7D%0A%7D%0A

update delete 无条件阻断 sql 解析用例