<?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"
       xmlns:flex="http://www.springframework.org/schema/flex"
       xmlns:jee="http://www.springframework.org/schema/jee"
       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
	http://www.springframework.org/schema/flex	http://www.springframework.org/schema/flex/spring-flex-1.0.xsd
   http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd">
    <!--  CLOB 处理-->
    <bean id="lobHandler" lazy-init="true" class="org.springframework.jdbc.support.lob.OracleLobHandler">
        <property name="nativeJdbcExtractor">
            <ref bean="nativeJdbcExtractor"/>
        </property>
    </bean>

    <bean id="nativeJdbcExtractor" lazy-init="true" class="org.springframework.jdbc.support.nativejdbc.SimpleNativeJdbcExtractor"/>
    <!-- 因为Oracle9i处理Clob的方式和别的数据库很不一样,甚至与Oracle10g都不兼容,所以这里要用spring提供的SimpleNativeJdbcExtractor.如果使用Oracle10g的话,可以直接使用:
        <bean id="lobHandler" lazy-init="true"  class="org.springframework.jdbc.support.lob.DefaultLobHandler"/>-->

    <context:annotation-config/>

    <!-- service dao auto scan injection -->
    <context:component-scan base-package="com.hst"/>


    <!-- database -->
    <context:property-placeholder location="classpath:database.properties"/>

    <!-- tomcat5: <bean id="wlfpDs" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">-->
    <bean id="taxDs" class="org.apache.tomcat.dbcp.dbcp.BasicDataSource" destroy-method="close">
        <property name="driverClassName" value="${driver}"/>
        <property name="url" value="${url}"/>
        <property name="username" value="${username}"/>
        <property name="password" value="${password}"/>
        <property name="maxActive" value="200"/>
        <property name="maxIdle" value="200"/>
        <property name="minIdle" value="50"/>
         <property name="maxWait" value="60000" />
        <property name="validationQuery" value="select 1 from dual"/>
    </bean>

    <bean id="xshsDs" class="org.apache.tomcat.dbcp.dbcp.BasicDataSource" destroy-method="close">
        <property name="driverClassName" value="${xshs_driver}"/>
        <property name="url" value="${xshs_url}"/>
        <property name="username" value="${xshs_username}"/>
        <property name="password" value="${xshs_password}"/>
        <property name="maxActive" value="200"/>
        <property name="maxIdle" value="200"/>
        <property name="minIdle" value="50"/>
          <property name="maxWait" value="60000" />
        <property name="validationQuery" value="select 1 from dual"/>
    </bean>


    <bean id="ssglDs" class="org.apache.tomcat.dbcp.dbcp.BasicDataSource" destroy-method="close">
        <property name="driverClassName" value="${driver}"/>
        <property name="url" value="${ssgl_url}"/>
        <property name="username" value="${ssgl_username}"/>
        <property name="password" value="${ssgl_password}"/>
        <property name="maxActive" value="200"/>
        <property name="maxIdle" value="200"/>
        <property name="minIdle" value="50"/>
         <property name="maxWait" value="60000" />
        <property name="validationQuery" value="select 1 from dual"/>
    </bean>

    <bean id="gt3Ds" class="org.apache.tomcat.dbcp.dbcp.BasicDataSource" destroy-method="close">
        <property name="driverClassName" value="${gt3_driver}"/>
        <property name="url" value="${gt3_url}"/>
        <property name="username" value="${gt3_username}"/>
        <property name="password" value="${gt3_password}"/>
        <property name="maxActive" value="200"/>
        <property name="maxIdle" value="200"/>
        <property name="minIdle" value="50"/>
     <property name="maxWait" value="60000" />
        <property name="validationQuery" value="select 1 from dual"/>
    </bean>

    <bean id="zhdjDs" class="org.apache.tomcat.dbcp.dbcp.BasicDataSource" destroy-method="close">
        <property name="driverClassName" value="${zhdj_driver}"/>
        <property name="url" value="${zhdj_url}"/>
        <property name="username" value="${zhdj_username}"/>
        <property name="password" value="${zhdj_password}"/>
        <property name="maxActive" value="200"/>
        <property name="maxIdle" value="200"/>
        <property name="minIdle" value="50"/>
        <!--
        <property name="maxWait" value="6000000" />
        -->
        <property name="validationQuery" value="select 1 from dual"/>
    </bean>

    <bean id="smzbsDs" class="org.apache.tomcat.dbcp.dbcp.BasicDataSource" destroy-method="close">
        <property name="driverClassName" value="${sql_server_driver}"/>
        <property name="url" value="${smzbs_sqlserver_url}"/>
        <property name="username" value="${smzbs_sqlserver_username}"/>
        <property name="password" value="${smzbs_sqlserver_pwd}"/>
        <property name="maxActive" value="200"/>
        <property name="maxIdle" value="200"/>
        <property name="minIdle" value="50"/>
        <!--
        <property name="maxWait" value="6000000" />
        -->
        <property name="validationQuery" value="select 1 "/>
    </bean>
    
    <bean id="zjzkWlfpDs" class="org.apache.tomcat.dbcp.dbcp.BasicDataSource" destroy-method="close">
        <property name="driverClassName" value="${zjzkWlfp_driver}"/>
        <property name="url" value="${zjzkWlfp_url}"/>
        <property name="username" value="${zjzkWlfp_username}"/>
        <property name="password" value="${zjzkWlfp_password}"/>
        <property name="maxActive" value="200"/>
        <property name="maxIdle" value="200"/>
        <property name="minIdle" value="50"/>
        <!--
        <property name="maxWait" value="6000000" />
        -->
        <property name="validationQuery" value="select 1 from dual"/>
    </bean>

    <bean id="dzswjDs" class="org.apache.tomcat.dbcp.dbcp.BasicDataSource" destroy-method="close">
        <property name="driverClassName" value="${zjzkWlfp_driver}"/>
        <property name="url" value="${dzswj_url}"/>
        <property name="username" value="${dzswj_username}"/>
        <property name="password" value="${dzswj_password}"/>
        <property name="maxActive" value="200"/>
        <property name="maxIdle" value="200"/>
        <property name="minIdle" value="50"/>
        <!--
        <property name="maxWait" value="6000000" />
        -->
        <property name="validationQuery" value="select 1 from dual"/>
    </bean>



    <!-- ibatis -->
    <bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
        <property name="dataSource" ref="taxDs"/>
        <property name="lobHandler" ref="lobHandler"/>
        <property name="configLocations" value="classpath:/config/sqlmap/**/tax-*.xml"/>
    </bean>

    <bean id="sqlMapClientTemplate" class="com.hst.framework.common.HstSqlMapClientTemplate">
        <property name="sqlMapClient" ref="sqlMapClient"/>
    </bean>

    <bean id="taxSqlMapClientDaoSupport" class="org.springframework.orm.ibatis.support.SqlMapClientDaoSupport"
          abstract="true">
        <property name="sqlMapClientTemplate" ref="sqlMapClientTemplate"/>
    </bean>

    <!-- 协税护税 -->
    <bean id="xshsSqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
        <property name="dataSource" ref="xshsDs"/>
        <property name="lobHandler" ref="lobHandler"/>
        <property name="configLocations" value="classpath:/config/sqlmap/**/xshs-*.xml"/>
    </bean>

    <bean id="xshsSqlMapClientTemplate" class="com.hst.framework.common.HstSqlMapClientTemplate">
        <property name="sqlMapClient" ref="xshsSqlMapClient"/>
    </bean>

    <bean id="xshsSqlMapClientDaoSupport" class="org.springframework.orm.ibatis.support.SqlMapClientDaoSupport"
          abstract="true">
        <property name="sqlMapClientTemplate" ref="xshsSqlMapClientTemplate"/>
    </bean>

    <!--ssgl -->
    <bean id="ssglSqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
        <property name="dataSource" ref="ssglDs"/>
        <property name="lobHandler" ref="lobHandler"/>
        <property name="configLocations" value="classpath:/config/sqlmap/**/ssgl-*.xml"/>
    </bean>

    <bean id="ssglSqlMapClientTemplate" class="com.hst.framework.common.HstSqlMapClientTemplate">
        <property name="sqlMapClient" ref="ssglSqlMapClient"/>
    </bean>

    <bean id="ssglSqlMapClientDaoSupport" class="org.springframework.orm.ibatis.support.SqlMapClientDaoSupport"
          abstract="true">
        <property name="sqlMapClientTemplate" ref="ssglSqlMapClientTemplate"/>
    </bean>

    <!--gt3 -->
    <bean id="gt3SqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
        <property name="dataSource" ref="gt3Ds"/>
        <property name="lobHandler" ref="lobHandler"/>
        <property name="configLocations" value="classpath:/config/sqlmap/**/gt3-*.xml"/>
    </bean>

    <bean id="gt3SqlMapClientTemplate" class="com.hst.framework.common.HstGt3SqlMapClientTemplate">
        <property name="sqlMapClient" ref="gt3SqlMapClient"/>
    </bean>

    <bean id="gt3SqlMapClientDaoSupport" class="org.springframework.orm.ibatis.support.SqlMapClientDaoSupport"
          abstract="true">
        <property name="sqlMapClientTemplate" ref="gt3SqlMapClientTemplate"/>
    </bean>

    <!--zhdj-->
    <bean id="zhdjSqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
        <property name="dataSource" ref="zhdjDs"/>
        <property name="lobHandler" ref="lobHandler"/>
        <property name="configLocations" value="classpath:/config/sqlmap/**/zhdj-*.xml"/>
    </bean>

    <bean id="zhdjSqlMapClientTemplate" class="com.hst.framework.common.HstZhdjSqlMapClientTemplate">
        <property name="sqlMapClient" ref="zhdjSqlMapClient"/>
    </bean>

    <bean id="zhdjSqlMapClientDaoSupport" class="org.springframework.orm.ibatis.support.SqlMapClientDaoSupport"
          abstract="true">
        <property name="sqlMapClientTemplate" ref="zhdjSqlMapClientTemplate"/>
    </bean>

    <!--smzbs-->
    <bean id="smzbsSqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
        <property name="dataSource" ref="smzbsDs"/>
        <property name="lobHandler" ref="lobHandler"/>
        <property name="configLocations" value="classpath:/config/sqlmap/**/smzbs-*.xml"/>
    </bean>

    <bean id="smzbsSqlMapClientTemplate" class="org.springframework.orm.ibatis.SqlMapClientTemplate">
        <property name="sqlMapClient" ref="smzbsSqlMapClient"/>
    </bean>

    <bean id="smzbsSqlMapClientDaoSupport" class="org.springframework.orm.ibatis.support.SqlMapClientDaoSupport"
          abstract="true">
        <property name="sqlMapClientTemplate" ref="smzbsSqlMapClientTemplate"/>
    </bean>
    <!--zjzk wlfp-->
    <bean id="zjzkWlfpSqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
        <property name="dataSource" ref="zjzkWlfpDs"/>
        <property name="lobHandler" ref="lobHandler"/>
        <property name="configLocations" value="classpath:/config/sqlmap/**/zjzkwlfp-*.xml"/>
    </bean>

    <bean id="zjzkWlfpSqlMapClientTemplate" class="org.springframework.orm.ibatis.SqlMapClientTemplate">
        <property name="sqlMapClient" ref="zjzkWlfpSqlMapClient"/>
    </bean>

    <bean id="zjzkWlfpSqlMapClientDaoSupport" class="org.springframework.orm.ibatis.support.SqlMapClientDaoSupport"
          abstract="true">
        <property name="sqlMapClientTemplate" ref="zjzkWlfpSqlMapClientTemplate"/>
    </bean>
    <!--dzswj wlfp-->
    <bean id="dzswjSqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
        <property name="dataSource" ref="dzswjDs"/>
        <property name="lobHandler" ref="lobHandler"/>
        <property name="configLocations" value="classpath:/config/sqlmap/**/dzswj-*.xml"/>
    </bean>

    <bean id="dzswjSqlMapClientTemplate" class="org.springframework.orm.ibatis.SqlMapClientTemplate">
        <property name="sqlMapClient" ref="dzswjSqlMapClient"/>
    </bean>

    <bean id="dzswjWlfpSqlMapClientDaoSupport" class="org.springframework.orm.ibatis.support.SqlMapClientDaoSupport"
          abstract="true">
        <property name="sqlMapClientTemplate" ref="dzswjSqlMapClientTemplate"/>
    </bean>

    <!-- annotation transactionManager 默认-->
    <tx:annotation-driven transaction-manager="myTransactionManager" proxy-target-class="true"/>

    <bean id="myTransactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
        <property name="dataSource">
            <ref local="taxDs"/>
        </property>
    </bean>

    <!-- 协税护税事务 -->
    <tx:annotation-driven transaction-manager="myTransactionManager_Xshs" proxy-target-class="true"/>

    <bean id="myTransactionManager_Xshs" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
        <property name="dataSource">
            <ref local="xshsDs"/>
        </property>
    </bean>

    <!-- ssgl事务 -->
    <tx:annotation-driven transaction-manager="myTransactionManager_Ssgl" proxy-target-class="true"/>

    <bean id="myTransactionManager_Ssgl" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
        <property name="dataSource">
            <ref local="ssglDs"/>
        </property>
    </bean>

    <!-- zgdj事务 -->
    <tx:annotation-driven transaction-manager="myTransactionManager_Zhdj" proxy-target-class="true"/>

    <bean id="myTransactionManager_Zhdj" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
        <property name="dataSource">
            <ref local="zhdjDs"/>
        </property>
    </bean>


    <!-- smzbs事务 -->
    <tx:annotation-driven transaction-manager="myTransactionManager_Zhdj" proxy-target-class="true"/>

    <bean id="myTransactionManager_smzbs" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
        <property name="dataSource">
            <ref local="smzbsDs"/>
        </property>
    </bean>

    <bean id="nsfwSjscDs" class="org.apache.tomcat.dbcp.dbcp.BasicDataSource" destroy-method="close">
        <property name="driverClassName" value="${driver}"/>
        <property name="url" value="${nsfwsjsc_url}"/>
        <property name="username" value="${nsfwsjsc_username}"/>
        <property name="password" value="${nsfwsjsc_password}"/>
        <property name="maxActive" value="200"/>
        <property name="maxIdle" value="200"/>
        <property name="minIdle" value="50"/>
        
        <property name="maxWait" value="60000" />
         
        <property name="validationQuery" value="select 1 from dual"/>
    </bean>
    <bean id="nsfwSjscSqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
        <property name="dataSource" ref="nsfwSjscDs"/>
        <property name="lobHandler" ref="lobHandler"/>
        <property name="configLocations" value="classpath:/config/sqlmap/**/nsfwsjsc-*.xml"/>
    </bean>

    <bean id="nsfwSjscSqlMapClientTemplate" class="com.hst.framework.common.HstSqlMapClientTemplate">
        <property name="sqlMapClient" ref="nsfwSjscSqlMapClient"/>
    </bean>

    <bean id="nsfwSjscSqlMapClientDaoSupport" class="org.springframework.orm.ibatis.support.SqlMapClientDaoSupport"
          abstract="true">
        <property name="sqlMapClientTemplate" ref="nsfwSjscSqlMapClientTemplate"/>
    </bean>


    <tx:annotation-driven transaction-manager="myTransactionManager" proxy-target-class="true"/>

    <bean id="myTransactionManager_nsfwSjsc" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
        <property name="dataSource">
            <ref local="nsfwSjscDs"/>
        </property>
    </bean>
	  <!--防伪税控-->

    <bean id="fwskDs" class="org.apache.tomcat.dbcp.dbcp.BasicDataSource" destroy-method="close">
        <property name="driverClassName" value="${driver}"/>
        <property name="url" value="${fwsk_url}"/>
        <property name="username" value="${fwsk_user}"/>
        <property name="password" value="${fwsk_pwd}"/>
        <property name="maxActive" value="200"/>
        <property name="maxIdle" value="200"/>
        <property name="minIdle" value="50"/>
        <!--
        <property name="maxWait" value="6000000" />
        -->
        <property name="validationQuery" value="select 1 from dual"/>
    </bean>
  <!--决策二包-->
    <bean id="jcebDs" class="org.apache.tomcat.dbcp.dbcp.BasicDataSource" destroy-method="close">
        <property name="driverClassName" value="${driver}"/>
        <property name="url" value="${jceb_url}"/>
        <property name="username" value="${jceb_user}"/>
        <property name="password" value="${jceb_pwd}"/>
        <property name="maxActive" value="200"/>
        <property name="maxIdle" value="200"/>
        <property name="minIdle" value="50"/>
        <!--
        <property name="maxWait" value="6000000" />
        -->
        <property name="validationQuery" value="select 1 from dual"/>
    </bean>

    <!--决策二包-->
    <bean id="jdptDs" class="org.apache.tomcat.dbcp.dbcp.BasicDataSource" destroy-method="close">
        <property name="driverClassName" value="${driver}"/>
        <property name="url" value="${jdpt_url}"/>
        <property name="username" value="${jdpt_user}"/>
        <property name="password" value="${jdpt_pwd}"/>
        <property name="maxActive" value="200"/>
        <property name="maxIdle" value="200"/>
        <property name="minIdle" value="50"/>
        <!--
        <property name="maxWait" value="6000000" />
        -->
        <property name="validationQuery" value="select 1 from dual"/>
    </bean>
</beans>