MyBatis Example.Criteria对象加入自定义SQL
需求:
单表查询 有类似这样的要求:
select xxx from table_name where column1 = ? and column2 = ?
and (column3 = ? or column4 = ? or column5 like ?)
使用生成的Example 对象如何实现?我还没找到方法,然后想着怎么加入自定义的SQL
实现如下:
1,Mapper,Example,Criteria 对象
@Autowired
private EnterpriseInfoMapper mapper;
EnterpriseInfoExample example = new EnterpriseInfoExample();
EnterpriseInfoExample.Criteria criteria = example.createCriteria<