mybatis如何实现这样的联合SQL
想实现在这样的一条SQL请问mybatis怎么写?
select * from xx
where (name='x1' or info='x2') and pt='x3'
//代码片段
....
FunctionLinkExample example = new FunctionLinkExample();
FunctionLinkExample.Criteria example1 = example.createCriteria();
FunctionLinkExample.Criteria example2 = example.createCriteria();
if(StringUtils.isNotEmpty(functionLink.getName())){
example.or(example1.andNameLike("%" + functionLink.getName() + "%"));
example.or(example1.andInfoLike("%" + functionLink.getName() + "%"));
}
example2.andFlatformEqualTo(functionLink.getFlatform());
example.or(example2);
return this.functionLinkMapper.countByExample(example);
.....
这样写不行,请问哪里错了?