myBatis应用

1.参数对象只能配置在mybatis-config.xml中
<typeAliases>
  <typeAliases alias="别名" type="类路径"/>
</typeAliases>
包括dto的配置
2.mapping映射的xml中写返回值
在写sql的过程中id名字自动对应到dao层方法

<select id="getTotalEncode"  parameterType="encode" resultType="int">

parameterType只能有一个参数,如果多参数只能以DTO形式传递,分页参数用ibatis的RowBounds类自动匹配 
如果返回的是自定义的结果集则用resultMap=""

你可能感兴趣的:(mybatis)