All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.easy.query.api4j.select.extension.queryable3.SQLGroupable3 Maven / Gradle / Ivy

There is a newer version: 2.3.3
Show newest version
package com.easy.query.api4j.select.extension.queryable3;

import com.easy.query.api4j.select.Queryable3;
import com.easy.query.api4j.sql.SQLGroupBySelector;
import com.easy.query.api4j.sql.impl.SQLGroupBySelectorImpl;
import com.easy.query.core.common.tuple.Tuple3;
import com.easy.query.core.expression.lambda.SQLExpression1;
import com.easy.query.core.expression.lambda.SQLExpression3;

/**
 * create time 2023/8/16 08:49
 * 文件说明
 *
 * @author xuejiaming
 */
public interface SQLGroupable3 extends ClientQueryable3Available, Queryable3Available {


    default Queryable3 groupBy(SQLExpression3, SQLGroupBySelector, SQLGroupBySelector> selectExpression) {
        getClientQueryable3().groupBy((selector1, selector2, selector3) -> {
            selectExpression.apply(new SQLGroupBySelectorImpl<>(selector1), new SQLGroupBySelectorImpl<>(selector2), new SQLGroupBySelectorImpl<>(selector3));
        });
        return getQueryable3();
    }

    default Queryable3 groupBy(boolean condition, SQLExpression3, SQLGroupBySelector, SQLGroupBySelector> selectExpression) {
        getClientQueryable3().groupBy(condition, (selector1, selector2, selector3) -> {
            selectExpression.apply(new SQLGroupBySelectorImpl<>(selector1), new SQLGroupBySelectorImpl<>(selector2), new SQLGroupBySelectorImpl<>(selector3));
        });
        return getQueryable3();
    }

    default Queryable3 groupByMerge(SQLExpression1, SQLGroupBySelector, SQLGroupBySelector>> selectExpression) {
        return groupByMerge(true, selectExpression);
    }

    default Queryable3 groupByMerge(boolean condition, SQLExpression1, SQLGroupBySelector, SQLGroupBySelector>> selectExpression) {
        return groupBy(condition, (t1,t2,t3) -> {
            selectExpression.apply(new Tuple3<>(t1,t2,t3));
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy