The registration in namespace is consistent with the Dao/mapper interface
id: corresponds to the method name in the namespace
resultType: return value of sql statement execution
parameterType: parameter type
You only need to change the interface, the interface implementation class, the test class, and nothing else.
Example: Get user by id
interface
Interface implementation class:
Test class:
Example: Insert a user:
interface
interface implementation class
Test class:
Note: The transaction must be submitted for additions, deletions, modifications and inquiries, sqlSession.commit();
Example: modify user
Example: delete a user