MyBatis-Plus 基础+进阶+实战 之 灵活使用lambda 构造sql 条件

2022-09-19 11:57:29 浏览数 (3)

B站、西瓜 有完整配套视频,免费观看

=

eq

代码语言:javascript复制
eq(R column, Object val)
eq(boolean condition, R column, Object val)

alleq

代码语言:javascript复制
allEq(Map<R, V> params)
allEq(Map<R, V> params, boolean null2IsNull)
allEq(boolean condition, Map<R, V> params, boolean null2IsNull)

!=

代码语言:javascript复制
ne(R column, Object val)
ne(boolean condition, R column, Object val)

>

代码语言:javascript复制
gt(R column, Object val)
gt(boolean condition, R column, Object val)

>=

代码语言:javascript复制
ge(R column, Object val)
ge(boolean condition, R column, Object val)

<

代码语言:javascript复制
lt(R column, Object val)
lt(boolean condition, R column, Object val)

<=

代码语言:javascript复制
le(R column, Object val)
le(boolean condition, R column, Object val)

between

代码语言:javascript复制
between(R column, Object val1, Object val2)
between(boolean condition, R column, Object val1, Object val2)

not Between

代码语言:javascript复制
notBetween(R column, Object val1, Object val2)
notBetween(boolean condition, R column, Object val1, Object val2)

like

like %%

代码语言:javascript复制
like(R column, Object val)
like(boolean condition, R column, Object val)

like %{param}

代码语言:javascript复制
likeLeft(R column, Object val)
likeLeft(boolean condition, R column, Object val)

like {param}%

代码语言:javascript复制
likeRight(R column, Object val)
likeRight(boolean condition, R column, Object val)

is null

代码语言:javascript复制
isNull(R column)
isNull(boolean condition, R column)

is not null

代码语言:javascript复制
isNotNull(R column)
isNotNull(boolean condition, R column)

in

代码语言:javascript复制
in(R column, Collection<?> value)
in(boolean condition, R column, Collection<?> value)

not in

代码语言:javascript复制
notIn(R column, Collection<?> value)
notIn(boolean condition, R column, Collection<?> value)

group by

代码语言:javascript复制
groupBy(R... columns)
groupBy(boolean condition, R... columns)

order by ... asc/desc

代码语言:javascript复制
orderByAsc(R... columns)
orderByAsc(boolean condition, R... columns)

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

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

and

代码语言:javascript复制
and(Consumer<Param> consumer)
and(boolean condition, Consumer<Param> consumer)

or

普通or

代码语言:javascript复制
or()
or(boolean condition)

嵌套or

代码语言:javascript复制
or(Consumer<Param> consumer)
or(boolean condition, Consumer<Param> consumer

成长心路 | 优质书单 | 面试资料

牛人故事 | 前沿技术 | 视频教程

0 人点赞