1. Mybatis的@param注解
自定义对象也用@param注解
注:使用@param注解,mapper.xml 不加parameterType。
2. Mybatis 传入多个参数,解决方案
(1) 顺序传参法
public User selectUser(String name, int deptId);
<select id="selectUser" resultMap="UserResultMap">
select * from user
where user_name = #{0} a