一、多个参数
public int selectUser1(String name,int age);
<!--
多个参数会封装成map
key:param1 ....,paramn或者参数的索引也可以
value:传入的参数值
#{}就是从map中获取指定的key值
-->
<select id="selectUser1" resultType="int">
select id from `tb_Student` where name= #{param1} and age=#{param2}
</select>
二、见明知意的多个参数
public int selectUser2(@Param("id")String name,@Param("age")int age);
<!--
用param1..n不能做到见名知意, 可以在接口中指定@param("")
key:使用@Param注释指定的值
value:参数值
#{指定的key}取出对应的参数值
public int selectUser2(@Param("id")String name,@Param("age")int age);
-->
<select id="selectUser2" resultType="int">
select id from `tb_Student` where name= #{n