<?xml version="1.0" encoding="UTF8" ?>
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
    <!--数据源的配置信息会单独放在jdbc.properties文件中，这里加载到mybatis配置文件来，使用的时候用EL表达式${}-->
    <properties resource="jdbc.properties"></properties>
    <settings>
        <setting name="logImpl" value="LOG4J2"/>
        <setting name="mapUnderscoreToCamelCase" value="true"/>
        <setting name="lazyLoadingEnabled" value="true"/>
    </settings>
    <!--    Mapper文件注册-->
    <typeAliases>
        <typeAlias type="com.pojo.entity.AccountEntity" alias="account"></typeAlias>
        <typeAlias type="com.pojo.entity.UserEntity" alias="user"></typeAlias>
    </typeAliases>
    <!--    核心配置信息-->
    <environments default="xmq_config">
        <!--        数据库相关配置-->
        <environment id="xmq_config">
            <!--            事务控制类型 connection对象-->
            <transactionManager type="JDBC"></transactionManager>
            <!--            数据库连接参数 连接池-->
            <dataSource type="org.apache.ibatis.datasource.pooled.PooledDataSourceFactory">
                <property name="driver" value="${jdbc.driver}"/>
                <property name="url" value="${jdbc.url}"/>
                <property name="username" value="${jdbc.username}"/>
                <property name="password" value="${jdbc.password}"/>
            </dataSource>
        </environment>
    </environments>

    <mappers>
<!--        <mapper resource="mapper/UserMapper.xml"/>-->
<!--        使用class方式引入-->
        <mapper class="com.mapper.AccountMapper"></mapper>
        <mapper class="com.mapper.UserMapper"></mapper>
        <mapper class="com.mapper.DepartmentMapper"></mapper>
        <mapper class="com.mapper.SqlMapper"></mapper>
<!--        <package name="com.mapper"/>-->
    </mappers>

</configuration>
