|
@@ -0,0 +1,48 @@
|
|
|
+<?xml version="1.0" encoding="UTF-8"?>
|
|
|
+<beans xmlns="http://www.springframework.org/schema/beans"
|
|
|
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
|
+ xmlns:context="http://www.springframework.org/schema/context"
|
|
|
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
|
|
|
+ http://www.springframework.org/schema/beans/spring-beans-4.3.xsd
|
|
|
+ http://www.springframework.org/schema/context
|
|
|
+ http://www.springframework.org/schema/context/spring-context.xsd">
|
|
|
+
|
|
|
+ <context:component-scan base-package="service"/><!-- 扫描service包 -->
|
|
|
+ <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
|
|
|
+ <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
|
|
|
+ <property name="url" value="jdbc:mysql://localhost/employee?useUnicode=true&characterEncoding=UTF-8"/>
|
|
|
+ <property name="username" value="root"/>
|
|
|
+ <property name="password" value="1388023"/>
|
|
|
+ </bean>
|
|
|
+
|
|
|
+ <!--
|
|
|
+ <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
|
|
|
+ <property name="dataSource" ref="dataSource"></property>
|
|
|
+ <property name="configLocation" value="classpath:mybatis-config.xml"></property>
|
|
|
+ </bean>
|
|
|
+ -->
|
|
|
+
|
|
|
+ <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
|
|
|
+ <property name="basePackage" value="dao"/>
|
|
|
+ </bean>
|
|
|
+
|
|
|
+
|
|
|
+ <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
|
|
|
+ <property name="dataSource" ref="dataSource"/>
|
|
|
+ <property name="mapperLocations" value="classpath*:dao/*Mapper.xml"></property>
|
|
|
+ <property name="plugins">
|
|
|
+ <array>
|
|
|
+ <bean class="com.github.pagehelper.PageInterceptor">
|
|
|
+ <property name="properties">
|
|
|
+ <value>
|
|
|
+ pageSizeZero=ture
|
|
|
+ reasonable=true
|
|
|
+ </value>
|
|
|
+ </property>
|
|
|
+ </bean>
|
|
|
+ </array>
|
|
|
+ </property>
|
|
|
+ </bean>
|
|
|
+
|
|
|
+
|
|
|
+ </beans>
|