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条件查询还有很多我就不一一例举了,我这里有一张官方偷来的表格:
condition | example | result |
---|---|---|
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 |
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· DeepSeek “源神”启动!「GitHub 热点速览」
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
· C# 集成 DeepSeek 模型实现 AI 私有化(本地部署与 API 调用教程)
· DeepSeek R1 简明指南:架构、训练、本地部署及硬件要求
· 2 本地部署DeepSeek模型构建本地知识库+联网搜索详细步骤