正文:

在Java中使用Mybatis自动生成的方法,like需要自己写通配符

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。
public List<TableA> query(String name) {
    Example example = new Example(TableA.class);
    example.createCriteria()
            .andLike("name", "%"+ name +"%");
    example.setOrderByClause("CREATE_TIME DESC");

    return this.tableAMapper.selectByExample(example);
}

参考博客:

1,mybatis Example Criteria like 模糊查询 - c2223164136的专栏 - CSDN博客
https://blog.csdn.net/cao_j/article/details/46941095

扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