获取集合
List
list();
<mapper namespace="com.hd.dao.DeviceMapper">
<!--id: 对应java方法名-->
<!--resultType: 对应java方法返回类型-->
<select id="list" resultType="Device">
select * from tb_device
</select>
</mapper>
获取对象
User findUserByName(String name);
<mapper namespace="com.hd.dao.UserMapper">
<!--parameterType: 参数类型-->
<select id="findUserByName" parameterType="String" resultType="User">
select * from tb_user where name = #{name}
</select>
</mapper>