1. I am a rookie, in the process of learning springboot to do annotation mode of the full table fuzzy query, the result set of the query is always empty, but the sql statement in the navicat test can normally find the data, please answer the doubt, thank you very much.
2. I searched all the major websites for a long time, but I didn"t get a solution.
3.mapper method
@ Select ("SELECT id,parent_name,title,content,publish_time FROM tb_article WHERE CONCAT (id,parent_name,title,content) LIKE-sharp {params}")
public List<Article> selectParams(String params);
4.controller method
@ RequestMapping (value= "/ selectParam", method=RequestMethod.POST)
@ResponseBody
public List<Article> selectParam(@RequestParam String param){
System.out.println(param);
String params=""%"+param+"%"";
System.out.println(params);
if(params.equals("") || params==null) {
return asi.selectArticleAll();
}else {
return asi.selectParams(params);
}
}
Test statement in 5.navicat
SELECT id,parent_name,title,content,publish_time FROM tb_article WHERE CONCAT (id,parent_name,title,content) LIKE"% 1%"
6.postman
7. Please answer your doubts, thank you very much