<!--Configure database connection-->
<property name="dataSource" ref="dataSource"/>
<!--Configure mapping file -->
<property name="mapperLocations" value="classpath:com/awcloud/core/dao/*.xml"/>
<!--Alias -->
<property name="typeAliasesPackage" value="com.awcloud .core.bean,com.awcloud.core.query"/>
</bean>
<!-- The DAO layer is handed over to mybatis, and the spring scan and package scan provided by mybatis -->
<bean class="org.mybatis. spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="com.awcloud.core.dao"/>
</bean>
Mapping file.xml configuration <!-- <!-- where namespace must be the path of the UserMapper interface" -->--> <mapper namespace="com.awcloud.core.dao.usermng.UserDao" ><bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"> <property name="dataSource" ref="dataSource"/> <property name="mapperLocations" value="classpath:com/awcloud/core/dao/*.xml"/> <!--Alias--> <property name="typeAliasesPackage" value="com.awcloud.core.bean,com.awcloud.core.query"/> </bean>