當前位置: 首頁>>代碼示例>>Java>>正文


Java MysqlPlanVisitorImpl類代碼示例

本文整理匯總了Java中com.taobao.tddl.repo.mysql.sqlconvertor.MysqlPlanVisitorImpl的典型用法代碼示例。如果您正苦於以下問題:Java MysqlPlanVisitorImpl類的具體用法?Java MysqlPlanVisitorImpl怎麽用?Java MysqlPlanVisitorImpl使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


MysqlPlanVisitorImpl類屬於com.taobao.tddl.repo.mysql.sqlconvertor包,在下文中一共展示了MysqlPlanVisitorImpl類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: constructColumnNameForFunction

import com.taobao.tddl.repo.mysql.sqlconvertor.MysqlPlanVisitorImpl; //導入依賴的package包/類
@Override
public String constructColumnNameForFunction(IDataNodeExecutor query, boolean bindVal,
                                             AtomicInteger bindValSequence,
                                             Map<Integer, ParameterContext> paramMap, IFunction func,
                                             MysqlPlanVisitorImpl parentVisitor) {
    StringBuilder sb = new StringBuilder();

    sb.append(IFunction.BuiltInFunction.TIMESTAMPDIFF).append("(");
    sb.append(func.getArgs().get(0));
    sb.append(",");
    sb.append(parentVisitor.getNewVisitor(func.getArgs().get(1)).getString());
    sb.append(",");
    sb.append(parentVisitor.getNewVisitor(func.getArgs().get(2)).getString());
    sb.append(")");

    return sb.toString();

}
 
開發者ID:loye168,項目名稱:tddl5,代碼行數:19,代碼來源:TimestampDiff.java

示例2: constructColumnNameForFunction

import com.taobao.tddl.repo.mysql.sqlconvertor.MysqlPlanVisitorImpl; //導入依賴的package包/類
@Override
public String constructColumnNameForFunction(IDataNodeExecutor query, boolean bindVal,
                                             AtomicInteger bindValSequence,
                                             Map<Integer, ParameterContext> paramMap, IFunction func,
                                             MysqlPlanVisitorImpl parentVisitor) {
    StringBuilder sb = new StringBuilder();

    sb.append(parentVisitor.getNewVisitor(func.getArgs().get(0)).getString());

    Object right = func.getArgs().get(1);

    // 右邊被提前計算過了,直接用in
    if (right instanceof List) {
        sb.append(" in ");
        sb.append(parentVisitor.getNewVisitor(func.getArgs().get(1)).getString());
    } else {
        // 右邊沒進行計算,還是個子查詢,理論上不會發生
        sb.append(" = any (");
        sb.append(parentVisitor.getNewVisitor(func.getArgs().get(1)).getString());
        sb.append(")");
    }

    return sb.toString();

}
 
開發者ID:loye168,項目名稱:tddl5,代碼行數:26,代碼來源:EqualAny.java

示例3: constructColumnNameForFunction

import com.taobao.tddl.repo.mysql.sqlconvertor.MysqlPlanVisitorImpl; //導入依賴的package包/類
@Override
public String constructColumnNameForFunction(IDataNodeExecutor query, boolean bindVal,
                                             AtomicInteger bindValSequence,
                                             Map<Integer, ParameterContext> paramMap, IFunction func,
                                             MysqlPlanVisitorImpl parentVisitor) {
    StringBuilder sb = new StringBuilder();

    sb.append(IFunction.BuiltInFunction.CHAR).append("(");
    int size = func.getArgs().size();
    for (int i = 0; i < size - 1; i++) {
        // typeinfo1
        sb.append(parentVisitor.getNewVisitor(func.getArgs().get(i)).getString());
        if (i < size - 2) {
            sb.append(",");
        }
    }

    size = func.getArgs().size();
    if (!ExecUtils.isNull(func.getArgs().get(size - 1))) {
        sb.append(" USING ").append(func.getArgs().get(size - 1));
    }
    sb.append(")");
    return sb.toString();
}
 
開發者ID:loye168,項目名稱:tddl5,代碼行數:25,代碼來源:Char.java

示例4: constructColumnNameForFunction

import com.taobao.tddl.repo.mysql.sqlconvertor.MysqlPlanVisitorImpl; //導入依賴的package包/類
@Override
public String constructColumnNameForFunction(IDataNodeExecutor query, boolean bindVal,
                                             AtomicInteger bindValSequence,
                                             Map<Integer, ParameterContext> paramMap, IFunction func,
                                             MysqlPlanVisitorImpl parentVisitor) {
    StringBuilder sb = new StringBuilder();

    sb.append(IFunction.BuiltInFunction.TIMESTAMPADD).append("(");
    sb.append(func.getArgs().get(0));
    sb.append(",");
    sb.append(parentVisitor.getNewVisitor(func.getArgs().get(1)).getString());
    sb.append(",");
    sb.append(parentVisitor.getNewVisitor(func.getArgs().get(2)).getString());
    sb.append(")");

    return sb.toString();

}
 
