MyBatis QueryWrapper 简单用法

sql 语句

select * from data_log where status is null and ((ind is null and data_type='A') or (ind is not null and data_type='B'))

QueryWrapper<T> qw =new QueryWrapper<>();
qw.isNull("status");
qw.and(a->a.isNull("ind").eq("data_type","A")
            .or(b->b.isNotNull("ind").eq("data_type","B")));

 

posted on 2022-07-19 15:37  lovezj9012  阅读(122)  评论(0)    收藏  举报

导航