@MapKey("id")
public Map<String,User> getUserByName(String name);
xml中
<select id="getUserByName" resultType = "User">
select * from user where name=#{param1}
</select>
本文介绍了一个使用MyBatis框架进行参数映射的示例,展示了如何通过注解和XML配置实现数据库查询。具体包括@MapKey注解的使用方法,以及在XML中定义SQL查询语句。
@MapKey("id")
public Map<String,User> getUserByName(String name);
xml中
<select id="getUserByName" resultType = "User">
select * from user where name=#{param1}
</select>

被折叠的 条评论
为什么被折叠?