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

com.github.yulichang.wrapper.interfaces.Compare Maven / Gradle / Ivy

There is a newer version: 1.5.2
Show newest version
package com.github.yulichang.wrapper.interfaces;

import com.baomidou.mybatisplus.core.toolkit.support.SFunction;

import java.io.Serializable;
import java.util.Map;
import java.util.function.BiPredicate;

/**
 * 将原来的泛型R改成SFunction
 * 

* {@link com.baomidou.mybatisplus.core.conditions.interfaces.Compare} */ @SuppressWarnings("unused") public interface Compare extends Serializable { /** * ignore */ default Children allEq(Map, V> params) { return allEq(params, true); } /** * ignore */ default Children allEq(Map, V> params, boolean null2IsNull) { return allEq(true, params, null2IsNull); } /** * map 所有非空属性等于 = * * @param condition 执行条件 * @param params map 类型的参数, key 是字段名, value 是字段值 * @param null2IsNull 是否参数为 null 自动执行 isNull 方法, false 则忽略这个字段\ * @return children */ Children allEq(boolean condition, Map, V> params, boolean null2IsNull); /** * ignore */ default Children allEq(BiPredicate, V> filter, Map, V> params) { return allEq(filter, params, true); } /** * ignore */ default Children allEq(BiPredicate, V> filter, Map, V> params, boolean null2IsNull) { return allEq(true, filter, params, null2IsNull); } /** * 字段过滤接口,传入多参数时允许对参数进行过滤 * * @param condition 执行条件 * @param filter 返回 true 来允许字段传入比对条件中 * @param params map 类型的参数, key 是字段名, value 是字段值 * @param null2IsNull 是否参数为 null 自动执行 isNull 方法, false 则忽略这个字段 * @return children */ Children allEq(boolean condition, BiPredicate, V> filter, Map, V> params, boolean null2IsNull); /** * ignore */ @SuppressWarnings("UnusedReturnValue") default Children eq(SFunction column, Object val) { return eq(true, column, val); } /** * 等于 = * * @param condition 执行条件 * @param column 字段 * @param val 值 * @return children */ Children eq(boolean condition, SFunction column, Object val); /** * ignore */ default Children ne(SFunction column, Object val) { return ne(true, column, val); } /** * 不等于 <> * * @param condition 执行条件 * @param column 字段 * @param val 值 * @return children */ Children ne(boolean condition, SFunction column, Object val); /** * ignore */ default Children gt(SFunction column, Object val) { return gt(true, column, val); } /** * 大于 > * * @param condition 执行条件 * @param column 字段 * @param val 值 * @return children */ Children gt(boolean condition, SFunction column, Object val); /** * ignore */ default Children ge(SFunction column, Object val) { return ge(true, column, val); } /** * 大于等于 >= * * @param condition 执行条件 * @param column 字段 * @param val 值 * @return children */ Children ge(boolean condition, SFunction column, Object val); /** * ignore */ default Children lt(SFunction column, Object val) { return lt(true, column, val); } /** * 小于 < * * @param condition 执行条件 * @param column 字段 * @param val 值 * @return children */ Children lt(boolean condition, SFunction column, Object val); /** * ignore */ default Children le(SFunction column, Object val) { return le(true, column, val); } /** * 小于等于 <= * * @param condition 执行条件 * @param column 字段 * @param val 值 * @return children */ Children le(boolean condition, SFunction column, Object val); /** * ignore */ default Children between(SFunction column, Object val1, Object val2) { return between(true, column, val1, val2); } /** * BETWEEN 值1 AND 值2 * * @param condition 执行条件 * @param column 字段 * @param val1 值1 * @param val2 值2 * @return children */ Children between(boolean condition, SFunction column, Object val1, Object val2); /** * ignore */ default Children notBetween(SFunction column, Object val1, Object val2) { return notBetween(true, column, val1, val2); } /** * NOT BETWEEN 值1 AND 值2 * * @param condition 执行条件 * @param column 字段 * @param val1 值1 * @param val2 值2 * @return children */ Children notBetween(boolean condition, SFunction column, Object val1, Object val2); /** * ignore */ default Children like(SFunction column, Object val) { return like(true, column, val); } /** * LIKE '%值%' * * @param condition 执行条件 * @param column 字段 * @param val 值 * @return children */ Children like(boolean condition, SFunction column, Object val); /** * ignore */ default Children notLike(SFunction column, Object val) { return notLike(true, column, val); } /** * NOT LIKE '%值%' * * @param condition 执行条件 * @param column 字段 * @param val 值 * @return children */ Children notLike(boolean condition, SFunction column, Object val); /** * ignore */ default Children likeLeft(SFunction column, Object val) { return likeLeft(true, column, val); } /** * LIKE '%值' * * @param condition 执行条件 * @param column 字段 * @param val 值 * @return children */ Children likeLeft(boolean condition, SFunction column, Object val); /** * ignore */ default Children likeRight(SFunction column, Object val) { return likeRight(true, column, val); } /** * LIKE '值%' * * @param condition 执行条件 * @param column 字段 * @param val 值 * @return children */ Children likeRight(boolean condition, SFunction column, Object val); }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy