Spring配置扫描mybatis的mapper文件注意:

一般会将不业务的mapper文件放到不同的包中:

spring配置扫描就需要配置下面的方式(两个*):

    <!-- mybatis文件配置,扫描所有mapper文件 -->
    <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"
        p:dataSource-ref="dataSource" p:configLocation="classpath:conf/mybatis-config.xml"
        p:mapperLocations="classpath:mapper/**/*.xml" />
原文地址:https://www.cnblogs.com/firebata/p/4484416.html