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

com.easy.query.api4j.select.extension.queryable.SQLAggregatable1 Maven / Gradle / Ivy

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

import com.easy.query.api4j.util.EasyLambdaUtil;
import com.easy.query.core.basic.api.select.ClientQueryableAvailable;
import com.easy.query.core.expression.lambda.Property;

import java.math.BigDecimal;

/**
 * create time 2023/8/15 21:54
 * 文件说明
 *
 * @author xuejiaming
 */
public interface SQLAggregatable1 extends ClientQueryableAvailable {
    /**
     * 防止溢出
     *
     * @param column
     * @param 
     * @return
     */
    default  BigDecimal sumBigDecimalOrNull(Property column) {
        return getClientQueryable().sumBigDecimalOrNull(EasyLambdaUtil.getPropertyName(column));
    }

    default  BigDecimal sumBigDecimalOrDefault(Property column, BigDecimal def) {
        return getClientQueryable().sumBigDecimalOrDefault(EasyLambdaUtil.getPropertyName(column), def);
    }

    default  TMember sumOrNull(Property column) {
        return getClientQueryable().sumOrNull(EasyLambdaUtil.getPropertyName(column));
    }

    default  TMember sumOrDefault(Property column, TMember def) {
        return getClientQueryable().sumOrDefault(EasyLambdaUtil.getPropertyName(column), def);
    }

    default > TMember maxOrNull(Property column) {
        return getClientQueryable().maxOrNull(EasyLambdaUtil.getPropertyName(column));
    }

    default > TMember maxOrDefault(Property column, TMember def) {
        return getClientQueryable().maxOrDefault(EasyLambdaUtil.getPropertyName(column), def);
    }

    default  TMember minOrNull(Property column) {
        return getClientQueryable().minOrNull(EasyLambdaUtil.getPropertyName(column));
    }

    default  TMember minOrDefault(Property column, TMember def) {
        return getClientQueryable().minOrDefault(EasyLambdaUtil.getPropertyName(column), def);
    }

    default  Double avgOrNull(Property column) {
        return getClientQueryable().avgOrNull(EasyLambdaUtil.getPropertyName(column));
    }

    default  BigDecimal avgBigDecimalOrNull(Property column) {
        return getClientQueryable().avgBigDecimalOrNull(EasyLambdaUtil.getPropertyName(column));
    }

    default  Float avgFloatOrNull(Property column) {
        return getClientQueryable().avgFloatOrNull(EasyLambdaUtil.getPropertyName(column));
    }

    default  Double avgOrDefault(Property column, Double def) {
        return getClientQueryable().avgOrDefault(EasyLambdaUtil.getPropertyName(column), def);
    }

    default BigDecimal avgOrDefault(Property column, BigDecimal def) {
        return getClientQueryable().avgOrDefault(EasyLambdaUtil.getPropertyName(column), def);
    }

    default Float avgOrDefault(Property column, Float def) {
        return getClientQueryable().avgOrDefault(EasyLambdaUtil.getPropertyName(column), def);
    }

    default  TResult avgOrDefault(Property column, TResult def, Class resultClass) {
        return getClientQueryable().avgOrDefault(EasyLambdaUtil.getPropertyName(column), def, resultClass);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy