MyBatis映射文件配置总结

一,参数与返回结果类型
<!--
   id:作为查询的唯一标识名
   resultMap:返回结果类型{resultMap:返回的是对象}{resultType:返回的是java基本数据类型}
   parameterType:sql语句需要的参数类型{参数为多个时,需要用map集合框架来进行封装参数处理}or{声明每个参数的的索引作为参数标识 parameter=#{0}...}
-->
<!-- login -->
  <select id="userLogin" resultMap="BaseResultMap" parameterType="java.util.Map">
  select
<include refid="Base_Column_List"/>
from tuanshang_users
  where (username=#{username} or email=#{username})and password=#{userpass}
  </select>

猜你喜欢

转载自xp-p.iteye.com/blog/2222794