Commit a038b5cc authored by liling's avatar liling

add code

parent 8be29ec9
...@@ -32,28 +32,123 @@ ...@@ -32,28 +32,123 @@
<ProjectState /> <ProjectState />
</projectState> </projectState>
</component> </component>
<component name="ExternalProjectsManager">
<system id="GRADLE">
<state>
<projects_view>
<tree_state>
<expand>
<path>
<item name="" type="6a2764b6:ExternalProjectsStructure$RootNode" />
<item name="dmp" type="f1a62948:ProjectNode" />
</path>
</expand>
<select />
</tree_state>
</projects_view>
</state>
</system>
</component>
<component name="FileEditorManager"> <component name="FileEditorManager">
<leaf> <leaf>
<file leaf-file-name="build.gradle" pinned="false" current-in-tab="false"> <file leaf-file-name="build.gradle" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/dmp-web/build.gradle"> <entry file="file://$PROJECT_DIR$/dmp-web/build.gradle">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-57"> <state relative-caret-position="228">
<caret line="15" column="14" selection-start-line="15" selection-start-column="14" selection-end-line="15" selection-end-column="14" /> <caret line="30" column="29" selection-start-line="30" selection-start-column="29" selection-end-line="30" selection-end-column="29" />
</state> </state>
</provider> </provider>
</entry> </entry>
</file> </file>
<file leaf-file-name="TestController.java" pinned="false" current-in-tab="true"> <file leaf-file-name="TestController.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/dmp-web/src/main/java/cn/com/duia/dmp/controller/TestController.java"> <entry file="file://$PROJECT_DIR$/dmp-web/src/main/java/cn/com/duia/dmp/controller/TestController.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="225"> <state relative-caret-position="133">
<caret line="33" column="65" selection-start-line="33" selection-start-column="65" selection-end-line="33" selection-end-column="65" /> <caret line="17" column="18" selection-start-line="17" selection-start-column="18" selection-end-line="17" selection-end-column="18" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="Application.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/dmp-web/src/main/java/cn/com/duia/dmp/Application.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="132">
<caret line="21" column="44" lean-forward="true" selection-start-line="21" selection-start-column="44" selection-end-line="21" selection-end-column="44" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="AppService.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/dmp-core/src/main/java/cn/com/duia/dmp/core/service/AppService.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="76">
<caret line="6" column="17" selection-start-line="6" selection-start-column="17" selection-end-line="6" selection-end-column="17" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="AppServiceImpl.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/dmp-core/src/main/java/cn/com/duia/dmp/core/service/impl/AppServiceImpl.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="31">
<caret line="2" column="36" selection-start-line="2" selection-start-column="7" selection-end-line="2" selection-end-column="36" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="spring.xml" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/dmp-web/src/main/resources/spring/spring.xml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="114">
<caret line="6" column="47" lean-forward="true" selection-start-line="6" selection-start-column="47" selection-end-line="6" selection-end-column="47" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="sqlinfotable.xml" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/dmp-dal/src/main/resources/mybatis/druid/sqlinfotable.xml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="114">
<caret line="6" column="14" lean-forward="true" selection-start-line="6" selection-start-column="14" selection-end-line="6" selection-end-column="14" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="spring-datasource-druid.xml" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/dmp-web/src/main/resources/spring/spring-datasource-druid.xml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="304">
<caret line="16" selection-start-line="16" selection-end-line="16" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="spring-datasource.xml" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/dmp-web/src/main/resources/spring/spring-datasource.xml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="168">
<caret line="19" column="75" lean-forward="true" selection-start-line="19" selection-start-column="75" selection-end-line="19" selection-end-column="75" />
</state> </state>
</provider> </provider>
</entry> </entry>
</file> </file>
</leaf> </leaf>
</component> </component>
<component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES">
<list>
<option value="spring-beans.schema" />
</list>
</option>
</component>
<component name="FindInProjectRecents">
<findStrings>
<find>cn.com.duiba.dmp.dal.mapper.druid.AppDao</find>
</findStrings>
<dirStrings>
<dir>D:\2019111903gitpulldmp\dmp\dmp</dir>
</dirStrings>
</component>
<component name="GradleLocalSettings"> <component name="GradleLocalSettings">
<option name="myGradleHomes"> <option name="myGradleHomes">
<map> <map>
...@@ -1927,6 +2022,10 @@ ...@@ -1927,6 +2022,10 @@
<option name="CHANGED_PATHS"> <option name="CHANGED_PATHS">
<list> <list>
<option value="$PROJECT_DIR$/dmp-web/src/main/java/cn/com/duia/dmp/controller/TestController.java" /> <option value="$PROJECT_DIR$/dmp-web/src/main/java/cn/com/duia/dmp/controller/TestController.java" />
<option value="$PROJECT_DIR$/dmp-web/src/main/resources/spring/spring.xml" />
<option value="$PROJECT_DIR$/dmp-web/src/main/resources/spring/spring-datasource-druid.xml" />
<option value="$PROJECT_DIR$/dmp-web/src/main/resources/spring/spring-datasource.xml" />
<option value="$PROJECT_DIR$/dmp-web/src/main/java/cn/com/duia/dmp/Application.java" />
</list> </list>
</option> </option>
</component> </component>
...@@ -1937,8 +2036,8 @@ ...@@ -1937,8 +2036,8 @@
<sorting>DEFINITION_ORDER</sorting> <sorting>DEFINITION_ORDER</sorting>
</component> </component>
<component name="ProjectFrameBounds" extendedState="6"> <component name="ProjectFrameBounds" extendedState="6">
<option name="x" value="-62" /> <option name="x" value="115" />
<option name="y" value="127" /> <option name="y" value="75" />
<option name="width" value="1075" /> <option name="width" value="1075" />
<option name="height" value="756" /> <option name="height" value="756" />
</component> </component>
...@@ -1998,9 +2097,16 @@ ...@@ -1998,9 +2097,16 @@
<item name="dmp-web" type="8a07ba80:GradleTreeStructureProvider$GradleModuleDirectoryNode" /> <item name="dmp-web" type="8a07ba80:GradleTreeStructureProvider$GradleModuleDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" /> <item name="src" type="462c0819:PsiDirectoryNode" />
<item name="main" type="8a07ba80:GradleTreeStructureProvider$GradleModuleDirectoryNode" /> <item name="main" type="8a07ba80:GradleTreeStructureProvider$GradleModuleDirectoryNode" />
<item name="java" type="462c0819:PsiDirectoryNode" /> <item name="resources" type="462c0819:PsiDirectoryNode" />
<item name="dmp" type="462c0819:PsiDirectoryNode" /> </path>
<item name="controller" type="462c0819:PsiDirectoryNode" /> <path>
<item name="dmp" type="b2602c69:ProjectViewProjectNode" />
<item name="dmp" type="8a07ba80:GradleTreeStructureProvider$GradleModuleDirectoryNode" />
<item name="dmp-web" type="8a07ba80:GradleTreeStructureProvider$GradleModuleDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="main" type="8a07ba80:GradleTreeStructureProvider$GradleModuleDirectoryNode" />
<item name="resources" type="462c0819:PsiDirectoryNode" />
<item name="spring" type="462c0819:PsiDirectoryNode" />
</path> </path>
</expand> </expand>
<select /> <select />
...@@ -2021,7 +2127,7 @@ ...@@ -2021,7 +2127,7 @@
<property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" /> <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
<property name="nodejs_npm_path_reset_for_default_project" value="true" /> <property name="nodejs_npm_path_reset_for_default_project" value="true" />
<property name="project.structure.last.edited" value="Modules" /> <property name="project.structure.last.edited" value="Modules" />
<property name="project.structure.proportion" value="0.0" /> <property name="project.structure.proportion" value="0.15" />
<property name="project.structure.side.proportion" value="0.2" /> <property name="project.structure.side.proportion" value="0.2" />
<property name="settings.editor.selected.configurable" value="configurable.group.appearance" /> <property name="settings.editor.selected.configurable" value="configurable.group.appearance" />
</component> </component>
...@@ -2094,16 +2200,15 @@ ...@@ -2094,16 +2200,15 @@
<option name="number" value="Default" /> <option name="number" value="Default" />
<option name="presentableId" value="Default" /> <option name="presentableId" value="Default" />
<updated>1574103294649</updated> <updated>1574103294649</updated>
<workItem from="1574103296241" duration="95000" /> <workItem from="1574103296241" duration="4127000" />
</task> </task>
<servers /> <servers />
</component> </component>
<component name="TimeTrackingManager"> <component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="95000" /> <option name="totallyTimeSpent" value="4127000" />
</component> </component>
<component name="ToolWindowManager"> <component name="ToolWindowManager">
<frame x="-8" y="-8" width="1382" height="744" extended-state="6" /> <frame x="-8" y="-8" width="1382" height="744" extended-state="6" />
<editor active="true" />
<layout> <layout>
<window_info anchor="right" id="Palette" /> <window_info anchor="right" id="Palette" />
<window_info anchor="right" id="sbt" /> <window_info anchor="right" id="sbt" />
...@@ -2124,19 +2229,19 @@ ...@@ -2124,19 +2229,19 @@
<window_info id="Image Layers" /> <window_info id="Image Layers" />
<window_info anchor="bottom" id="Java Enterprise" /> <window_info anchor="bottom" id="Java Enterprise" />
<window_info anchor="right" id="Capture Analysis" /> <window_info anchor="right" id="Capture Analysis" />
<window_info active="true" anchor="bottom" id="Run" order="2" visible="true" weight="0.23499142" /> <window_info active="true" anchor="bottom" id="Run" order="2" visible="true" weight="0.5368782" />
<window_info anchor="bottom" id="Version Control" show_stripe_button="false" /> <window_info anchor="bottom" id="Version Control" show_stripe_button="false" />
<window_info anchor="bottom" id="Spring" /> <window_info anchor="bottom" id="Spring" />
<window_info anchor="bottom" id="Terminal" /> <window_info anchor="bottom" id="Terminal" />
<window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.13842663" /> <window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.16263238" />
<window_info anchor="bottom" id="sbt-shell-toolwindow" /> <window_info anchor="bottom" id="sbt-shell-toolwindow" />
<window_info anchor="right" id="Bean Validation" /> <window_info anchor="right" id="Bean Validation" />
<window_info id="Web" side_tool="true" /> <window_info id="Web" side_tool="true" />
<window_info anchor="bottom" id="SonarLint" /> <window_info anchor="bottom" id="SonarLint" />
<window_info anchor="right" id="Gradle" /> <window_info anchor="bottom" id="Find" order="1" />
<window_info anchor="right" id="Gradle" visible="true" weight="0.10892587" />
<window_info anchor="right" id="Theme Preview" /> <window_info anchor="right" id="Theme Preview" />
<window_info id="Favorites" side_tool="true" /> <window_info id="Favorites" side_tool="true" />
<window_info anchor="bottom" id="Find" order="1" />
<window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" /> <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" /> <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" /> <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
...@@ -2153,15 +2258,71 @@ ...@@ -2153,15 +2258,71 @@
<component name="editorHistoryManager"> <component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/dmp-web/build.gradle"> <entry file="file://$PROJECT_DIR$/dmp-web/build.gradle">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-57"> <state relative-caret-position="228">
<caret line="15" column="14" selection-start-line="15" selection-start-column="14" selection-end-line="15" selection-end-column="14" /> <caret line="30" column="29" selection-start-line="30" selection-start-column="29" selection-end-line="30" selection-end-column="29" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/dmp-web/src/main/resources/spring/spring-druid.xml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="57">
<caret line="3" column="66" selection-start-line="3" selection-start-column="66" selection-end-line="3" selection-end-column="66" />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/dmp-web/src/main/java/cn/com/duia/dmp/controller/TestController.java"> <entry file="file://$PROJECT_DIR$/dmp-web/src/main/java/cn/com/duia/dmp/controller/TestController.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="225"> <state relative-caret-position="133">
<caret line="33" column="65" selection-start-line="33" selection-start-column="65" selection-end-line="33" selection-end-column="65" /> <caret line="17" column="18" selection-start-line="17" selection-start-column="18" selection-end-line="17" selection-end-column="18" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/dmp-core/src/main/java/cn/com/duia/dmp/core/service/AppService.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="76">
<caret line="6" column="17" selection-start-line="6" selection-start-column="17" selection-end-line="6" selection-end-column="17" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/dmp-web/src/main/java/cn/com/duia/dmp/Application.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="132">
<caret line="21" column="44" lean-forward="true" selection-start-line="21" selection-start-column="44" selection-end-line="21" selection-end-column="44" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/dmp-core/src/main/java/cn/com/duia/dmp/core/service/impl/AppServiceImpl.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="31">
<caret line="2" column="36" selection-start-line="2" selection-start-column="7" selection-end-line="2" selection-end-column="36" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/dmp-web/src/main/resources/spring/spring.xml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="114">
<caret line="6" column="47" lean-forward="true" selection-start-line="6" selection-start-column="47" selection-end-line="6" selection-end-column="47" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/dmp-dal/src/main/resources/mybatis/druid/sqlinfotable.xml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="114">
<caret line="6" column="14" lean-forward="true" selection-start-line="6" selection-start-column="14" selection-end-line="6" selection-end-column="14" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/dmp-web/src/main/resources/spring/spring-datasource-druid.xml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="304">
<caret line="16" selection-start-line="16" selection-end-line="16" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/dmp-web/src/main/resources/spring/spring-datasource.xml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="168">
<caret line="19" column="75" lean-forward="true" selection-start-line="19" selection-start-column="75" selection-end-line="19" selection-end-column="75" />
</state> </state>
</provider> </provider>
</entry> </entry>
...@@ -2242,7 +2403,7 @@ ...@@ -2242,7 +2403,7 @@
</state> </state>
<state key="ProjectLibrariesConfigurable.UI"> <state key="ProjectLibrariesConfigurable.UI">
<settings> <settings>
<last-edited /> <last-edited>Gradle: antlr:antlr:2.7.7</last-edited>
<splitter-proportions> <splitter-proportions>
<option name="proportions"> <option name="proportions">
<list> <list>
......
<?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"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
<bean name="druidDataSource" parent="dataSourceParent">
<property name="url" value="jdbc:mysql://dev.config.duibar.com:3306/druid_quartz_statistics"></property>
<property name="username" value="dev"></property>
<property name="password" value="dev_fas015"></property>
</bean>
<bean id="druidSqlSessionTemplate" class="org.mybatis.spring.SqlSessionTemplate">
<constructor-arg>
<bean class="org.mybatis.spring.SqlSessionFactoryBean">
<!-- 实例化sqlSessionFactory时需要使用上述配置好的数据源以及SQL映射文件 -->
<property name="dataSource" ref="druidDataSource"/>
<property name="mapperLocations">
<array>
<value>classpath*:mybatis/druid/*.xml</value>
</array>
</property>
<property name="configLocation" value="classpath:mybatis/sqlMapConfig.xml"/>
<property name="typeAliasesPackage" value="cn.com.duiba.dmp.common.entity"/>
</bean>
</constructor-arg>
</bean>
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="sqlSessionTemplateBeanName" value="druidSqlSessionTemplate"/>
<property name="basePackage" value="cn.com.duiba.dmp.dal.mapper.druid"/>
</bean>
</beans>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"
default-autowire="byName">
<bean id="dataSourceParent" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close" abstract="true">
<property name="driverClassName" value="com.mysql.jdbc.Driver"></property>
<property name="initialSize" value="3"/>
<property name="maxTotal" value="500"/>
<property name="minIdle" value="3"/>
<property name="maxIdle" value="5"/>
<property name="maxWaitMillis" value="30000"/>
<property name="removeAbandonedOnBorrow" value="true"/>
<!-- Timeout in seconds before an abandoned connection can be removed. Defaults to 300 seconds -->
<property name="removeAbandonedTimeout" value="60"/>
<property name="logAbandoned" value="true"/>
<property name="testOnBorrow" value="true"/>
<property name="timeBetweenEvictionRunsMillis" value="90000"/><!-- 多久testWhileIdle一次 -->
<property name="minEvictableIdleTimeMillis" value="600000"/><!-- 池中的连接空闲多久后被回收,默认值就是30分钟。 -->
<property name="validationQuery" value="SELECT 1"/>
<property name="testWhileIdle" value="true"/>
</bean>
<!-- 注解方式配置事务,在service中使用@Transactional使用事务,由于事务不能跨越数据库,必须指定value,比如consumer/credits -->
<tx:annotation-driven proxy-target-class="true" />
<bean name="dataSource" parent="dataSourceParent"> <!-- com.mchange.v2.c3p0.ComboPooledDataSource -->
<property name="url" value="jdbc:mysql://dev.config.duibar.com:3306/druid_quartz_statistics"></property>
<property name="username" value="dev"></property>
<property name="password" value="dev_fas015"></property>
</bean>
<!-- ========================================针对myBatis的配置项============================== -->
<!-- 配置sqlSessionFactory -->
<bean id="sqlSessionTemplate" class="org.mybatis.spring.SqlSessionTemplate">
<constructor-arg>
<bean class="org.mybatis.spring.SqlSessionFactoryBean">
<!-- 实例化sqlSessionFactory时需要使用上述配置好的数据源以及SQL映射文件 -->
<property name="dataSource" ref="dataSource"/>
<property name="typeAliasesPackage" value="cn.com.duia.dmp.common.entity"/>
</bean>
</constructor-arg>
</bean>
<!-- 配置Spring的事务管理器 -->
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"/>
<qualifier value="dmp"/><!-- 使用@Transactional(DsConstants.DATABASE_QIHO)来指定使用该事务管理器 -->
</bean>
</beans>
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8" ?>
<beans xmlns="http://www.springframework.org/schema/beans" <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" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"
xsi:schemaLocation="http://www.springframework.org/schema/beans default-autowire="byName">
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
<bean id="dataSourceParent1" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close" abstract="true"> <import resource="spring-datasource.xml"/>
<property name="driverClassName" value="com.mysql.jdbc.Driver"></property> <import resource="spring-datasource-druid.xml"/>
<property name="initialSize" value="3"/>
<property name="maxTotal" value="500"/>
<property name="minIdle" value="3"/>
<property name="maxIdle" value="5"/>
<property name="maxWaitMillis" value="30000"/>
<property name="removeAbandonedOnBorrow" value="true"/>
<!-- Timeout in seconds before an abandoned connection can be removed. Defaults to 300 seconds -->
<property name="removeAbandonedTimeout" value="60"/>
<property name="logAbandoned" value="true"/>
<property name="testOnBorrow" value="true"/>
<property name="timeBetweenEvictionRunsMillis" value="90000"/><!-- 多久testWhileIdle一次 -->
<property name="minEvictableIdleTimeMillis" value="600000"/><!-- 池中的连接空闲多久后被回收,默认值就是30分钟。 -->
<property name="validationQuery" value="SELECT 1"/>
<property name="testWhileIdle" value="true"/>
</bean>
<bean name="druidServiceDataSource" parent="dataSourceParent1">
<property name="url" value="jdbc:mysql://dev.config.duibar.com:3306/druid_quartz_statistics"></property>
<property name="username" value="dev"></property>
<property name="password" value="dev_fas015"></property>
</bean>
<bean id="druidServiceSqlSessionTemplate" class="org.mybatis.spring.SqlSessionTemplate">
<constructor-arg>
<bean class="org.mybatis.spring.SqlSessionFactoryBean">
<!-- 实例化sqlSessionFactory时需要使用上述配置好的数据源以及SQL映射文件 -->
<property name="dataSource" ref="druidServiceDataSource"/>
<property name="mapperLocations">
<array>
<value>classpath*:mybatis/druid/*.xml</value>
</array>
</property>
<property name="configLocation" value="classpath:mybatis/sqlMapConfig.xml"/>
<property name="typeAliasesPackage" value="cn.com.duia.tuia.test.manager.common.entity"/>
</bean>
</constructor-arg>
</bean>
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="sqlSessionTemplateBeanName" value="druidServiceSqlSessionTemplate"/>
<property name="basePackage" value="cn.com.duiba.dmp.dal.mapper.druid"/>
</bean>
</beans> </beans>
\ No newline at end of file
<?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"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
<bean name="druidDataSource" parent="dataSourceParent">
<property name="url" value="jdbc:mysql://dev.config.duibar.com:3306/druid_quartz_statistics"></property>
<property name="username" value="dev"></property>
<property name="password" value="dev_fas015"></property>
</bean>
<bean id="druidSqlSessionTemplate" class="org.mybatis.spring.SqlSessionTemplate">
<constructor-arg>
<bean class="org.mybatis.spring.SqlSessionFactoryBean">
<!-- 实例化sqlSessionFactory时需要使用上述配置好的数据源以及SQL映射文件 -->
<property name="dataSource" ref="druidDataSource"/>
<property name="mapperLocations">
<array>
<value>classpath*:mybatis/druid/*.xml</value>
</array>
</property>
<property name="configLocation" value="classpath:mybatis/sqlMapConfig.xml"/>
<property name="typeAliasesPackage" value="cn.com.duiba.dmp.common.entity"/>
</bean>
</constructor-arg>
</bean>
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="sqlSessionTemplateBeanName" value="druidSqlSessionTemplate"/>
<property name="basePackage" value="cn.com.duiba.dmp.dal.mapper.druid"/>
</bean>
</beans>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"
default-autowire="byName">
<bean id="dataSourceParent" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close" abstract="true">
<property name="driverClassName" value="com.mysql.jdbc.Driver"></property>
<property name="initialSize" value="3"/>
<property name="maxTotal" value="500"/>
<property name="minIdle" value="3"/>
<property name="maxIdle" value="5"/>
<property name="maxWaitMillis" value="30000"/>
<property name="removeAbandonedOnBorrow" value="true"/>
<!-- Timeout in seconds before an abandoned connection can be removed. Defaults to 300 seconds -->
<property name="removeAbandonedTimeout" value="60"/>
<property name="logAbandoned" value="true"/>
<property name="testOnBorrow" value="true"/>
<property name="timeBetweenEvictionRunsMillis" value="90000"/><!-- 多久testWhileIdle一次 -->
<property name="minEvictableIdleTimeMillis" value="600000"/><!-- 池中的连接空闲多久后被回收,默认值就是30分钟。 -->
<property name="validationQuery" value="SELECT 1"/>
<property name="testWhileIdle" value="true"/>
</bean>
<!-- 注解方式配置事务,在service中使用@Transactional使用事务,由于事务不能跨越数据库,必须指定value,比如consumer/credits -->
<tx:annotation-driven proxy-target-class="true" />
<bean name="dataSource" parent="dataSourceParent"> <!-- com.mchange.v2.c3p0.ComboPooledDataSource -->
<property name="url" value="jdbc:mysql://dev.config.duibar.com:3306/druid_quartz_statistics"></property>
<property name="username" value="dev"></property>
<property name="password" value="dev_fas015"></property>
</bean>
<!-- ========================================针对myBatis的配置项============================== -->
<!-- 配置sqlSessionFactory -->
<bean id="sqlSessionTemplate" class="org.mybatis.spring.SqlSessionTemplate">
<constructor-arg>
<bean class="org.mybatis.spring.SqlSessionFactoryBean">
<!-- 实例化sqlSessionFactory时需要使用上述配置好的数据源以及SQL映射文件 -->
<property name="dataSource" ref="dataSource"/>
<property name="typeAliasesPackage" value="cn.com.duia.dmp.common.entity"/>
</bean>
</constructor-arg>
</bean>
<!-- 配置Spring的事务管理器 -->
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"/>
<qualifier value="dmp"/><!-- 使用@Transactional(DsConstants.DATABASE_QIHO)来指定使用该事务管理器 -->
</bean>
</beans>
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8" ?>
<beans xmlns="http://www.springframework.org/schema/beans" <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" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"
xsi:schemaLocation="http://www.springframework.org/schema/beans default-autowire="byName">
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
<bean id="dataSourceParent1" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close" abstract="true"> <import resource="spring-datasource.xml"/>
<property name="driverClassName" value="com.mysql.jdbc.Driver"></property> <import resource="spring-datasource-druid.xml"/>
<property name="initialSize" value="3"/>
<property name="maxTotal" value="500"/>
<property name="minIdle" value="3"/>
<property name="maxIdle" value="5"/>
<property name="maxWaitMillis" value="30000"/>
<property name="removeAbandonedOnBorrow" value="true"/>
<!-- Timeout in seconds before an abandoned connection can be removed. Defaults to 300 seconds -->
<property name="removeAbandonedTimeout" value="60"/>
<property name="logAbandoned" value="true"/>
<property name="testOnBorrow" value="true"/>
<property name="timeBetweenEvictionRunsMillis" value="90000"/><!-- 多久testWhileIdle一次 -->
<property name="minEvictableIdleTimeMillis" value="600000"/><!-- 池中的连接空闲多久后被回收,默认值就是30分钟。 -->
<property name="validationQuery" value="SELECT 1"/>
<property name="testWhileIdle" value="true"/>
</bean>
<bean name="druidServiceDataSource" parent="dataSourceParent1">
<property name="url" value="jdbc:mysql://dev.config.duibar.com:3306/druid_quartz_statistics"></property>
<property name="username" value="dev"></property>
<property name="password" value="dev_fas015"></property>
</bean>
<bean id="druidServiceSqlSessionTemplate" class="org.mybatis.spring.SqlSessionTemplate">
<constructor-arg>
<bean class="org.mybatis.spring.SqlSessionFactoryBean">
<!-- 实例化sqlSessionFactory时需要使用上述配置好的数据源以及SQL映射文件 -->
<property name="dataSource" ref="druidServiceDataSource"/>
<property name="mapperLocations">
<array>
<value>classpath*:mybatis/druid/*.xml</value>
</array>
</property>
<property name="configLocation" value="classpath:mybatis/sqlMapConfig.xml"/>
<property name="typeAliasesPackage" value="cn.com.duia.tuia.test.manager.common.entity"/>
</bean>
</constructor-arg>
</bean>
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="sqlSessionTemplateBeanName" value="druidServiceSqlSessionTemplate"/>
<property name="basePackage" value="cn.com.duiba.dmp.dal.mapper.druid"/>
</bean>
</beans> </beans>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment