SQL statements of special symbols
Special symbols |
< |
<= |
> |
>= |
& |
‘ |
“ |
replace |
< |
<= |
> |
>= |
& |
' |
" |
Dynamic demand sql statement
Concept: mapping file sql statement is not fixed, according to the number of parameters passed, sql statement needs to be changed dynamically.
For example: the demand for multi-criteria query
According to sql statement users to fill in different conditions can lead to execution are not the same
select * from tuser ;
select * from tuser where id = ?
select * from tuser where name = ? 等等
From the above needs to see: sql statement can not be finalized, in this demand below, Mybatis create a new label, can be used to determine, circulation and other sql tag.
Commonly used dynamic tag of Mybatis
Using Mybatis generated entity class tools required, DAO interface mapping file
The multi-criteria query
or