Do pagination for the first time (no idea what the paging process is going to do?) )
Understanding: Actually is the foreground page by passing different parameters {1. The condition of the query. 2. Number of pages (Pagenum), 3 per page (pageSize)}, after we (only to do the background data processing (display to the foreground of the correct information is OK), regardless of the reception to take these data dry yarn.
[
{
"id": 64,
"Name": "Fdsaf"
}
]
Format these I'm using postman get Test (reverse is exactly this format)
. No matter what SQL query, first in the XXXX visualization tool inside the foreground may need to all the data query out (if you use the command window cool, no way can only say "old driver with Me"), (in fact, write a big idea, then a series of modified SQL statements, Personal feeling more convenient)
Note:
1
<if test= "Name! = NULL and name! = '" >
and name like '%${name}% '
</if>
Go
1. String concatenation in SQL
SELECT * from TableName where name is like CONCAT (CONCAT ('% ', #{text}), '% ');
2. Use ${...} instead of #{...}
SELECT * from TableName WHERE name is like '%${text}% ';
(This is what the SQL statement of the hemp Egg originally wrote.) I have been debugging for a long time because the original company directly fuzzy query is '% ' +{name}+ '% ' but not. I use the second kind directly)
2 interfaces queried in the Mapper.java file require fields to query otherwise you know
List<category> FindAll (@Param ("name") String name) throws Exception;
Pagehelper using:
Pagehelper.startpage (currenpage,pagesize); -----> These are the pagehelper that the front desk can send directly .
list<category> list = Categorymapper.findall (name);
List is the result you want to return
MySQL Paging processing (pagehelper)