admin
2024-10-16 bd885c7015446c6c0495d3299ef64068a4c9b30e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?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>
 
    <!--mysql 连接数据库jar 这里选择自己本地位置-->
 
    <classPathEntry location="D:/mysql-connector-java-5.1.46-bin.jar"/>
    <context id="testTables" targetRuntime="MyBatis3">
        <commentGenerator>
            <!-- 是否去除自动生成的注释 true:是 : false:否 -->
            <property name="suppressAllComments" value="true"/>
        </commentGenerator>
        <!--数据库连接的信息:驱动类、连接地址、用户名、密码 -->
        <jdbcConnection driverClass="com.mysql.jdbc.Driver"
                        connectionURL="jdbc:mysql://192.168.3.253:3306/ks_goldcorn" userId="root"
                        password="123456">
        </jdbcConnection>
 
        <!-- 默认false,把JDBC DECIMAL 和 NUMERIC 类型解析为 Integer,为 true时把JDBC DECIMAL 和
        NUMERIC 类型解析为java.math.BigDecimal -->
        <javaTypeResolver>
            <property name="forceBigDecimals" value="true"/>
        </javaTypeResolver>
 
        <!-- targetProject:生成PO类的位置 -->
        <javaModelGenerator targetPackage="com.ks.goldcorn.pojo/DO"
                            targetProject="src/main/java">
            <!-- enableSubPackages:是否让schema作为包的后缀 -->
            <property name="enableSubPackages" value="false"/>
            <!-- 从数据库返回的值被清理前后的空格 -->
            <property name="trimStrings" value="true"/>
        </javaModelGenerator>
 
        <!-- targetProject:mapper映射文件生成的位置
        如果maven工程只是单独的一个工程,targetProject="src/main/java"
        若果maven工程是分模块的工程,targetProject="所属模块的名称",例如:
        targetProject="ecps-manager-mapper",下同-->
        <sqlMapGenerator targetPackage="mapper"
                         targetProject="src/main/resources">
            <!-- enableSubPackages:是否让schema作为包的后缀 -->
            <property name="enableSubPackages" value="false"/>
        </sqlMapGenerator>
 
        <!-- targetPackage:mapper接口生成的位置 -->
        <javaClientGenerator type="XMLMAPPER"
                             targetPackage="com.ks.goldcorn.mapper"
                             targetProject="src/main/java">
 
            <!-- enableSubPackages:是否让schema作为包的后缀 -->
            <property name="enableSubPackages" value="false"/>
        </javaClientGenerator>
 
        <!--<table schema=""  tableName="ks_app"></table>-->
        <!-- 指定数据库表 -->
        <!--<table schema="" domainObjectName="GoldCornAppInfo" tableName="ks_app"   enableCountByExample="false" enableUpdateByExample="false"-->
               <!--enableDeleteByExample="false" enableSelectByExample="false"-->
               <!--selectByExampleQueryId="false"></table>-->
        <!--<table schema="" domainObjectName="GoldCornBalance" tableName="ks_balance"   enableCountByExample="false" enableUpdateByExample="false"-->
               <!--enableDeleteByExample="false" enableSelectByExample="false"-->
               <!--selectByExampleQueryId="false"></table>-->
        <!--<table schema="" domainObjectName="GoldCornConsumeSource" tableName="ks_score_consume_source"   enableCountByExample="false" enableUpdateByExample="false"-->
               <!--enableDeleteByExample="false" enableSelectByExample="false"-->
               <!--selectByExampleQueryId="false"></table>-->
        <!--<table schema="" domainObjectName="GoldCornGetSource" tableName="ks_score_get_source"   enableCountByExample="false" enableUpdateByExample="false"-->
               <!--enableDeleteByExample="false" enableSelectByExample="false"-->
               <!--selectByExampleQueryId="false"></table>-->
        <table schema="" domainObjectName="AdminUser" tableName="ks_admin"   enableCountByExample="false" enableUpdateByExample="false"
               enableDeleteByExample="false" enableSelectByExample="false"
               selectByExampleQueryId="false"></table>
    </context>
 
</generatorConfiguration>