開發者ID:loye168,項目名稱:tddl5,代碼行數:19,代碼來源:TimestampAdd.java

示例5: constructColumnNameForFunction

import com.taobao.tddl.repo.mysql.sqlconvertor.MysqlPlanVisitorImpl; //導入依賴的package包/類
@Override
public String constructColumnNameForFunction(IDataNodeExecutor query, boolean bindVal,
                                             AtomicInteger bindValSequence,
                                             Map<Integer, ParameterContext> paramMap, IFunction func,
                                             MysqlPlanVisitorImpl parentVisitor) {
    StringBuilder sb = new StringBuilder();

    sb.append("TRIM").append("(");

    if (func.getArgs().size() == 2) {
        sb.append(parentVisitor.getNewVisitor(func.getArgs().get(0)).getString());
    } else {
        sb.append(func.getArgs().get(2)).append(" ");
        sb.append(parentVisitor.getNewVisitor(func.getArgs().get(1)).getString());
        sb.append(" FROM ");
        sb.append(parentVisitor.getNewVisitor(func.getArgs().get(0)).getString());
    }

    sb.append(")");

    return sb.toString();

}
 
開發者ID:loye168,項目名稱:tddl5,代碼行數:24,代碼來源:Trim.java

示例6: constructColumnNameForFunction

import com.taobao.tddl.repo.mysql.sqlconvertor.MysqlPlanVisitorImpl; //導入依賴的package包/類
@Override
public String constructColumnNameForFunction(IDataNodeExecutor query, boolean bindVal,
                                             AtomicInteger bindValSequence,
                                             Map<Integer, ParameterContext> paramMap, IFunction func,
                                             MysqlPlanVisitorImpl parentVisitor) {
    StringBuilder sb = new StringBuilder();

    sb.append(parentVisitor.getNewVisitor(func.getArgs().get(0)).getString());

    Object right = func.getArgs().get(1);

    // 右邊被提前計算過了,直接用not in
    if (right instanceof List) {
        sb.append(" not in ");
        sb.append(parentVisitor.getNewVisitor(func.getArgs().get(1)).getString());
    } else {
        // 右邊沒進行計算,還是個子查詢,理論上不會發生
        sb.append(" != all (");
        sb.append(parentVisitor.getNewVisitor(func.getArgs().get(1)).getString());
        sb.append(")");
    }

    return sb.toString();

}
 
開發者ID:loye168,項目名稱:tddl5,代碼行數:26,代碼來源:NotEqualAll.java

示例7: constructColumnNameForFunction

import com.taobao.tddl.repo.mysql.sqlconvertor.MysqlPlanVisitorImpl; //導入依賴的package包/類
@Override
public String constructColumnNameForFunction(IDataNodeExecutor query, boolean bindVal,
                                             AtomicInteger bindValSequence,
                                             Map<Integer, ParameterContext> paramMap, IFunction func,
                                             MysqlPlanVisitorImpl parentVisitor) {
    StringBuilder sb = new StringBuilder();
    
    sb.append(IFunction.BuiltInFunction.TIMESTAMPDIFF).append("(");
    sb.append(func.getArgs().get(0));
    sb.append(",");
    sb.append(parentVisitor.getNewVisitor(func.getArgs().get(1)).getString());
    sb.append(",");
    sb.append(parentVisitor.getNewVisitor(func.getArgs().get(2)).getString());
    sb.append(")");
   

    return sb.toString();

}
 
開發者ID:beebeandwer,項目名稱:TDDL,代碼行數:20,代碼來源:TimestampDiff.java

示例8: constructColumnNameForFunction

import com.taobao.tddl.repo.mysql.sqlconvertor.MysqlPlanVisitorImpl; //導入依賴的package包/類
@Override
public String constructColumnNameForFunction(IDataNodeExecutor query, boolean bindVal,
                                             AtomicInteger bindValSequence,
                                             Map<Integer, ParameterContext> paramMap, IFunction func,
                                             MysqlPlanVisitorImpl parentVisitor) {
    StringBuilder sb = new StringBuilder();
    
    
    sb.append(IFunction.BuiltInFunction.TIMESTAMPADD).append("(");
    sb.append(func.getArgs().get(0));
    sb.append(",");
    sb.append(parentVisitor.getNewVisitor(func.getArgs().get(1)).getString());
    sb.append(",");
    sb.append(parentVisitor.getNewVisitor(func.getArgs().get(2)).getString());
    sb.append(")");
    
   

    return sb.toString();

}
 
