把IUserDao.xml移除,在dao接口的方法上使用@Select注解,并指定SQL语句,同时需要在mybatis-config.xml中的mapper配置时,使用class属性指定dao接口的全限定类名。
IUserDao.java:
@Select("select * from user")
List<User> findAll();
mybatis-config.xml:
<mappers>
<mapper class="net.togogo.dao.IUserDao"></mapper>
</mappers>