package com.example.operator;

import com.ejlchina.searcher.FieldOp;

import java.util.Collections;
import java.util.List;

/**
 * 自定义运算符
 */
public class MyOp implements FieldOp {

    @Override
    public String name() {
        return "my";
    }

    @Override
    public boolean isNamed(String name) {
        return "my".equals(name);
    }

    @Override
    public boolean lonely() {
        return true;
    }

    @Override
    public List<Object> operate(StringBuilder sqlBuilder, OpPara opPara) {
        sqlBuilder.append(opPara.getDbField()).append(" = 25");
        return Collections.emptyList();
    }
}

@@ -61,16 +61,57 @@
 FieldOp;
+%0Aimport com.ejlchina.searcher.SqlWrapper;
 %0A%0Aimport
@@ -555,26 +555,38 @@
     
-sqlBuilder.append(
+SqlWrapper%3CObject%3E fieldSql = 
 opPa
@@ -595,15 +595,61 @@
 .get
-Db
 Field
+Sql();%0A        sqlBuilder.append(fieldSql.getSql
 ()).
@@ -684,29 +684,25 @@
 urn 
-Collections.emptyList
+fieldSql.getParas
 ();%0A

fix demo