如何使用EntityWrapper写出And嵌套查询?

火柴头 发布于 04/15 19:43
阅读 49
收藏 0
select *
FROM inner_case
WHERE yn_flag = '1'
AND inner_case_code = 'JD20190401012f93'
AND (current_state IN ( '1', '2', '3' ) OR (current_state = '2' AND creator = 'hanfang15'))
;

EntityWrapper<InnerCase> innerCaseWrapper= new EntityWrapper<InnerCase>();
innerCaseWrapper
.eq("yn_flag", "1")
.andNew().eq("inner_case_code", "JD20190401012f93")
.andNew().in("current_state", Arrays.asList(new String[]{"1", "2", "3"})).or().eq("current_state", "2").and("creator", "jinjiankang");

这种写法不对。

加载中
返回顶部
顶部