添加pom.xml依赖 < dependency> < groupId> </ groupId> < artifactId> </ artifactId> < version> </ version> </ dependency>  在controller层注入     @Autowired private  MapSearcher  mapSearcher; @Autowired private  BeanSearcher  beanSearcher; @GetMapping ( "findCustomer" ) public  ResponseEntity < ? > findCustomer ( )  { HashMap < String ,  Object > =  new  HashMap < > ( ) ; map. put ( "phone" , "2" ) ; mapSearcher. searchList ( CustomerOne . class ,  map) ; List < CustomerOne > =  beanSearcher. searchList ( CustomerOne . class ,  map) ; return  ResponseEntity . ok ( ) . body ( customerOnes) ; } 
entity实体类 @Data 
@TableName ( "customer" ) 
@SearchBean ( tables= "customer" , autoMapTo =  "customer" ) 
public  class  CustomerOne  { private  String  id; private  String  phone; private  String  address; } 
SQL 日志 logging : level : cn.zhxu.bs :  DEBUG
有了实体类后,接下来我们便用 MapSearcher 的 search(Class beanClass, Map<String, Object> params): SearchResult<Map<String, Object>> 方法来体验一下如何 只用一行代码 实现一个检索接口,代码如下 @RestController 
@RequestMapping ( "/user" ) 
public  class  UserController  { @Autowired private  MapSearcher  mapSearcher;               @GetMapping ( "/index" ) public  SearchResult < Map < String ,  Object > > index ( HttpServletRequest  request)  { return  mapSearcher. search ( User . class ,  MapUtils . flat ( request. getParameterMap ( ) ) ) ; } }