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

com.easy.query.api4j.select.extension.queryable4.SQLAggregatable4 Maven / Gradle / Ivy

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

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

import java.math.BigDecimal;

/**
 * create time 2023/8/15 21:54
 * 文件说明
 *
 * @author xuejiaming
 */
public interface SQLAggregatable4 extends ClientQueryable4Available {

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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



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


    default  BigDecimal sumBigDecimalOrDefaultMerge(SQLExpression1, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector>> columnSelectorExpression, BigDecimal def) {
        return getClientQueryable4().sumBigDecimalOrDefaultMerge((tuple4) -> {
            columnSelectorExpression.apply(new Tuple4<>(new SQLColumnResultSelectorImpl<>(tuple4.t()), new SQLColumnResultSelectorImpl<>(tuple4.t1()), new SQLColumnResultSelectorImpl<>(tuple4.t2()),new SQLColumnResultSelectorImpl<>(tuple4.t3())));
        }, def);
    }

    default  TMember sumOrNullMerge(SQLExpression1, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector>> columnSelectorExpression) {
        return getClientQueryable4().sumOrNullMerge((tuple4) -> {
            columnSelectorExpression.apply(new Tuple4<>(new SQLColumnResultSelectorImpl<>(tuple4.t()), new SQLColumnResultSelectorImpl<>(tuple4.t1()), new SQLColumnResultSelectorImpl<>(tuple4.t2()),new SQLColumnResultSelectorImpl<>(tuple4.t3())));
        });
    }

    default  TMember sumOrDefaultMerge(SQLExpression1, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector>> columnSelectorExpression, TMember def) {
        return getClientQueryable4().sumOrDefaultMerge((tuple4) -> {
            columnSelectorExpression.apply(new Tuple4<>(new SQLColumnResultSelectorImpl<>(tuple4.t()), new SQLColumnResultSelectorImpl<>(tuple4.t1()), new SQLColumnResultSelectorImpl<>(tuple4.t2()),new SQLColumnResultSelectorImpl<>(tuple4.t3())));
        }, def);
    }

    default  TMember maxOrNullMerge(SQLExpression1, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector>> columnSelectorExpression) {
        return getClientQueryable4().maxOrNullMerge((tuple4) -> {
            columnSelectorExpression.apply(new Tuple4<>(new SQLColumnResultSelectorImpl<>(tuple4.t()), new SQLColumnResultSelectorImpl<>(tuple4.t1()), new SQLColumnResultSelectorImpl<>(tuple4.t2()),new SQLColumnResultSelectorImpl<>(tuple4.t3())));
        });
    }

    default  TMember maxOrDefaultMerge(SQLExpression1, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector>> columnSelectorExpression, TMember def) {
        return getClientQueryable4().maxOrDefaultMerge((tuple4) -> {
            columnSelectorExpression.apply(new Tuple4<>(new SQLColumnResultSelectorImpl<>(tuple4.t()), new SQLColumnResultSelectorImpl<>(tuple4.t1()), new SQLColumnResultSelectorImpl<>(tuple4.t2()),new SQLColumnResultSelectorImpl<>(tuple4.t3())));
        }, def);
    }

    default  TMember minOrNullMerge(SQLExpression1, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector>> columnSelectorExpression) {
        return getClientQueryable4().minOrNullMerge((tuple4) -> {
            columnSelectorExpression.apply(new Tuple4<>(new SQLColumnResultSelectorImpl<>(tuple4.t()), new SQLColumnResultSelectorImpl<>(tuple4.t1()), new SQLColumnResultSelectorImpl<>(tuple4.t2()),new SQLColumnResultSelectorImpl<>(tuple4.t3())));
        });
    }

    default  TMember minOrDefaultMerge(SQLExpression1, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector>> columnSelectorExpression, TMember def) {
        return getClientQueryable4().minOrDefaultMerge((tuple4) -> {
            columnSelectorExpression.apply(new Tuple4<>(new SQLColumnResultSelectorImpl<>(tuple4.t()), new SQLColumnResultSelectorImpl<>(tuple4.t1()), new SQLColumnResultSelectorImpl<>(tuple4.t2()),new SQLColumnResultSelectorImpl<>(tuple4.t3())));
        }, def);
    }

