|
@@ -32,7 +32,11 @@ import java.util.function.Consumer;
|
|
|
public interface Func<Children, R> extends Serializable {
|
|
|
|
|
|
/**
|
|
|
- * ignore
|
|
|
+ * 字段 IS NULL
|
|
|
+ * <p>例: isNull("name")</p>
|
|
|
+ *
|
|
|
+ * @param column 字段
|
|
|
+ * @return children
|
|
|
*/
|
|
|
default Children isNull(R column) {
|
|
|
return isNull(true, column);
|
|
@@ -40,7 +44,7 @@ public interface Func<Children, R> extends Serializable {
|
|
|
|
|
|
/**
|
|
|
* 字段 IS NULL
|
|
|
- * <p>例: isNull("name")</p>
|
|
|
+ * <p>例: isNull(true, "name")</p>
|
|
|
*
|
|
|
* @param condition 执行条件
|
|
|
* @param column 字段
|
|
@@ -49,7 +53,11 @@ public interface Func<Children, R> extends Serializable {
|
|
|
Children isNull(boolean condition, R column);
|
|
|
|
|
|
/**
|
|
|
- * ignore
|
|
|
+ * 字段 IS NOT NULL
|
|
|
+ * <p>例: isNotNull("name")</p>
|
|
|
+ *
|
|
|
+ * @param column 字段
|
|
|
+ * @return children
|
|
|
*/
|
|
|
default Children isNotNull(R column) {
|
|
|
return isNotNull(true, column);
|
|
@@ -57,7 +65,7 @@ public interface Func<Children, R> extends Serializable {
|
|
|
|
|
|
/**
|
|
|
* 字段 IS NOT NULL
|
|
|
- * <p>例: isNotNull("name")</p>
|
|
|
+ * <p>例: isNotNull(true, "name")</p>
|
|
|
*
|
|
|
* @param condition 执行条件
|
|
|
* @param column 字段
|
|
@@ -66,7 +74,15 @@ public interface Func<Children, R> extends Serializable {
|
|
|
Children isNotNull(boolean condition, R column);
|
|
|
|
|
|
/**
|
|
|
- * ignore
|
|
|
+ * 字段 IN (value.get(0), value.get(1), ...)
|
|
|
+ * <p>例: in("id", Arrays.asList(1, 2, 3, 4, 5))</p>
|
|
|
+ *
|
|
|
+ * <li> 注意!当集合为 空或null 时, sql会拼接为:WHERE (字段名 IN ()), 执行时报错</li>
|
|
|
+ * <li> 若要在特定条件下不拼接, 可在 condition 条件中判断 </li>
|
|
|
+ *
|
|
|
+ * @param column 字段
|
|
|
+ * @param coll 数据集合
|
|
|
+ * @return children
|
|
|
*/
|
|
|
default Children in(R column, Collection<?> coll) {
|
|
|
return in(true, column, coll);
|
|
@@ -74,7 +90,7 @@ public interface Func<Children, R> extends Serializable {
|
|
|
|
|
|
/**
|
|
|
* 字段 IN (value.get(0), value.get(1), ...)
|
|
|
- * <p>例: in("id", Arrays.asList(1, 2, 3, 4, 5))</p>
|
|
|
+ * <p>例: in(true, "id", Arrays.asList(1, 2, 3, 4, 5))</p>
|
|
|
*
|
|
|
* <li> 注意!当集合为 空或null 时, sql会拼接为:WHERE (字段名 IN ()), 执行时报错</li>
|
|
|
* <li> 若要在特定条件下不拼接, 可在 condition 条件中判断 </li>
|
|
@@ -87,7 +103,15 @@ public interface Func<Children, R> extends Serializable {
|
|
|
Children in(boolean condition, R column, Collection<?> coll);
|
|
|
|
|
|
/**
|
|
|
- * ignore
|
|
|
+ * 字段 IN (v0, v1, ...)
|
|
|
+ * <p>例: in("id", 1, 2, 3, 4, 5)</p>
|
|
|
+ *
|
|
|
+ * <li> 注意!当数组为 空或null 时, sql会拼接为:WHERE (字段名 IN ()), 执行时报错</li>
|
|
|
+ * <li> 若要在特定条件下不拼接, 可在 condition 条件中判断 </li>
|
|
|
+ *
|
|
|
+ * @param column 字段
|
|
|
+ * @param values 数据数组
|
|
|
+ * @return children
|
|
|
*/
|
|
|
default Children in(R column, Object... values) {
|
|
|
return in(true, column, values);
|
|
@@ -95,7 +119,7 @@ public interface Func<Children, R> extends Serializable {
|
|
|
|
|
|
/**
|
|
|
* 字段 IN (v0, v1, ...)
|
|
|
- * <p>例: in("id", 1, 2, 3, 4, 5)</p>
|
|
|
+ * <p>例: in(true, "id", 1, 2, 3, 4, 5)</p>
|
|
|
*
|
|
|
* <li> 注意!当数组为 空或null 时, sql会拼接为:WHERE (字段名 IN ()), 执行时报错</li>
|
|
|
* <li> 若要在特定条件下不拼接, 可在 condition 条件中判断 </li>
|
|
@@ -108,7 +132,15 @@ public interface Func<Children, R> extends Serializable {
|
|
|
Children in(boolean condition, R column, Object... values);
|
|
|
|
|
|
/**
|
|
|
- * ignore
|
|
|
+ * 字段 NOT IN (value.get(0), value.get(1), ...)
|
|
|
+ * <p>例: notIn("id", Arrays.asList(1, 2, 3, 4, 5))</p>
|
|
|
+ *
|
|
|
+ * <li> 注意!当集合为 空或null 时, sql会拼接为:WHERE (字段名 NOT IN ()), 执行时报错</li>
|
|
|
+ * <li> 若要在特定条件下不拼接, 可在 condition 条件中判断 </li>
|
|
|
+ *
|
|
|
+ * @param column 字段
|
|
|
+ * @param coll 数据集合
|
|
|
+ * @return children
|
|
|
*/
|
|
|
default Children notIn(R column, Collection<?> coll) {
|
|
|
return notIn(true, column, coll);
|
|
@@ -116,7 +148,7 @@ public interface Func<Children, R> extends Serializable {
|
|
|
|
|
|
/**
|
|
|
* 字段 NOT IN (value.get(0), value.get(1), ...)
|
|
|
- * <p>例: notIn("id", Arrays.asList(1, 2, 3, 4, 5))</p>
|
|
|
+ * <p>例: notIn(true, "id", Arrays.asList(1, 2, 3, 4, 5))</p>
|
|
|
*
|
|
|
* <li> 注意!当集合为 空或null 时, sql会拼接为:WHERE (字段名 NOT IN ()), 执行时报错</li>
|
|
|
* <li> 若要在特定条件下不拼接, 可在 condition 条件中判断 </li>
|
|
@@ -129,15 +161,23 @@ public interface Func<Children, R> extends Serializable {
|
|
|
Children notIn(boolean condition, R column, Collection<?> coll);
|
|
|
|
|
|
/**
|
|
|
- * ignore
|
|
|
+ * 字段 NOT IN (v0, v1, ...)
|
|
|
+ * <p>例: notIn("id", 1, 2, 3, 4, 5)</p>
|
|
|
+ *
|
|
|
+ * <li> 注意!当数组为 空或null 时, sql会拼接为:WHERE (字段名 NOT IN ()), 执行时报错</li>
|
|
|
+ * <li> 若要在特定条件下不拼接, 可在 condition 条件中判断 </li>
|
|
|
+ *
|
|
|
+ * @param column 字段
|
|
|
+ * @param values 数据数组
|
|
|
+ * @return children
|
|
|
*/
|
|
|
- default Children notIn(R column, Object... value) {
|
|
|
- return notIn(true, column, value);
|
|
|
+ default Children notIn(R column, Object... values) {
|
|
|
+ return notIn(true, column, values);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 字段 NOT IN (v0, v1, ...)
|
|
|
- * <p>例: notIn("id", 1, 2, 3, 4, 5)</p>
|
|
|
+ * <p>例: notIn(true, "id", 1, 2, 3, 4, 5)</p>
|
|
|
*
|
|
|
* <li> 注意!当数组为 空或null 时, sql会拼接为:WHERE (字段名 NOT IN ()), 执行时报错</li>
|
|
|
* <li> 若要在特定条件下不拼接, 可在 condition 条件中判断 </li>
|
|
@@ -150,103 +190,141 @@ public interface Func<Children, R> extends Serializable {
|
|
|
Children notIn(boolean condition, R column, Object... values);
|
|
|
|
|
|
/**
|
|
|
- * ignore
|
|
|
+ * 字段 IN ( sql语句 )
|
|
|
+ * <p>!! sql 注入方式的 in 方法 !!</p>
|
|
|
+ * <p>例1: inSql("id", "1")</p>
|
|
|
+ * <p>例2: inSql("id", "select id from table where id < 3")</p>
|
|
|
+ *
|
|
|
+ * @param column 字段
|
|
|
+ * @param sql sql语句
|
|
|
+ * @return children
|
|
|
*/
|
|
|
- default Children inSql(R column, String inValue) {
|
|
|
- return inSql(true, column, inValue);
|
|
|
+ default Children inSql(R column, String sql) {
|
|
|
+ return inSql(true, column, sql);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 字段 IN ( sql语句 )
|
|
|
* <p>!! sql 注入方式的 in 方法 !!</p>
|
|
|
- * <p>例1: inSql("id", "1, 2, 3, 4, 5, 6")</p>
|
|
|
- * <p>例2: inSql("id", "select id from table where id < 3")</p>
|
|
|
+ * <p>例1: inSql(true, "id", "1")</p>
|
|
|
+ * <p>例2: inSql(true, "id", "select id from table where id < 3")</p>
|
|
|
*
|
|
|
* @param condition 执行条件
|
|
|
* @param column 字段
|
|
|
- * @param inValue sql语句
|
|
|
+ * @param sql sql语句
|
|
|
* @return children
|
|
|
*/
|
|
|
- Children inSql(boolean condition, R column, String inValue);
|
|
|
+ Children inSql(boolean condition, R column, String sql);
|
|
|
|
|
|
/**
|
|
|
* 字段 > ( sql语句 )
|
|
|
- * <p>例1: gtSql("id", "1, 2, 3, 4, 5, 6")</p>
|
|
|
- * <p>例1: gtSql("id", "select id from table where name = 'JunJun'")</p>
|
|
|
+ * <p>例1: gtSql(true, "id", "1")</p>
|
|
|
+ * <p>例1: gtSql(true, "id", "select id from table where name = 'JunJun'")</p>
|
|
|
*
|
|
|
- * @param condition
|
|
|
- * @param column
|
|
|
- * @param inValue
|
|
|
- * @return
|
|
|
+ * @param condition 执行条件
|
|
|
+ * @param column 字段
|
|
|
+ * @param sql sql语句
|
|
|
+ * @return children
|
|
|
*/
|
|
|
- Children gtSql(boolean condition, R column, String inValue);
|
|
|
+ Children gtSql(boolean condition, R column, String sql);
|
|
|
|
|
|
/**
|
|
|
- * ignore
|
|
|
+ * 字段 > ( sql语句 )
|
|
|
+ * <p>例1: gtSql("id", "1")</p>
|
|
|
+ * <p>例1: gtSql("id", "select id from table where name = 'JunJun'")</p>
|
|
|
+ *
|
|
|
+ * @param column 字段
|
|
|
+ * @param sql sql语句
|
|
|
+ * @return children
|
|
|
*/
|
|
|
- default Children gtSql(R column, String inValue) {
|
|
|
- return gtSql(true, column, inValue);
|
|
|
+ default Children gtSql(R column, String sql) {
|
|
|
+ return gtSql(true, column, sql);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 字段 >= ( sql语句 )
|
|
|
- * <p>例1: geSql("id", "1, 2, 3, 4, 5, 6")</p>
|
|
|
- * <p>例1: geSql("id", "select id from table where name = 'JunJun'")</p>
|
|
|
+ * <p>例1: geSql(true, "id", "1")</p>
|
|
|
+ * <p>例1: geSql(true, "id", "select id from table where name = 'JunJun'")</p>
|
|
|
*
|
|
|
- * @param condition
|
|
|
- * @param column
|
|
|
- * @param inValue
|
|
|
- * @return
|
|
|
+ * @param condition 执行条件
|
|
|
+ * @param column 字段
|
|
|
+ * @param sql sql语句
|
|
|
+ * @return children
|
|
|
*/
|
|
|
- Children geSql(boolean condition, R column, String inValue);
|
|
|
+ Children geSql(boolean condition, R column, String sql);
|
|
|
|
|
|
/**
|
|
|
- * ignore
|
|
|
+ * 字段 >= ( sql语句 )
|
|
|
+ * <p>例1: geSql("id", "1")</p>
|
|
|
+ * <p>例1: geSql("id", "select id from table where name = 'JunJun'")</p>
|
|
|
+ *
|
|
|
+ * @param column 字段
|
|
|
+ * @param sql sql语句
|
|
|
+ * @return children
|
|
|
*/
|
|
|
- default Children geSql(R column, String inValue) {
|
|
|
- return geSql(true, column, inValue);
|
|
|
+ default Children geSql(R column, String sql) {
|
|
|
+ return geSql(true, column, sql);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 字段 < ( sql语句 )
|
|
|
- * <p>例1: ltSql("id", "1, 2, 3, 4, 5, 6")</p>
|
|
|
- * <p>例1: ltSql("id", "select id from table where name = 'JunJun'")</p>
|
|
|
+ * <p>例1: ltSql(true, "id", "1")</p>
|
|
|
+ * <p>例1: ltSql(true , "id", "select id from table where name = 'JunJun'")</p>
|
|
|
*
|
|
|
- * @param condition
|
|
|
- * @param column
|
|
|
- * @param inValue
|
|
|
- * @return
|
|
|
+ * @param condition 执行条件
|
|
|
+ * @param column 字段
|
|
|
+ * @param sql sql语句
|
|
|
+ * @return children
|
|
|
*/
|
|
|
- Children ltSql(boolean condition, R column, String inValue);
|
|
|
+ Children ltSql(boolean condition, R column, String sql);
|
|
|
|
|
|
/**
|
|
|
- * ignore
|
|
|
+ * 字段 < ( sql语句 )
|
|
|
+ * <p>例1: ltSql("id", "1")</p>
|
|
|
+ * <p>例1: ltSql("id", "select id from table where name = 'JunJun'")</p>
|
|
|
+ *
|
|
|
+ * @param column 字段
|
|
|
+ * @param sql sql语句
|
|
|
+ * @return children
|
|
|
*/
|
|
|
- default Children ltSql(R column, String inValue) {
|
|
|
- return ltSql(true, column, inValue);
|
|
|
+ default Children ltSql(R column, String sql) {
|
|
|
+ return ltSql(true, column, sql);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 字段 <= ( sql语句 )
|
|
|
- * <p>例1: leSql("id", "1, 2, 3, 4, 5, 6")</p>
|
|
|
- * <p>例1: leSql("id", "select id from table where name = 'JunJun'")</p>
|
|
|
+ * <p>例1: leSql(true, "id", "1")</p>
|
|
|
+ * <p>例1: leSql(true ,"id", "select id from table where name = 'JunJun'")</p>
|
|
|
*
|
|
|
- * @param condition
|
|
|
- * @param column
|
|
|
- * @param inValue
|
|
|
- * @return
|
|
|
+ * @param condition 执行条件
|
|
|
+ * @param column 字段
|
|
|
+ * @param sql sql语句
|
|
|
+ * @return children
|
|
|
*/
|
|
|
- Children leSql(boolean condition, R column, String inValue);
|
|
|
+ Children leSql(boolean condition, R column, String sql);
|
|
|
|
|
|
/**
|
|
|
- * ignore
|
|
|
+ * 字段 <= ( sql语句 )
|
|
|
+ * <p>例1: leSql("id", "1")</p>
|
|
|
+ * <p>例1: leSql("id", "select id from table where name = 'JunJun'")</p>
|
|
|
+ *
|
|
|
+ * @param column 字段
|
|
|
+ * @param inValue sql语句
|
|
|
+ * @return children
|
|
|
*/
|
|
|
default Children leSql(R column, String inValue) {
|
|
|
return leSql(true, column, inValue);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * ignore
|
|
|
+ * 字段 NOT IN ( sql语句 )
|
|
|
+ * <p>!! sql 注入方式的 not in 方法 !!</p>
|
|
|
+ * <p>例1: notInSql("id", "1, 2, 3, 4, 5, 6")</p>
|
|
|
+ * <p>例2: notInSql("id", "select id from table where id < 3")</p>
|
|
|
+ *
|
|
|
+ * @param column 字段
|
|
|
+ * @param inValue sql语句 ---> 1,2,3,4,5,6 或者 select id from table where id < 3
|
|
|
+ * @return children
|
|
|
*/
|
|
|
default Children notInSql(R column, String inValue) {
|
|
|
return notInSql(true, column, inValue);
|
|
@@ -255,8 +333,8 @@ public interface Func<Children, R> extends Serializable {
|
|
|
/**
|
|
|
* 字段 NOT IN ( sql语句 )
|
|
|
* <p>!! sql 注入方式的 not in 方法 !!</p>
|
|
|
- * <p>例1: notInSql("id", "1, 2, 3, 4, 5, 6")</p>
|
|
|
- * <p>例2: notInSql("id", "select id from table where id < 3")</p>
|
|
|
+ * <p>例1: notInSql(true, "id", "1, 2, 3, 4, 5, 6")</p>
|
|
|
+ * <p>例2: notInSql(true, "id", "select id from table where id < 3")</p>
|
|
|
*
|
|
|
* @param condition 执行条件
|
|
|
* @param column 字段
|
|
@@ -267,7 +345,7 @@ public interface Func<Children, R> extends Serializable {
|
|
|
|
|
|
/**
|
|
|
* 分组:GROUP BY 字段, ...
|
|
|
- * <p>例: groupBy("id")</p>
|
|
|
+ * <p>例: groupBy(true, "id")</p>
|
|
|
*
|
|
|
* @param condition 执行条件
|
|
|
* @param column 单个字段
|
|
@@ -275,13 +353,20 @@ public interface Func<Children, R> extends Serializable {
|
|
|
*/
|
|
|
Children groupBy(boolean condition, R column);
|
|
|
|
|
|
+ /**
|
|
|
+ * 分组:GROUP BY 字段, ...
|
|
|
+ * <p>例: groupBy("id")</p>
|
|
|
+ *
|
|
|
+ * @param column 单个字段
|
|
|
+ * @return children
|
|
|
+ */
|
|
|
default Children groupBy(R column) {
|
|
|
return groupBy(true, column);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 分组:GROUP BY 字段, ...
|
|
|
- * <p>例: groupBy(Arrays.asList("id", "name"))</p>
|
|
|
+ * <p>例: groupBy(true, Arrays.asList("id", "name"))</p>
|
|
|
*
|
|
|
* @param condition 执行条件
|
|
|
* @param columns 字段数组
|
|
@@ -289,26 +374,52 @@ public interface Func<Children, R> extends Serializable {
|
|
|
*/
|
|
|
Children groupBy(boolean condition, List<R> columns);
|
|
|
|
|
|
+ /**
|
|
|
+ * 分组:GROUP BY 字段, ...
|
|
|
+ * <p>例: groupBy(Arrays.asList("id", "name"))</p>
|
|
|
+ *
|
|
|
+ * @param columns 字段数组
|
|
|
+ * @return children
|
|
|
+ */
|
|
|
default Children groupBy(List<R> columns) {
|
|
|
return groupBy(true, columns);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 分组:GROUP BY 字段, ...
|
|
|
+ * <p>例: groupBy("id", "name")</p>
|
|
|
+ *
|
|
|
+ * @param column 单个字段
|
|
|
+ * @param columns 字段数组
|
|
|
+ * @return children
|
|
|
+ */
|
|
|
default Children groupBy(R column, R... columns) {
|
|
|
return groupBy(true, column, columns);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 分组:GROUP BY 字段, ...
|
|
|
+ * <p>例: groupBy(true, "id", "name")</p>
|
|
|
+ *
|
|
|
+ * @param condition 执行条件
|
|
|
+ * @param column 单个字段
|
|
|
+ * @param columns 字段数组
|
|
|
+ * @return children
|
|
|
*/
|
|
|
Children groupBy(boolean condition, R column, R... columns);
|
|
|
|
|
|
/**
|
|
|
* 分组:GROUP BY 字段, ...
|
|
|
+ * <p>例: groupBy(true, "id", Arrays.asList("name"))</p>
|
|
|
+ *
|
|
|
+ * @param condition 执行条件
|
|
|
+ * @param column 单个字段
|
|
|
+ * @param columns 字段数组
|
|
|
+ * @return children
|
|
|
* @since 3.5.4
|
|
|
*/
|
|
|
Children groupBy(boolean condition, R column, List<R> columns);
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 排序:ORDER BY 字段, ... ASC
|
|
|
* <p>例: orderByAsc(true, "id")</p>
|
|
@@ -321,6 +432,13 @@ public interface Func<Children, R> extends Serializable {
|
|
|
return orderBy(condition, true, column);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 排序:ORDER BY 字段, ... ASC
|
|
|
+ * <p>例: orderByAsc("id")</p>
|
|
|
+ *
|
|
|
+ * @param column 单个字段
|
|
|
+ * @return children
|
|
|
+ */
|
|
|
default Children orderByAsc(R column) {
|
|
|
return orderByAsc(true, column);
|
|
|
}
|
|
@@ -337,16 +455,34 @@ public interface Func<Children, R> extends Serializable {
|
|
|
return orderBy(condition, true, columns);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 排序:ORDER BY 字段, ... ASC
|
|
|
+ * <p>例: orderByAsc(Arrays.asList("id", "name"))</p>
|
|
|
+ *
|
|
|
+ * @param columns 字段数组
|
|
|
+ * @return children
|
|
|
+ */
|
|
|
default Children orderByAsc(List<R> columns) {
|
|
|
return orderByAsc(true, columns);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 排序:ORDER BY 字段, ... ASC
|
|
|
+ *
|
|
|
+ * @param column 字段
|
|
|
+ * @param columns 字段数组
|
|
|
+ * @return children
|
|
|
+ */
|
|
|
default Children orderByAsc(R column, R... columns) {
|
|
|
return orderByAsc(true, column, columns);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 排序:ORDER BY 字段, ... ASC
|
|
|
+ *
|
|
|
+ * @param condition 执行条件
|
|
|
+ * @param column 字段
|
|
|
+ * @param columns 字段数组
|
|
|
*/
|
|
|
default Children orderByAsc(boolean condition, R column, R... columns) {
|
|
|
return orderBy(condition, true, column, columns);
|
|
@@ -354,7 +490,11 @@ public interface Func<Children, R> extends Serializable {
|
|
|
|
|
|
/**
|
|
|
* 排序:ORDER BY 字段, ... ASC
|
|
|
+ * <p>例: orderByAsc(true, Arrays.asList("id", "name"))</p>
|
|
|
*
|
|
|
+ * @param condition 执行条件
|
|
|
+ * @param columns 字段数组
|
|
|
+ * @return children
|
|
|
* @since 3.5.4
|
|
|
*/
|
|
|
default Children orderByAsc(boolean condition, R column, List<R> columns) {
|
|
@@ -373,6 +513,13 @@ public interface Func<Children, R> extends Serializable {
|
|
|
return orderBy(condition, false, column);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 排序:ORDER BY 字段, ... DESC
|
|
|
+ * <p>例: orderByDesc("id")</p>
|
|
|
+ *
|
|
|
+ * @param column 字段
|
|
|
+ * @return children
|
|
|
+ */
|
|
|
default Children orderByDesc(R column) {
|
|
|
return orderByDesc(true, column);
|
|
|
}
|
|
@@ -389,16 +536,31 @@ public interface Func<Children, R> extends Serializable {
|
|
|
return orderBy(condition, false, columns);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 排序:ORDER BY 字段, ... DESC
|
|
|
+ *
|
|
|
+ * @param columns 字段列表
|
|
|
+ */
|
|
|
default Children orderByDesc(List<R> columns) {
|
|
|
return orderByDesc(true, columns);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 排序:ORDER BY 字段, ... DESC
|
|
|
+ *
|
|
|
+ * @param column 单个字段
|
|
|
+ * @param columns 字段列表
|
|
|
+ */
|
|
|
default Children orderByDesc(R column, R... columns) {
|
|
|
return orderByDesc(true, column, columns);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 排序:ORDER BY 字段, ... DESC
|
|
|
+ *
|
|
|
+ * @param condition 执行条件
|
|
|
+ * @param column 单个字段
|
|
|
+ * @param columns 字段列表
|
|
|
*/
|
|
|
default Children orderByDesc(boolean condition, R column, R... columns) {
|
|
|
return orderBy(condition, false, column, CollectionUtils.toList(columns));
|
|
@@ -407,6 +569,9 @@ public interface Func<Children, R> extends Serializable {
|
|
|
/**
|
|
|
* 排序:ORDER BY 字段, ... DESC
|
|
|
*
|
|
|
+ * @param condition 执行条件
|
|
|
+ * @param column 单个字段
|
|
|
+ * @param columns 字段列表
|
|
|
* @since 3.5.4
|
|
|
*/
|
|
|
default Children orderByDesc(boolean condition, R column, List<R> columns) {
|
|
@@ -438,20 +603,34 @@ public interface Func<Children, R> extends Serializable {
|
|
|
|
|
|
/**
|
|
|
* 排序:ORDER BY 字段, ...
|
|
|
+ *
|
|
|
+ * @param condition 执行条件
|
|
|
+ * @param isAsc 是否是 ASC 排序
|
|
|
+ * @param columns 字段列表
|
|
|
+ * @return children
|
|
|
*/
|
|
|
Children orderBy(boolean condition, boolean isAsc, R column, R... columns);
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 排序:ORDER BY 字段, ...
|
|
|
*
|
|
|
+ * @param condition 执行条件
|
|
|
+ * @param isAsc 是否是 ASC 排序
|
|
|
+ * @param columns 字段列表
|
|
|
+ * @return children
|
|
|
* @since 3.5.4
|
|
|
*/
|
|
|
Children orderBy(boolean condition, boolean isAsc, R column, List<R> columns);
|
|
|
|
|
|
|
|
|
/**
|
|
|
- * ignore
|
|
|
+ * HAVING ( sql语句 )
|
|
|
+ * <p>例1: having("sum(age) > 10")</p>
|
|
|
+ * <p>例2: having("sum(age) > {0}", 10)</p>
|
|
|
+ *
|
|
|
+ * @param sqlHaving sql 语句
|
|
|
+ * @param params 参数数组
|
|
|
+ * @return children
|
|
|
*/
|
|
|
default Children having(String sqlHaving, Object... params) {
|
|
|
return having(true, sqlHaving, params);
|
|
@@ -459,8 +638,8 @@ public interface Func<Children, R> extends Serializable {
|
|
|
|
|
|
/**
|
|
|
* HAVING ( sql语句 )
|
|
|
- * <p>例1: having("sum(age) > 10")</p>
|
|
|
- * <p>例2: having("sum(age) > {0}", 10)</p>
|
|
|
+ * <p>例1: having(true, "sum(age) > 10")</p>
|
|
|
+ * <p>例2: having(true, "sum(age) > {0}", 10)</p>
|
|
|
*
|
|
|
* @param condition 执行条件
|
|
|
* @param sqlHaving sql 语句
|
|
@@ -470,7 +649,10 @@ public interface Func<Children, R> extends Serializable {
|
|
|
Children having(boolean condition, String sqlHaving, Object... params);
|
|
|
|
|
|
/**
|
|
|
- * ignore
|
|
|
+ * 消费函数
|
|
|
+ *
|
|
|
+ * @param consumer 消费函数
|
|
|
+ * @return children
|
|
|
*/
|
|
|
default Children func(Consumer<Children> consumer) {
|
|
|
return func(true, consumer);
|
|
@@ -479,7 +661,8 @@ public interface Func<Children, R> extends Serializable {
|
|
|
/**
|
|
|
* 消费函数
|
|
|
*
|
|
|
- * @param consumer 消费函数
|
|
|
+ * @param condition 执行条件
|
|
|
+ * @param consumer 消费函数
|
|
|
* @return children
|
|
|
* @since 3.3.1
|
|
|
*/
|