Your queries have declared parameters that will be replaced with their corresponding values upon execution. The parameter names are properties on the object that you send to the query.
But your mapping has parameterType="int"
which is a simple value. The value will replace the parameter entirely. If your parameter type is a Map
or object of some sort then the names become important because they name the keys or properties of the object, respectively.
Because you have an int
the name is unimportant and can be #{maxrowcount}
, #{mcount}
, #{whatever}
. That's why the first part works.
For the second part it's trickier because _parameter
is undocumented. MyBatis is a nice framework but, sadly, lacks on the documentation part. The input parameter is stored under the key _parameter
in the mapping context. In this case it's your int
parameter. That's how the second part works.