mybatis中paramtype的map方式怎么写

如题所述

该方法采用Map传多参数
Dao层的方法

<span style="font-size:12px;">Public User selectUser(Map paramMap);</span>

对应的Mapper.xml
<select id=" selectUser" resultMap="BaseResultMap">
select * from user_user_t where user_name = #{userName,jdbcType=VARCHAR} and user_password=#{userPassword,jdbcType=VARCHAR}
</select>

Service层调用

public User xxxSelectUser(){

Map paramMap=new hashMap();

paramMap.put(“userName”,”对应具体的参数值”);
paramMap.put(“userPassword”,”对应具体的参数值”);
User user=xxx. selectUser(paramMap);}
温馨提示:答案为网友推荐,仅供参考

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网