開發者ID:beebeandwer,項目名稱:TDDL,代碼行數:22,代碼來源:TimestampAdd.java

示例9: constructColumnNameForFunction

import com.taobao.tddl.repo.mysql.sqlconvertor.MysqlPlanVisitorImpl; //導入依賴的package包/類
@Override
public String constructColumnNameForFunction(IDataNodeExecutor query, boolean bindVal,
                                             AtomicInteger bindValSequence,
                                             Map<Integer, ParameterContext> paramMap, IFunction func,
                                             MysqlPlanVisitorImpl parentVisitor) {
    StringBuilder sb = new StringBuilder();

    sb.append(parentVisitor.getNewVisitor(func.getArgs().get(0)).getString());

    Object right = func.getArgs().get(1);

    // 右邊被提前計算過了,找出最小值,轉成>=
    if (right instanceof List) {

        DataType type = ((Filter) func.getExtraFunction()).getArgType();
        Object min = Collections.min((List) right, type);

        sb.append(" >= ");
        sb.append(parentVisitor.getNewVisitor(min).getString());
    } else {
        // 右邊沒進行計算,還是個子查詢,理論上不會發生
        sb.append(" >= any (");
        sb.append(parentVisitor.getNewVisitor(func.getArgs().get(1)).getString());
        sb.append(")");
    }

    return sb.toString();

}
 
開發者ID:loye168,項目名稱:tddl5,代碼行數:30,代碼來源:GreaterEqualAny.java

示例10: constructColumnNameForFunction

import com.taobao.tddl.repo.mysql.sqlconvertor.MysqlPlanVisitorImpl; //導入依賴的package包/類
@Override
public String constructColumnNameForFunction(IDataNodeExecutor query, boolean bindVal,
                                             AtomicInteger bindValSequence,
                                             Map<Integer, ParameterContext> paramMap, IFunction func,
                                             MysqlPlanVisitorImpl parentVisitor) {
    StringBuilder sb = new StringBuilder();

    sb.append(parentVisitor.getNewVisitor(func.getArgs().get(0)).getString());

    Object right = func.getArgs().get(1);

    // 右邊被提前計算過了,找出最大值,轉成<
    if (right instanceof List) {

        DataType type = ((Filter) func.getExtraFunction()).getArgType();
        Object max = Collections.max((List) right, type);

        sb.append(" < ");
        sb.append(parentVisitor.getNewVisitor(max).getString());
    } else {
        // 右邊沒進行計算,還是個子查詢,理論上不會發生
        sb.append(" < any (");
        sb.append(parentVisitor.getNewVisitor(func.getArgs().get(1)).getString());
        sb.append(")");
    }

    return sb.toString();

}
 
開發者ID:loye168,項目名稱:tddl5,代碼行數:30,代碼來源:LessAny.java

示例11: constructColumnNameForFunction

import com.taobao.tddl.repo.mysql.sqlconvertor.MysqlPlanVisitorImpl; //導入依賴的package包/類
@Override
public String constructColumnNameForFunction(IDataNodeExecutor query, boolean bindVal,
                                             AtomicInteger bindValSequence,
                                             Map<Integer, ParameterContext> paramMap, IFunction func,
                                             MysqlPlanVisitorImpl parentVisitor) {
    StringBuilder sb = new StringBuilder();

    sb.append(parentVisitor.getNewVisitor(func.getArgs().get(0)).getString());

    Object right = func.getArgs().get(1);

    // 右邊被提前計算過了,找出最小值,轉成>
    if (right instanceof List) {

        DataType type = ((Filter) func.getExtraFunction()).getArgType();
        Object min = Collections.min((List) right, type);

        sb.append(" > ");
        sb.append(parentVisitor.getNewVisitor(min).getString());
    } else {
        // 右邊沒進行計算,還是個子查詢,理論上不會發生
        sb.append(" > any (");
        sb.append(parentVisitor.getNewVisitor(func.getArgs().get(1)).getString());
        sb.append(")");
    }

    return sb.toString();

}
 
開發者ID:loye168,項目名稱:tddl5,代碼行數:30,代碼來源:GreaterAny.java

示例12: constructColumnNameForFunction

