@Retention(value=RUNTIME) @Target(value={METHOD,FIELD}) public @interface NullTemplate
生成 colName is [not] null 的语句。
例如 PO 对象为
class TestPO {
private Long id;
@NullTemplate(accept = "hasName")
private String name;
}
那么查询条件为 {"hasName": "0"} 时生成 where name is null 的语句;查询条件为 {"hasName": "any other value"} 时生成 where name is not null 类似语句
没有 hasName 条件不生成对应语句
Copyright © 2023. All rights reserved.