mybatis自学历程(二)
传递多个参数 1.在mybatis.xml下<mappers>下使用<package> <mappers> <package name="com.mybatis.mapper"/> </mappers> 2.在com.mybatis.mapper下新建接口 public interface LogMapper { List<Log> sellAll(); List<Log> selByAccInAccOut(Integer accin,Integer accout); } 3.在com.mybatis.mapper新建一个LogMapper.xml 3.1 namespace 必须和接口全路径(包名+类名)一致 3.2 id值必须和接口中的方法相同 3.3 如果接口中方法为多个参数,可以省略parameterType 3.4.1 #{ } 中使用param+数字,表示第几个参数 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.mybatis.mapper.LogMapper"> <select