tk-mapper代码生成-工作

本文介绍了使用mybatis3的generatorConfig.xml配置文件进行代码生成,并提到了需要下载mysql驱动。此外,还提及了mybatis-plus的Generator以及自定义的MySqlTypeConvertCustom相关工作。
摘要由CSDN通过智能技术生成

生成效果

mybatis3代码生成

在这里插入图片描述
mybatis-generator /generatorConfig.xml

<?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>
    <classPathEntry
            location="F:\软件\mysql-jar\mysql-connector-java-5.1.45\mysql-connector-java-5.1.45-bin.jar" />
    <context id="context1" targetRuntime="MyBatis3">
        <commentGenerator>
            <!-- 是否去除自动生成的注释 true:是 : false:否 -->
            <property name="suppressAllComments" value="true" />
            <!--数据库连接的信息:驱动类、连接地址、用户名、密码 -->
        </commentGenerator>
        <jdbcConnection driverClass="com.mysql.jdbc.Driver"
                        connectionURL="jdbc:mysql://127.0.0.1:3306/ht-oa?useSSL=false" userId="root" password="123456">
        </jdbcConnection>
        <javaModelGenerator targetPackage="com.liuyang.domain"
                            targetProject="src/main/java" />
        <sqlMapGenerator targetPackage="sqlmapper"
                         targetProject="src/main/resources" />
        <javaClientGenerator targetPackage="com.liuyang.repository"
                             targetProject="src/main/java" type="XMLMAPPER" />
        <!-- shema 数据库 tableName表明 -->
        <table schema="oa_product" tableName="staff" />
        <table schema="hjy_pom" tableName="benefits_formula" />
        <table schema="hjy_pom" tableName="benefits_share" />
        <table schema="hjy_pom" tableName="business_tree" />
        <table schema="hjy_pom" tableName="company" />
        <table schema="hjy_pom" tableName="dictionary_type" />
        <table schema="hjy_pom" tableName="dictionary_data" />
        <table schema="hjy_pom" tableName="entrust_company" />
        <table schema="hjy_pom" tableName="entrust_contract" />
        <table schema="hjy_pom" tableName="entrust_contract_company_ref" />
        <table schema="hjy_pom" tableName="entrust_cooperate" />
        <table schema="hjy_pom" tableName="entrust_pay" />
        <table schema="hjy_pom" tableName="flow" />
        <table schema="hjy_pom" tableName="expert" />
        <table schema="hjy_pom" tableName="flow_record" />
        <table schema="hjy_pom" tableName="invoice_record" />
        <table schema="hjy_pom" tableName="main_contract" />
        <table schema="hjy_pom" tableName="main_contract_plan" />
        <table schema="hjy_pom" tableName="mian_contract_company" />
        <table schema="hjy_pom" tableName="pay_record" />
        <table schema="hjy_pom" tableName="project" />
        <table schema="hjy_pom" tableName="receivable_record" />
        <table schema="hjy_pom" tableName="tendering_bid" />
        <table schema="hjy_pom" tableName="permission" />
        <table schema="hjy_pom" tableName="role" />
        <table schema="hjy_pom" tableName="role_permission_ref" />
        <table schema="hjy_pom" tableName="user_role" />
        <table schema="hjy_pom" tableName="user_role_ref" />
        <table schema="hjy_pom" tableName="company_people" />
        <table schema="hjy_pom" tableName="company_equipment" />
        <table schema="gza_srms" tableName="user_copy" />
    </context>
</generatorConfiguration>

需要下载mysql驱动:https://downloads.mysql.com/archives/c-j/
pom 依赖和插件

    <build>
     	<finalName>gza-srms</finalName>
        <plugins>
            <!-- Srping Boot 打包工具 -->
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <!-- 没有该配置,devtools 不生效 -->
                    <fork>true</fork>
                    <addResources>true</addResources>
                </configuration>
            
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值