<?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="generator.properties"></properties>

    <context id="MysqlContext" targetRuntime="MyBatis3" defaultModelType="flat">

        <property name="javaFileEncoding" value="UTF-8"/>
        <!-- 由于beginningDelimiter和endingDelimiter的默认值为双引号(")，在Mysql中不能这么写，所以还要将这两个默认值改为`  -->
        <property name="beginningDelimiter" value="`"/>
        <property name="endingDelimiter" value="`"/>

        <!-- 为生成的Java模型创建一个toString方法 -->
        <plugin type="org.mybatis.generator.plugins.ToStringPlugin"></plugin>

        <!-- 为生成的Java模型类添加序列化接口，并生成serialVersionUID字段 -->
        <plugin type="com.ruoyi.generator.pugin.SerializablePlugin">
            <property name="suppressJavaInterface" value="false"/>
        </plugin>

        <!-- Java模型生成equals和hashcode方法 -->
        <plugin type="org.mybatis.generator.plugins.EqualsHashCodePlugin"></plugin>

        <!-- 生成的代码去掉注释 -->
        <commentGenerator type="com.ruoyi.generator.pugin.CommentGenerator">
            <property name="suppressAllComments" value="true" />
            <property name="suppressDate" value="true"/>
        </commentGenerator>

        <!-- 数据库连接 -->
        <jdbcConnection driverClass="${generator.jdbc.driver}"
                        connectionURL="${generator.jdbc.url}"
                        userId="${generator.jdbc.username}"
                        password="P@44w0rd" />

        <!-- model生成 -->
        <javaModelGenerator targetPackage="com.ruoyi.generator.model" targetProject="/Users/condey/Documents/zl/wst/wst-be/ruoyi-generator/src/main/java" />

        <!-- MapperXML生成 -->
        <sqlMapGenerator targetPackage="com.ruoyi.generator.mapper" targetProject="/Users/condey/Documents/zl/wst/wst-be/ruoyi-generator/src/main/java" />

        <!-- Mapper接口生成 -->
        <javaClientGenerator targetPackage="com.ruoyi.generator.mapper" targetProject="/Users/condey/Documents/zl/wst/wst-be/ruoyi-generator/src/main/java" type="XMLMAPPER" />

        <!-- 需要映射的表 -->
                                    <table tableName="grid_work_report_item" domainObjectName="GridWorkReportItem">
                    <property name="useActualColumnNames" value="false"/>
                    <columnRenamingRule searchString="^[AG_]+" replaceString=""/>
                </table>
                        </context>
</generatorConfiguration>
