example of the problem mybatis

where A and (B or C) =>(A and B)or (A and C)

Criteria c1 = example.createCriteria();
Criteria c2 = example.createCriteria();

c1.andDelmarkEqualTo(1).andCodeLike("%"+keyword+"%");

c2.andDelmarkEqualTo(1).andNameLike("%"+keyword+"%");

example.or(c2);

 

Guess you like

Origin www.cnblogs.com/wangsihui/p/12513375.html