条件构造器

电子说

1.2w人已加入

描述

** allEq(全部eq或个别isNull):**

allEq(Map< R,V > params);
allEq(Map< R,V > params,boolean null2IsNull);
allEq(boolean condition, Map< R, V > params, boolean null2IsNull);

** Eq(等于):**

eq(R column,Object val);
eq(boolean condition,R column,Object val);

** ne(不等于):**

ne(R column,Object val);
ne(boolean condition,R column,Object val);

** gt(大于):**

gt(R column,Object val);gt(boolean condition,R column,Object val);

ge(大于等于):

ge(R column,Object val);
ge(boolean condition,R column,Object val);

** lt(小于):**

lt(R column,Object val);
lt(boolean condition,R column,Object val);

** le(小于等于):**

le(R column,Object val);
le(boolean condition,R column,Object val);

** between(between 值1 and 值2):**

between(R column,Objcet val1,Object val2);
between(boolean condition,R column,Objcet val1,Object val2);

** notBetween(not between 值1 and 值2):**

notBetween(R column,Object val1,Object val2);
notBetween(boolean condition,R column,Object val1,Object val2);

** like(like'%值%'):**

like(R column,Object val);
like(boolean condition,R column,Object val);

** notLike(not like'%值%'):**

notLike(R column,Object val);
notLike(boolean condition,R column,Object val);

** likeLeft(like '%值'):**

likeLeft(R column,Object val);
likeLeft(boolean condition,R column,Object val);

** likeRight(like'值%'):**

likeRight(R column,Object val);
likeRight(boolean condition,R column,Object val);

** isNull:**

isNull(R column);
isNull(boolean condition,R column);

** isNotNull:**

isNotNull(R column);
isNotNull(boolean condition,R column);

** in:**

in(R column,Collection ?  > value);
in(R column,Object... values);
in(boolean condition,R column,Collection ?  > value);
in(boolean condition,R column,Object... values);

** notIn:**

notIn(R column,Collection ?  > value);
notIn(R column,Object... values);
notIn(boolean condition,R column,Collection ?  > value);
notIn(boolean condition,R column,Object... values);

** inSql(字段in,sql语句):**

inSql(R column,String inValue);
inSql(boolean condition,R column,String inValue);

** notInSql:**

notInSql(R column,String inValue);
notInSql(boolean condition,R column,String inValue);

** groupBy:**

groupBy(R... columns);
groupBy(boolean condition,R... columns);

** orderBy:**

orderBy(boolean condition, boolean isAsc, R... columns);

** orderByAsc:**

orderByAsc(R... columns);
orderByAsc(boolean condition, R... columns);

** orderByDesc:**

orderByDesc(R... columns);
orderByDesc(boolean condition, R... columns);

** having:**

having(String sqlHaving, Object... params);
having(boolean condition, String sqlHaving, Object... params);

** func:**

func(Consumer< Children > consumer);
func(boolean condition,Consumer< Childern > consumer);
// 例如:func(i - > if(true){i.eq("id",1)}else{i.ne("id",1)})

** or(不调用or则默认为使用and连接):**

or()
or(boolean condition);

** and:**

and(Consumer< Param > consumer);
and(boolean condition,Consumer< Param > consumer);

** nested(正常嵌套不带and或者or):**

nested(Consumer< Param > consumer);
nested(boolean condition,Consumer< Param > consumer);
// 例如:nested(i - > i.eq("name","张山").eq("status","dead")) ==》
// name = '张山' and status = 'dead'

** exists:**

exists(String existSql);
exists(boolean condition, String existSql);

** notExists:**

notExists(String notExistsSql)
notExists(boolean condition, String notExistsSql)
打开APP阅读更多精彩内容
声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容侵权或者其他违规问题,请联系本站处理。 举报投诉

全部0条评论

快来发表一下你的评论吧 !

×
20
完善资料,
赚取积分