Load method, to the SQL statement to pass a parameter of the kind, it seems that parametertype is not so important, do not write actually can, and SQL statements such as Username=#{a} in this can be casually written, as long as the pass is a string type, It is automatically taken out, followed by a single quotation mark, and then put in the SQL statement.
But if there are more than one parameter to set, then one by one corresponds, or with the object's property one by one corresponds to, or with the map of the key and the #{} of the thing one by one corresponding (the value will be put into the SQL statement). Here to pay great attention to the difference between #{} and ${}, the value that #{} takes out, and the double quotation marks are placed in the SQL statement, and ${} is not directly quoted, if the int type, or some type of string that does not need double quotes (for example, as the ID of the keyword, DESC, etc.) can choose this. But if you use #, in a single argument, the curly braces can be written casually, will be added automatically, but with $, the curly braces inside to have this property.
SELECT * from T_user where id=1 (or id= ' 1 ') can be taken out.
MyBatis parameter Issues