Mybatis fuzzy query how to write?

There are fuzzy query Mybatis in two ways: (recommend the first)

  1. When Java code that executes pass the wildcard %%

    List<User> userList=mapper.getUserLike("%李%");
    
  2. Use wildcards in sql mosaic!

    select * from mybatis.user where name like "%"#{value}"%"
    
Published 29 original articles · won praise 49 · views 1781

Guess you like

Origin blog.csdn.net/qq_41256881/article/details/105362677