Mybatis自动生成的查询selectByExample(TExample example) 中like需要自己写通配符
-
TExample example = new TExample();
-
TExample.Criteria criteria = example.createCriteria();
-
if(StringUtils.isNotBlank(userName)){
-
userName = "%" + userName + "%";
-
}
-
if(StringUtils.isNotBlank(userName)){
-
criteria.andBuyerNameLike(userName);
-
}
-
dao.countByExample(example)