import com.taobao.tddl.repo.mysql.sqlconvertor.MysqlPlanVisitorImpl; //導入依賴的package包/類
@Override
public String constructColumnNameForFunction(IDataNodeExecutor query, boolean bindVal,
                                             AtomicInteger bindValSequence,
                                             Map<Integer, ParameterContext> paramMap, IFunction func,
                                             MysqlPlanVisitorImpl parentVisitor) {
    StringBuilder sb = new StringBuilder();

    sb.append(parentVisitor.getNewVisitor(func.getArgs().get(0)).getString());

    Object right = func.getArgs().get(1);

    // 右邊被提前計算過了,找出最大值,轉成<=
    if (right instanceof List) {

        DataType type = ((Filter) func.getExtraFunction()).getArgType();
        Object max = Collections.max((List) right, type);

        sb.append(" <= ");
        sb.append(parentVisitor.getNewVisitor(max).getString());
    } else {
        // 右邊沒進行計算,還是個子查詢,理論上不會發生
        sb.append(" <= any (");
        sb.append(parentVisitor.getNewVisitor(func.getArgs().get(1)).getString());
        sb.append(")");
    }

    return sb.toString();

}
 
開發者ID:loye168,項目名稱:tddl5,代碼行數:30,代碼來源:LessEqualAny.java

示例13: constructColumnNameForFunction

import com.taobao.tddl.repo.mysql.sqlconvertor.MysqlPlanVisitorImpl; //導入依賴的package包/類
@Override
public String constructColumnNameForFunction(IDataNodeExecutor query, boolean bindVal,
                                             AtomicInteger bindValSequence,
                                             Map<Integer, ParameterContext> paramMap, IFunction func,
                                             MysqlPlanVisitorImpl parentVisitor) {
    StringBuilder sb = new StringBuilder();

    sb.append(IFunction.BuiltInFunction.CAST).append("(");
    sb.append(parentVisitor.getNewVisitor(func.getArgs().get(0)).getString());
    sb.append(" as ");
    // typename
    sb.append(func.getArgs().get(1));

    // typeinfo
    if (func.getArgs().size() > 2) {
        sb.append("(");
        // typeinfo1
        sb.append(parentVisitor.getNewVisitor(func.getArgs().get(2)).getString());

        // typeinfo2
        if (func.getArgs().size() > 3) {
            sb.append(",");
            sb.append(parentVisitor.getNewVisitor(func.getArgs().get(3)).getString());
        }
        sb.append(")");
    }
    sb.append(")");

    return sb.toString();

}
 
開發者ID:loye168,項目名稱:tddl5,代碼行數:32,代碼來源:Cast.java

示例14: constructColumnNameForFunction

import com.taobao.tddl.repo.mysql.sqlconvertor.MysqlPlanVisitorImpl; //導入依賴的package包/類
@Override
public String constructColumnNameForFunction(IDataNodeExecutor query, boolean bindVal,
                                             AtomicInteger bindValSequence,
                                             Map<Integer, ParameterContext> paramMap, IFunction func,
                                             MysqlPlanVisitorImpl parentVisitor) {
    StringBuilder sb = new StringBuilder();

    sb.append(IFunction.BuiltInFunction.GET_FORMAT).append("(");
    sb.append(func.getArgs().get(0));
    sb.append(",");
    sb.append(parentVisitor.getNewVisitor(func.getArgs().get(1)).getString());
    sb.append(")");
    return sb.toString();

}
 
開發者ID:loye168,項目名稱:tddl5,代碼行數:16,代碼來源:GetFormat.java

示例15: constructColumnNameForFunction

import com.taobao.tddl.repo.mysql.sqlconvertor.MysqlPlanVisitorImpl; //導入依賴的package包/類
@Override
public String constructColumnNameForFunction(IDataNodeExecutor query, boolean bindVal,
                                             AtomicInteger bindValSequence,
                                             Map<Integer, ParameterContext> paramMap, IFunction func,
                                             MysqlPlanVisitorImpl parentVisitor) {
    StringBuilder sb = new StringBuilder();

    sb.append(parentVisitor.getNewVisitor(func.getArgs().get(0)).getString());

    Object right = func.getArgs().get(1);

    // 右邊被提前計算過了,找出最大值,轉成>
    if (right instanceof List) {

        DataType type = ((Filter) func.getExtraFunction()).getArgType();
        Object max = Collections.max((List) right, type);

        sb.append(" > ");
        sb.append(parentVisitor.getNewVisitor(max).getString());
    } else {
        // 右邊沒進行計算,還是個子查詢,理論上不會發生
        sb.append(" > all (");
        sb.append(parentVisitor.getNewVisitor(func.getArgs().get(1)).getString());
        sb.append(")");
    }

    return sb.toString();

}
 
開發者ID:loye168,項目名稱:tddl5,代碼行數:30,代碼來源:GreaterAll.java


注:本文中的com.taobao.tddl.repo.mysql.sqlconvertor.MysqlPlanVisitorImpl類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。