    default  Double avgOrNullMerge(SQLExpression1, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector>> columnSelectorExpression) {
        return getClientQueryable4().avgOrNullMerge((tuple4) -> {
            columnSelectorExpression.apply(new Tuple4<>(new SQLColumnResultSelectorImpl<>(tuple4.t()), new SQLColumnResultSelectorImpl<>(tuple4.t1()), new SQLColumnResultSelectorImpl<>(tuple4.t2()),new SQLColumnResultSelectorImpl<>(tuple4.t3())));
        });
    }

    default  BigDecimal avgBigDecimalOrNullMerge(SQLExpression1, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector>> columnSelectorExpression) {
        return getClientQueryable4().avgBigDecimalOrNullMerge((tuple4) -> {
            columnSelectorExpression.apply(new Tuple4<>(new SQLColumnResultSelectorImpl<>(tuple4.t()), new SQLColumnResultSelectorImpl<>(tuple4.t1()), new SQLColumnResultSelectorImpl<>(tuple4.t2()),new SQLColumnResultSelectorImpl<>(tuple4.t3())));
        });
    }

    default  Float avgFloatOrNullMerge(SQLExpression1, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector>> columnSelectorExpression) {
        return getClientQueryable4().avgFloatOrNullMerge((tuple4) -> {
            columnSelectorExpression.apply(new Tuple4<>(new SQLColumnResultSelectorImpl<>(tuple4.t()), new SQLColumnResultSelectorImpl<>(tuple4.t1()), new SQLColumnResultSelectorImpl<>(tuple4.t2()),new SQLColumnResultSelectorImpl<>(tuple4.t3())));
        });
    }

    default  Double avgOrDefaultMerge(SQLExpression1, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector>> columnSelectorExpression, Double def) {
        return getClientQueryable4().avgOrDefaultMerge((tuple4) -> {
            columnSelectorExpression.apply(new Tuple4<>(new SQLColumnResultSelectorImpl<>(tuple4.t()), new SQLColumnResultSelectorImpl<>(tuple4.t1()), new SQLColumnResultSelectorImpl<>(tuple4.t2()),new SQLColumnResultSelectorImpl<>(tuple4.t3())));
        }, def);
    }

    default  BigDecimal avgBigDecimalOrDefaultMerge(SQLExpression1, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector>> columnSelectorExpression, BigDecimal def) {
        return getClientQueryable4().avgBigDecimalOrDefaultMerge((tuple4) -> {
            columnSelectorExpression.apply(new Tuple4<>(new SQLColumnResultSelectorImpl<>(tuple4.t()), new SQLColumnResultSelectorImpl<>(tuple4.t1()), new SQLColumnResultSelectorImpl<>(tuple4.t2()),new SQLColumnResultSelectorImpl<>(tuple4.t3())));
        }, def);
    }

    default  Float avgFloatOrDefaultMerge(SQLExpression1, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector>> columnSelectorExpression, Float def) {
        return getClientQueryable4().avgFloatOrDefaultMerge((tuple4) -> {
            columnSelectorExpression.apply(new Tuple4<>(new SQLColumnResultSelectorImpl<>(tuple4.t()), new SQLColumnResultSelectorImpl<>(tuple4.t1()), new SQLColumnResultSelectorImpl<>(tuple4.t2()),new SQLColumnResultSelectorImpl<>(tuple4.t3())));
        }, def);
    }

    default  TResult avgOrDefaultMerge(SQLExpression1, SQLColumnResultSelector, SQLColumnResultSelector, SQLColumnResultSelector>> columnSelectorExpression, TResult def, Class resultClass) {
        return getClientQueryable4().avgOrDefaultMerge((tuple4) -> {
            columnSelectorExpression.apply(new Tuple4<>(new SQLColumnResultSelectorImpl<>(tuple4.t()), new SQLColumnResultSelectorImpl<>(tuple4.t1()), new SQLColumnResultSelectorImpl<>(tuple4.t2()),new SQLColumnResultSelectorImpl<>(tuple4.t3())));
        }, def, resultClass);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy