mybatis传多个参数时需要注意的事项
2018-06-22 本文已影响0人
Symbian米汤
在使用mybatis时,传递多个值的时候,需要使用@parm("参数昵称")注解。
01使用场景,用户登陆:
UserMapper.java:
User selectLogin(@Parm("username")String username,@Parm("password")String password);
UserMapper.xml:
<select id="selectLogin" resultMap="BaseResultMap" parameterType="map">
select
<include refid="Base_Column_List"/>
from users
where username = #{username}
and
password = #{password}
</select>