Mybatis generator 1.4.x 入门教程

查询 1 isNull/isNotNull 是 2 isEqualTo/isNotEqualTo 是否等于/不等于

 3 isEqualToWhenPresent/isNotEqualToWhenPresent    当存在时是否(不)等于
 4 isGreaterThan/isGreaterThanWhenPresent    大于
 5 isGreaterThanOrEqualTo/isGreaterThanOrEqualToWhenPresent    大于等于
 6 isLessThan/isLessThanWhenPresent/    小于
 7 isLessThanOrEqualTo/isLessThanOrEqualToWhenPresent    小于等于
 8 isIn/isNotIn    in操作
 9 isInWhenPresent/isNotInWhenPresent    in操作
10 isBetween/isNotBetween    是否在区间
11 isBetweenWhenPresent/isNotBetweenWhenPresent    是否在区间
12 isLike/isNotLike    like(需要添加%)
13 isLikeWhenPresent/isNotLikeWhenPresent    like(需要添加%)
14 isTrue/isFalse    是否是true/false
15 isLikeCaseInsensitive/isLikeCaseInsensitiveWhenPresent    like(需要添加%)
16 isNotLikeCaseInsensitive/isNotLikeCaseInsensitiveWhenPresent    like(需要添加%)
17 isInCaseInsensitive/isInCaseInsensitiveWhenPresent    in操作
18 isNotInCaseInsensitive/isNotInCaseInsensitiveWhenPresent    in操作

where条件查询还有很多我就不一一例举了,我这里有一张官方偷来的表格:

 

conditionexampleresult
between where(foo, isbetween(x).and(y)) where foo between ? and ?
equals where(foo, isequalto(x)) where foo = ?
greater than where(foo, isgreaterthan(x)) where foo > ?
greater than or equals where(foo, isgreaterthanorequalto(x)) where foo >= ?
in where(foo, isin(x, y)) where foo in (?,?)
in (case insensitive) where(foo, isincaseinsensitive(x, y)) where upper(foo) in (?,?) (the framework will transform the values for x and y to upper case)
less than where(foo, islessthan(x)) where foo < ?
less than or equals where(foo, islessthanorequalto(x)) where foo <= ?
like where(foo, islike(x)) where foo like ? (the framework does not add the sql wild cards to the value - you will need to do that yourself)
like (case insensitive) where(foo, islikecaseinsensitive(x)) where upper(foo) like ? (the framework does not add the sql wild cards to the value - you will need to do that yourself, the framework will transform the value of x to upper case)
not between where(foo, isnotbetween(x).and(y)) where foo not between ? and ?
not equals where(foo, isnotequalto(x)) where foo <> ?
not in where(foo, isnotin(x, y)) where foo not in (?,?)
not in (case insensitive) where(foo, isnotincaseinsensitive(x, y)) where upper(foo) not in (?,?) (the framework will transform the values for x and y to upper case)
not like where(foo, islike(x)) where foo not like ? (the framework does not add the sql wild cards to the value - you will need to do that yourself)
not like (case insensitive) where(foo, isnotlikecaseinsensitive(x)) where upper(foo) not like ? (the framework does not add the sql wild cards to the value - you will need to do that yourself, the framework will transform the value of x to upper case)
not null where(foo, isnotnull()) where foo is not null
null where(foo, isnull()) where foo is null
 
posted @ 2023-02-22 14:57  Tao!!  阅读(284)  评论(0)    收藏  举报