<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE generatorConfiguration PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"
        "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd" >

<generatorConfiguration>

    <properties resource="application.properties" />

    <context id="mysql" targetRuntime="MyBatis3Simple" defaultModelType="flat">

        <property name="javaFileEncoding" value="UTF-8" />
        <property name="beginningDelimiter" value="`" />
        <property name="endingDelimiter" value="`" />

        <!--序列化插件-->
        <plugin type="org.mybatis.generator.plugins.SerializablePlugin" />

        <!-- 增加mybatis通用mapper 插件 -->
        <plugin type="tk.mybatis.mapper.generator.MapperPlugin">
            <property name="mappers" value="tk.mybatis.mapper.common.Mapper"/>
        </plugin>

        <commentGenerator>
            <property name="suppressAllComments" value="true"/>
            <property name="suppressDate" value="true"/>
        </commentGenerator>


        <!--主数据源-->
        <jdbcConnection driverClass="${spring.datasource.driver-class-name}"
                        connectionURL="${spring.datasource.url}" userId="${spring.datasource.username}" password="${spring.datasource.password}">
        </jdbcConnection>
        <javaModelGenerator targetPackage="${masterTargetModelPackage}" targetProject="${masterTargetJavaProject}" />
        <sqlMapGenerator targetPackage="${masterTargetXMLPackage}" targetProject="${masterTargetResourcesProject}" />
        <javaClientGenerator targetPackage="${masterTargetMapperPackage}" targetProject="${masterTargetJavaProject}" type="XMLMAPPER" />


        <table tableName="t_cms_category">
            <generatedKey column="category_id" sqlStatement="Mysql"  />
        </table>

    </context>
</generatorConfiguration>
