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

com.easy.query.api4j.select.extension.queryable4.SQLOrderable4 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.select.Queryable4;
import com.easy.query.api4j.sql.SQLOrderBySelector;
import com.easy.query.api4j.sql.impl.SQLOrderByColumnSelectorImpl;
import com.easy.query.core.common.tuple.Tuple4;
import com.easy.query.core.expression.lambda.SQLExpression1;
import com.easy.query.core.expression.lambda.SQLExpression4;

/**
 * create time 2023/8/16 08:50
 * 文件说明
 *
 * @author xuejiaming
 */
public interface SQLOrderable4 extends ClientQueryable4Available, Queryable4Available {

    default Queryable4 orderByAsc(SQLExpression4, SQLOrderBySelector, SQLOrderBySelector, SQLOrderBySelector> selectExpression) {
        getClientQueryable4().orderByAsc((selector1, selector2, selector3,selector4) -> {
            selectExpression.apply(new SQLOrderByColumnSelectorImpl<>(selector1), new SQLOrderByColumnSelectorImpl<>(selector2), new SQLOrderByColumnSelectorImpl<>(selector3), new SQLOrderByColumnSelectorImpl<>(selector4));
        });
        return getQueryable4();
    }

    default Queryable4 orderByAsc(boolean condition, SQLExpression4, SQLOrderBySelector, SQLOrderBySelector, SQLOrderBySelector> selectExpression) {
        getClientQueryable4().orderByAsc(condition, (selector1, selector2, selector3,selector4) -> {
            selectExpression.apply(new SQLOrderByColumnSelectorImpl<>(selector1), new SQLOrderByColumnSelectorImpl<>(selector2), new SQLOrderByColumnSelectorImpl<>(selector3), new SQLOrderByColumnSelectorImpl<>(selector4));
        });
        return getQueryable4();
    }

    default Queryable4 orderByAscMerge(SQLExpression1, SQLOrderBySelector, SQLOrderBySelector, SQLOrderBySelector>> selectExpression) {
        return orderByAscMerge(true, selectExpression);
    }

    default Queryable4 orderByAscMerge(boolean condition, SQLExpression1, SQLOrderBySelector, SQLOrderBySelector, SQLOrderBySelector>> selectExpression) {
        return orderByAsc(condition, (t1, t2,t3, t4) -> {
            selectExpression.apply(new Tuple4<>(t1, t2,t3, t4));
        });
    }


    default Queryable4 orderByDesc(SQLExpression4, SQLOrderBySelector, SQLOrderBySelector, SQLOrderBySelector> selectExpression) {
        return orderByDesc(true, selectExpression);
    }

    default Queryable4 orderByDesc(boolean condition, SQLExpression4, SQLOrderBySelector, SQLOrderBySelector, SQLOrderBySelector> selectExpression) {
        getClientQueryable4().orderByDesc(condition, (selector1, selector2, selector3,selector4) -> {
            selectExpression.apply(new SQLOrderByColumnSelectorImpl<>(selector1), new SQLOrderByColumnSelectorImpl<>(selector2), new SQLOrderByColumnSelectorImpl<>(selector3), new SQLOrderByColumnSelectorImpl<>(selector4));
        });
        return getQueryable4();
    }

    default Queryable4 orderByDescMerge(SQLExpression1, SQLOrderBySelector, SQLOrderBySelector, SQLOrderBySelector>> selectExpression) {
        return orderByDescMerge(true, selectExpression);
    }

    default Queryable4 orderByDescMerge(boolean condition, SQLExpression1, SQLOrderBySelector, SQLOrderBySelector, SQLOrderBySelector>> selectExpression) {
        return orderByDesc(condition, (t1, t2,t3, t4) -> {
            selectExpression.apply(new Tuple4<>(t1, t2,t3, t4));
        });
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy