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

com.easy.query.api4j.select.extension.queryable5.SQLAggregatable5 Maven / Gradle / Ivy

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

import com.easy.query.api4j.sql.SQLColumnResultSelector;
import com.easy.query.api4j.sql.impl.SQLColumnResultSelectorImpl;
import com.easy.query.core.common.tuple.Tuple5;
import com.easy.query.core.expression.lambda.SQLExpression1;
import com.easy.query.core.expression.lambda.SQLExpression5;

import java.math.BigDecimal;

/**
 * create time 2023/8/17 17:02
 * 文件说明
 *
 * @author xuejiaming
 */
public interface SQLAggregatable5 extends ClientQueryable5Available {

    /**
     * 防止溢出
     *
     * @param columnSelectorExpression
     * @param 
     * @return
     */
    default  BigDecimal sumBigDecimalOrNull(SQLExpression5, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector> columnSelectorExpression) {
        return getClientQueryable5().sumBigDecimalOrNull((selector1, selector2, selector3, selector4, selector5) -> {
            columnSelectorExpression.apply(new SQLColumnResultSelectorImpl<>(selector1), new SQLColumnResultSelectorImpl<>(selector2), new SQLColumnResultSelectorImpl<>(selector3), new SQLColumnResultSelectorImpl<>(selector4), new SQLColumnResultSelectorImpl<>(selector5));
        });
    }


    default  BigDecimal sumBigDecimalOrDefault(SQLExpression5, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector> columnSelectorExpression, BigDecimal def) {
        return getClientQueryable5().sumBigDecimalOrDefault((selector1, selector2, selector3, selector4, selector5) -> {
            columnSelectorExpression.apply(new SQLColumnResultSelectorImpl<>(selector1), new SQLColumnResultSelectorImpl<>(selector2), new SQLColumnResultSelectorImpl<>(selector3), new SQLColumnResultSelectorImpl<>(selector4), new SQLColumnResultSelectorImpl<>(selector5));
        }, def);
    }

    default  TMember sumOrNull(SQLExpression5, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector> columnSelectorExpression) {
        return getClientQueryable5().sumOrNull((selector1, selector2, selector3, selector4, selector5) -> {
            columnSelectorExpression.apply(new SQLColumnResultSelectorImpl<>(selector1), new SQLColumnResultSelectorImpl<>(selector2), new SQLColumnResultSelectorImpl<>(selector3), new SQLColumnResultSelectorImpl<>(selector4), new SQLColumnResultSelectorImpl<>(selector5));
        });
    }

    default  TMember sumOrDefault(SQLExpression5, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector> columnSelectorExpression, TMember def) {
        return getClientQueryable5().sumOrDefault((selector1, selector2, selector3, selector4, selector5) -> {
            columnSelectorExpression.apply(new SQLColumnResultSelectorImpl<>(selector1), new SQLColumnResultSelectorImpl<>(selector2), new SQLColumnResultSelectorImpl<>(selector3), new SQLColumnResultSelectorImpl<>(selector4), new SQLColumnResultSelectorImpl<>(selector5));
        }, def);
    }

    default  TMember maxOrNull(SQLExpression5, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector> columnSelectorExpression) {
        return getClientQueryable5().maxOrNull((selector1, selector2, selector3, selector4, selector5) -> {
            columnSelectorExpression.apply(new SQLColumnResultSelectorImpl<>(selector1), new SQLColumnResultSelectorImpl<>(selector2), new SQLColumnResultSelectorImpl<>(selector3), new SQLColumnResultSelectorImpl<>(selector4), new SQLColumnResultSelectorImpl<>(selector5));
        });
    }

    default  TMember maxOrDefault(SQLExpression5, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector> columnSelectorExpression, TMember def) {
        return getClientQueryable5().maxOrDefault((selector1, selector2, selector3, selector4, selector5) -> {
            columnSelectorExpression.apply(new SQLColumnResultSelectorImpl<>(selector1), new SQLColumnResultSelectorImpl<>(selector2), new SQLColumnResultSelectorImpl<>(selector3), new SQLColumnResultSelectorImpl<>(selector4), new SQLColumnResultSelectorImpl<>(selector5));
        }, def);
    }

    default  TMember minOrNull(SQLExpression5, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector> columnSelectorExpression) {
        return getClientQueryable5().minOrNull((selector1, selector2, selector3, selector4, selector5) -> {
            columnSelectorExpression.apply(new SQLColumnResultSelectorImpl<>(selector1), new SQLColumnResultSelectorImpl<>(selector2), new SQLColumnResultSelectorImpl<>(selector3), new SQLColumnResultSelectorImpl<>(selector4), new SQLColumnResultSelectorImpl<>(selector5));
        });
    }

    default  TMember minOrDefault(SQLExpression5, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector> columnSelectorExpression, TMember def) {
        return getClientQueryable5().minOrDefault((selector1, selector2, selector3, selector4, selector5) -> {
            columnSelectorExpression.apply(new SQLColumnResultSelectorImpl<>(selector1), new SQLColumnResultSelectorImpl<>(selector2), new SQLColumnResultSelectorImpl<>(selector3), new SQLColumnResultSelectorImpl<>(selector4), new SQLColumnResultSelectorImpl<>(selector5));
        }, def);
    }

    default  Double avgOrNull(SQLExpression5, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector> columnSelectorExpression) {
        return getClientQueryable5().avgOrNull((selector1, selector2, selector3, selector4, selector5) -> {
            columnSelectorExpression.apply(new SQLColumnResultSelectorImpl<>(selector1), new SQLColumnResultSelectorImpl<>(selector2), new SQLColumnResultSelectorImpl<>(selector3), new SQLColumnResultSelectorImpl<>(selector4), new SQLColumnResultSelectorImpl<>(selector5));
        });
    }

    default  BigDecimal avgBigDecimalOrNull(SQLExpression5, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector> columnSelectorExpression) {
        return getClientQueryable5().avgBigDecimalOrNull((selector1, selector2, selector3, selector4, selector5) -> {
            columnSelectorExpression.apply(new SQLColumnResultSelectorImpl<>(selector1), new SQLColumnResultSelectorImpl<>(selector2), new SQLColumnResultSelectorImpl<>(selector3), new SQLColumnResultSelectorImpl<>(selector4), new SQLColumnResultSelectorImpl<>(selector5));
        });
    }

    default  Float avgFloatOrNull(SQLExpression5, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector> columnSelectorExpression) {
        return getClientQueryable5().avgFloatOrNull((selector1, selector2, selector3, selector4, selector5) -> {
            columnSelectorExpression.apply(new SQLColumnResultSelectorImpl<>(selector1), new SQLColumnResultSelectorImpl<>(selector2), new SQLColumnResultSelectorImpl<>(selector3), new SQLColumnResultSelectorImpl<>(selector4), new SQLColumnResultSelectorImpl<>(selector5));
        });
    }

    default  Double avgOrDefault(SQLExpression5, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector> columnSelectorExpression, Double def) {
        return getClientQueryable5().avgOrDefault((selector1, selector2, selector3, selector4, selector5) -> {
            columnSelectorExpression.apply(new SQLColumnResultSelectorImpl<>(selector1), new SQLColumnResultSelectorImpl<>(selector2), new SQLColumnResultSelectorImpl<>(selector3), new SQLColumnResultSelectorImpl<>(selector4), new SQLColumnResultSelectorImpl<>(selector5));
        }, def);
    }

    default  BigDecimal avgBigDecimalOrDefault(SQLExpression5, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector> columnSelectorExpression, BigDecimal def) {
        return getClientQueryable5().avgBigDecimalOrDefault((selector1, selector2, selector3, selector4, selector5) -> {
            columnSelectorExpression.apply(new SQLColumnResultSelectorImpl<>(selector1), new SQLColumnResultSelectorImpl<>(selector2), new SQLColumnResultSelectorImpl<>(selector3), new SQLColumnResultSelectorImpl<>(selector4), new SQLColumnResultSelectorImpl<>(selector5));
        }, def);
    }

    default  Float avgFloatOrDefault(SQLExpression5, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector> columnSelectorExpression, Float def) {
        return getClientQueryable5().avgFloatOrDefault((selector1, selector2, selector3, selector4, selector5) -> {
            columnSelectorExpression.apply(new SQLColumnResultSelectorImpl<>(selector1), new SQLColumnResultSelectorImpl<>(selector2), new SQLColumnResultSelectorImpl<>(selector3), new SQLColumnResultSelectorImpl<>(selector4), new SQLColumnResultSelectorImpl<>(selector5));
        }, def);
    }

    default  TResult avgOrDefault(SQLExpression5, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector> columnSelectorExpression, TResult def, Class resultClass) {
        return getClientQueryable5().avgOrDefault((selector1, selector2, selector3, selector4, selector5) -> {
            columnSelectorExpression.apply(new SQLColumnResultSelectorImpl<>(selector1), new SQLColumnResultSelectorImpl<>(selector2), new SQLColumnResultSelectorImpl<>(selector3), new SQLColumnResultSelectorImpl<>(selector4), new SQLColumnResultSelectorImpl<>(selector5));
        }, def, resultClass);
    }




    /**
     * 防止溢出
     *
     * @param columnSelectorExpression
     * @param 
     * @return
     */
    default  BigDecimal sumBigDecimalOrNullMerge(SQLExpression1, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector>> columnSelectorExpression) {
        return getClientQueryable5().sumBigDecimalOrNullMerge((tuple5) -> {
            columnSelectorExpression.apply(new Tuple5<>(new SQLColumnResultSelectorImpl<>(tuple5.t()), new SQLColumnResultSelectorImpl<>(tuple5.t1()), new SQLColumnResultSelectorImpl<>(tuple5.t2()), new SQLColumnResultSelectorImpl<>(tuple5.t3()),new SQLColumnResultSelectorImpl<>(tuple5.t4())));
        });
    }


    default  BigDecimal sumBigDecimalOrDefaultMerge(SQLExpression1, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector>> columnSelectorExpression, BigDecimal def) {
        return getClientQueryable5().sumBigDecimalOrDefaultMerge((tuple5) -> {
            columnSelectorExpression.apply(new Tuple5<>(new SQLColumnResultSelectorImpl<>(tuple5.t()), new SQLColumnResultSelectorImpl<>(tuple5.t1()), new SQLColumnResultSelectorImpl<>(tuple5.t2()), new SQLColumnResultSelectorImpl<>(tuple5.t3()),new SQLColumnResultSelectorImpl<>(tuple5.t4())));
        }, def);
    }

    default  TMember sumOrNullMerge(SQLExpression1, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector>> columnSelectorExpression) {
        return getClientQueryable5().sumOrNullMerge((tuple5) -> {
            columnSelectorExpression.apply(new Tuple5<>(new SQLColumnResultSelectorImpl<>(tuple5.t()), new SQLColumnResultSelectorImpl<>(tuple5.t1()), new SQLColumnResultSelectorImpl<>(tuple5.t2()), new SQLColumnResultSelectorImpl<>(tuple5.t3()),new SQLColumnResultSelectorImpl<>(tuple5.t4())));
        });
    }

    default  TMember sumOrDefaultMerge(SQLExpression1, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector>> columnSelectorExpression, TMember def) {
        return getClientQueryable5().sumOrDefaultMerge((tuple5) -> {
            columnSelectorExpression.apply(new Tuple5<>(new SQLColumnResultSelectorImpl<>(tuple5.t()), new SQLColumnResultSelectorImpl<>(tuple5.t1()), new SQLColumnResultSelectorImpl<>(tuple5.t2()), new SQLColumnResultSelectorImpl<>(tuple5.t3()),new SQLColumnResultSelectorImpl<>(tuple5.t4())));
        }, def);
    }

    default  TMember maxOrNullMerge(SQLExpression1, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector>> columnSelectorExpression) {
        return getClientQueryable5().maxOrNullMerge((tuple5) -> {
            columnSelectorExpression.apply(new Tuple5<>(new SQLColumnResultSelectorImpl<>(tuple5.t()), new SQLColumnResultSelectorImpl<>(tuple5.t1()), new SQLColumnResultSelectorImpl<>(tuple5.t2()), new SQLColumnResultSelectorImpl<>(tuple5.t3()),new SQLColumnResultSelectorImpl<>(tuple5.t4())));
        });
    }

    default  TMember maxOrDefaultMerge(SQLExpression1, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector>> columnSelectorExpression, TMember def) {
        return getClientQueryable5().maxOrDefaultMerge((tuple5) -> {
            columnSelectorExpression.apply(new Tuple5<>(new SQLColumnResultSelectorImpl<>(tuple5.t()), new SQLColumnResultSelectorImpl<>(tuple5.t1()), new SQLColumnResultSelectorImpl<>(tuple5.t2()), new SQLColumnResultSelectorImpl<>(tuple5.t3()),new SQLColumnResultSelectorImpl<>(tuple5.t4())));
        }, def);
    }

    default  TMember minOrNullMerge(SQLExpression1, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector>> columnSelectorExpression) {
        return getClientQueryable5().minOrNullMerge((tuple5) -> {
            columnSelectorExpression.apply(new Tuple5<>(new SQLColumnResultSelectorImpl<>(tuple5.t()), new SQLColumnResultSelectorImpl<>(tuple5.t1()), new SQLColumnResultSelectorImpl<>(tuple5.t2()), new SQLColumnResultSelectorImpl<>(tuple5.t3()),new SQLColumnResultSelectorImpl<>(tuple5.t4())));
        });
    }

    default  TMember minOrDefaultMerge(SQLExpression1, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector>> columnSelectorExpression, TMember def) {
        return getClientQueryable5().minOrDefaultMerge((tuple5) -> {
            columnSelectorExpression.apply(new Tuple5<>(new SQLColumnResultSelectorImpl<>(tuple5.t()), new SQLColumnResultSelectorImpl<>(tuple5.t1()), new SQLColumnResultSelectorImpl<>(tuple5.t2()), new SQLColumnResultSelectorImpl<>(tuple5.t3()),new SQLColumnResultSelectorImpl<>(tuple5.t4())));
        }, def);
    }

    default  Double avgOrNullMerge(SQLExpression1, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector>> columnSelectorExpression) {
        return getClientQueryable5().avgOrNullMerge((tuple5) -> {
            columnSelectorExpression.apply(new Tuple5<>(new SQLColumnResultSelectorImpl<>(tuple5.t()), new SQLColumnResultSelectorImpl<>(tuple5.t1()), new SQLColumnResultSelectorImpl<>(tuple5.t2()), new SQLColumnResultSelectorImpl<>(tuple5.t3()),new SQLColumnResultSelectorImpl<>(tuple5.t4())));
        });
    }

    default  BigDecimal avgBigDecimalOrNullMerge(SQLExpression1, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector>> columnSelectorExpression) {
        return getClientQueryable5().avgBigDecimalOrNullMerge((tuple5) -> {
            columnSelectorExpression.apply(new Tuple5<>(new SQLColumnResultSelectorImpl<>(tuple5.t()), new SQLColumnResultSelectorImpl<>(tuple5.t1()), new SQLColumnResultSelectorImpl<>(tuple5.t2()), new SQLColumnResultSelectorImpl<>(tuple5.t3()),new SQLColumnResultSelectorImpl<>(tuple5.t4())));
        });
    }

    default  Float avgFloatOrNullMerge(SQLExpression1, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector>> columnSelectorExpression) {
        return getClientQueryable5().avgFloatOrNullMerge((tuple5) -> {
            columnSelectorExpression.apply(new Tuple5<>(new SQLColumnResultSelectorImpl<>(tuple5.t()), new SQLColumnResultSelectorImpl<>(tuple5.t1()), new SQLColumnResultSelectorImpl<>(tuple5.t2()), new SQLColumnResultSelectorImpl<>(tuple5.t3()),new SQLColumnResultSelectorImpl<>(tuple5.t4())));
        });
    }

    default  Double avgOrDefaultMerge(SQLExpression1, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector>> columnSelectorExpression, Double def) {
        return getClientQueryable5().avgOrDefaultMerge((tuple5) -> {
            columnSelectorExpression.apply(new Tuple5<>(new SQLColumnResultSelectorImpl<>(tuple5.t()), new SQLColumnResultSelectorImpl<>(tuple5.t1()), new SQLColumnResultSelectorImpl<>(tuple5.t2()), new SQLColumnResultSelectorImpl<>(tuple5.t3()),new SQLColumnResultSelectorImpl<>(tuple5.t4())));
        }, def);
    }

    default  BigDecimal avgBigDecimalOrDefaultMerge(SQLExpression1, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector>> columnSelectorExpression, BigDecimal def) {
        return getClientQueryable5().avgBigDecimalOrDefaultMerge((tuple5) -> {
            columnSelectorExpression.apply(new Tuple5<>(new SQLColumnResultSelectorImpl<>(tuple5.t()), new SQLColumnResultSelectorImpl<>(tuple5.t1()), new SQLColumnResultSelectorImpl<>(tuple5.t2()), new SQLColumnResultSelectorImpl<>(tuple5.t3()),new SQLColumnResultSelectorImpl<>(tuple5.t4())));
        }, def);
    }

    default  Float avgFloatOrDefaultMerge(SQLExpression1, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector>> columnSelectorExpression, Float def) {
        return getClientQueryable5().avgFloatOrDefaultMerge((tuple5) -> {
            columnSelectorExpression.apply(new Tuple5<>(new SQLColumnResultSelectorImpl<>(tuple5.t()), new SQLColumnResultSelectorImpl<>(tuple5.t1()), new SQLColumnResultSelectorImpl<>(tuple5.t2()), new SQLColumnResultSelectorImpl<>(tuple5.t3()),new SQLColumnResultSelectorImpl<>(tuple5.t4())));
        }, def);
    }

    default  TResult avgOrDefaultMerge(SQLExpression1, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector>> columnSelectorExpression, TResult def, Class resultClass) {
        return getClientQueryable5().avgOrDefaultMerge((tuple5) -> {
            columnSelectorExpression.apply(new Tuple5<>(new SQLColumnResultSelectorImpl<>(tuple5.t()), new SQLColumnResultSelectorImpl<>(tuple5.t1()), new SQLColumnResultSelectorImpl<>(tuple5.t2()), new SQLColumnResultSelectorImpl<>(tuple5.t3()),new SQLColumnResultSelectorImpl<>(tuple5.t4())));
        }, def, resultClass);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy