Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Mybatis' problem (parameterType, statementType)
Mybatis' problem (parameterType, statementType)
When there is only one parameter in the interface and @Param is not used, it is necessary to add a response in the format of parameterTypexml;

If there are multiple parameters, when each parameter is @Param, the parameterType parameter type will not be read, and the value in the parameter will be obtained directly.

StatementType: marks the object that operates SQL.

Value description:

1, statement: directly operate sql without precompiling, get data: $-statement.

2.PREPARED: preprocessing, parameters and precompiling to obtain data: #-PreparedStatement: default value.

Note: This is the default, that is, you don't need to write this attribute specifically. You can understand the difference between 1 and 2.

3.CALLABLE: Execute the callable statement of the stored procedure.

Among them, if the values in the file are different, the way to obtain parameters is also different.

I haven't met this yet.

The difference between # and $ is passed.

Pay attention to using $ instead of # when using order by dynamic parameters in MyBatis sorting.