正文:

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

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

相关文章:

  • 2021-08-04
猜你喜欢
  • 2022-12-23
  • 2023-03-18
  • 2022-12-23
  • 2022-12-23
  • 2021-09-23
  • 2021-08-08
相关资源
相似解决方案