码迷,mamicode.com
首页 > 移动开发 > 详细

Mybatis mapper.xml

时间:2020-03-28 17:59:15      阅读:82      评论:0      收藏:0      [点我收藏+]

标签:dev   HERE   mybatis   space   ice   --   方法   tis   tty   

获取集合

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>

Mybatis mapper.xml

标签:dev   HERE   mybatis   space   ice   --   方法   tis   tty   

原文地址:https://www.cnblogs.com/xiongyungang/p/12588216.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!