Class QueryWrap<T>
- Type Parameters:
T- 实体类型
- All Implemented Interfaces:
com.baomidou.mybatisplus.core.conditions.interfaces.Compare<QueryWrap<T>,,String> com.baomidou.mybatisplus.core.conditions.interfaces.Func<QueryWrap<T>,,String> com.baomidou.mybatisplus.core.conditions.interfaces.Join<QueryWrap<T>>,com.baomidou.mybatisplus.core.conditions.interfaces.Nested<QueryWrap<T>,,QueryWrap<T>> com.baomidou.mybatisplus.core.conditions.ISqlSegment,com.baomidou.mybatisplus.core.conditions.query.Query<QueryWrap<T>,,T, String> Serializable
public class QueryWrap<T>
extends com.baomidou.mybatisplus.core.conditions.AbstractWrapper<T,String,QueryWrap<T>>
implements com.baomidou.mybatisplus.core.conditions.query.Query<QueryWrap<T>,T,String>
Entity 对象封装操作类
相比 QueryWrapper 的增强如下: 1,new QueryWrapper(T entity)时, 对entity 中的string字段 %和_ 符号进行转义,便于模糊查询 2,对like方法的参数 %和_ 符号进行转义,便于模糊查询 3,对nested、eq、ne、gt、ge、lt、le、in、like 等方法 进行条件判断,null 或 "" 字段不加入查询 4,增加 leFooter 方法, 将日期参数值,强制转换成当天 23:59:59 5,增加 geHeader 方法, 将日期参数值,强制转换成当天 00:00:00
- Since:
- 2018-05-25
- Author:
- hubin miemie HCL
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.baomidou.mybatisplus.core.conditions.AbstractWrapper
com.baomidou.mybatisplus.core.conditions.AbstractWrapper.DoSomething -
Field Summary
Fields inherited from class com.baomidou.mybatisplus.core.conditions.AbstractWrapper
expression, lastSql, paramAlias, paramNameSeq, paramNameValuePairs, sqlComment, sqlFirst, typedThis -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription取消跳过空的字符串 不允许跳过空的字符串开启检查 SQL 注入voidclear()protected StringcolumnToString(String column) geHeader(String column, LocalDateTime val) ignore(BiFunction<T, A, ?> setColumn) 忽略实体中的某些字段,实体中的字段默认是会除了null以外的全部进行等值匹配 再次可以进行忽略in(String column, Collection<?> coll) instance()用于生成嵌套 sqllambda()返回一个支持 lambda 函数写法的 wrapperleFooter(String column, LocalDateTime val) notBetween(String column, Object val1, Object val2) select(Class<T> entityClass, Predicate<com.baomidou.mybatisplus.core.metadata.TableFieldInfo> predicate) Methods inherited from class com.baomidou.mybatisplus.core.conditions.AbstractWrapper
addCondition, addNestedCondition, allEq, allEq, and, and, appendSqlSegments, apply, between, clone, columnsToString, columnsToString, columnToSqlSegment, comment, doGroupBy, doOrderBy, eq, eqSql, exists, first, formatParam, formatSqlMaybeWithParam, func, ge, geSql, getEntity, getEntityClass, getExpression, getParamAlias, getParamNameValuePairs, getSqlComment, getSqlFirst, getSqlSegment, groupBy, groupBy, groupBy, groupBy, gt, gtSql, having, in, in, inExpression, inExpression, initNeed, inSql, isNotNull, isNull, isUseAnnotationOrderBy, last, le, leSql, like, likeLeft, likeRight, likeValue, lt, ltSql, maybeDo, ne, nested, not, not, notBetween, notExists, notIn, notIn, notInSql, notLike, notLikeLeft, notLikeRight, or, or, orderBy, orderBy, orderBy, orderBy, setEntity, setEntityClass, setParamAliasMethods inherited from class com.baomidou.mybatisplus.core.conditions.Wrapper
getCustomSqlSegment, getSqlSet, getTargetSql, isEmptyOfEntity, isEmptyOfNormal, isEmptyOfWhere, isNonEmptyOfEntity, isNonEmptyOfNormal, isNonEmptyOfWhere, nonEmptyOfEntity, nonEmptyOfNormal, nonEmptyOfWhereMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.baomidou.mybatisplus.core.conditions.interfaces.Compare
allEq, allEq, allEq, allEq, notLikeLeft, notLikeRightMethods inherited from interface com.baomidou.mybatisplus.core.conditions.interfaces.Func
eqSql, func, geSql, groupBy, groupBy, groupBy, gtSql, having, inSql, isNotNull, isNull, leSql, ltSql, notIn, notIn, notInSql, orderByAsc, orderByAsc, orderByAsc, orderByAsc, orderByAsc, orderByAsc, orderByAsc, orderByDesc, orderByDesc, orderByDesc, orderByDesc, orderByDesc, orderByDesc, orderByDescMethods inherited from interface com.baomidou.mybatisplus.core.conditions.interfaces.Join
apply, comment, exists, first, last, notExists, orMethods inherited from interface com.baomidou.mybatisplus.core.conditions.interfaces.Nested
and, not, orMethods inherited from interface com.baomidou.mybatisplus.core.conditions.query.Query
select, select, select, select
-
Constructor Details
-
QueryWrap
-
QueryWrap
public QueryWrap() -
QueryWrap
-
QueryWrap
-
-
Method Details
-
checkSqlInjection
开启检查 SQL 注入 -
columnToString
-
select
-
select
-
getSqlSelect
-
lambda
返回一个支持 lambda 函数写法的 wrapper -
instance
用于生成嵌套 sql故 sqlSelect 不向下传递
-
clear
public void clear() -
nested
-
eq
-
ne
-
gt
-
ge
-
geHeader
-
geHeader
-
lt
-
le
-
between
-
notBetween
-
like
-
notLike
-
likeLeft
-
likeRight
-
in
-
in
-
cancelSkipEmpty
取消跳过空的字符串 不允许跳过空的字符串- Returns:
- 自己
-
ignore
忽略实体中的某些字段,实体中的字段默认是会除了null以外的全部进行等值匹配 再次可以进行忽略- Parameters:
setColumn- 这个是传入的待忽略字段的set方法- Returns:
- 自己
-