学习笔记_2021-09-08_mybatis_插件

association(一对一查询)

collection(一对多查询)

连接不上,JDBC版本问题,

找不到JDBC的坑时加<classPathEntry <classPathEntry location="C:\Users\hongyang.li\.m2\repository\mysql\mysql-connector-java\8.0.23\mysql-connector-java-8.0.23.jar" />

<property name="suppressAllComments" value="false"/>
    

<plugin>
                <groupId>org.mybatis.generator</groupId>
                <artifactId>mybatis-generator-maven-plugin</artifactId>
                <version>1.3.6</version>
                <configuration>
                    <configurationFile>${basedir}/src/main/resources/generatorConfig.xml</configurationFile>
                    <verbose>true</verbose>
                    <overwrite>true</overwrite>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>mysql</groupId>
                        <artifactId>mysql-connector-java</artifactId>
                        <version>5.1.46</version>
                    </dependency>
                    <dependency>
                        <groupId>com.softwareloop</groupId>
                        <artifactId>mybatis-generator-lombok-plugin</artifactId>
                        <version>1.0</version>
                    </dependency>
                </dependencies>
            </plugin>

<?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="D:\repo\mysql\mysql-connector-java\5.1.6\mysql-connector-java-5.1.6.jar" / -->
    <context id="context" targetRuntime="MyBatis3">

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

        <jdbcConnection driverClass="com.mysql.jdbc.Driver"
            connectionURL="jdbc:mysql://127.0.0.1:3306/platform_user?useUnicode=true&amp;characterEncoding=UTF-8&amp;nullCatalogMeansCurrent=true"
            userId="root"
            password="" />

        <javaModelGenerator targetPackage="com.dawdler.user.entity"
            targetProject="user-service/src/main/java" />
        <sqlMapGenerator targetPackage="com.dawdler.user.service.mapper"
            targetProject="user-service/src/main/resources" />
        <javaClientGenerator targetPackage="com.dawdler.user.service.mapper"
            targetProject="user-service/src/main/java" type="XMLMAPPER" />

        <!--
        <table schema="CL_DEMO" tableName="shop_user"
               enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
               enableSelectByExample="false" selectByExampleQueryId="false" >
        </table>-->

<!--        <table schema="CL_DEMO" tableName="shop_user_group"-->
<!--               enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"-->
<!--               enableSelectByExample="false" selectByExampleQueryId="false" >-->
<!--        </table>-->
<!--        <table schema="CL_DEMO" tableName="shop_permission"-->
<!--               enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"-->
<!--               enableSelectByExample="false" selectByExampleQueryId="false" >-->
<!--        </table>-->
<!--        <table schema="CL_DEMO" tableName="shop_permission_group"-->
<!--               enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"-->
<!--               enableSelectByExample="false" selectByExampleQueryId="false" >-->
<!--        </table>-->
<!--        <table schema="CL_DEMO" tableName="shop_user_group_permission"-->
<!--               enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"-->
<!--               enableSelectByExample="false" selectByExampleQueryId="false" >-->
<!--        </table>-->
        <!--<table schema="CL_DEMO" tableName="login_log"
               enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
               enableSelectByExample="false" selectByExampleQueryId="false" >
        </table>-->

       <!-- <table schema="CL_DEMO" tableName="notice"
               enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
               enableSelectByExample="false" selectByExampleQueryId="false" >
            <columnOverride column="type" javaType="java.lang.Integer" jdbcType="TINYINT" />
            <columnOverride column="state" javaType="java.lang.Integer" jdbcType="TINYINT" />
        </table>-->

        <!--<table schema="CL_DEMO" tableName="dict_type"
               enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
               enableSelectByExample="false" selectByExampleQueryId="false" >
            <columnOverride column="state" javaType="java.lang.Integer" jdbcType="TINYINT" />
        </table>

        <table schema="CL_DEMO" tableName="dict"
               enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
               enableSelectByExample="false" selectByExampleQueryId="false" >
            <columnOverride column="state" javaType="java.lang.Integer" jdbcType="TINYINT" />
        </table>-->

        <!--<table schema="CL_DEMO" tableName="org_category"
               enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
               enableSelectByExample="false" selectByExampleQueryId="false" >
            <columnOverride column="state" javaType="java.lang.Integer" jdbcType="TINYINT" />
            <columnOverride column="type" javaType="java.lang.Integer" jdbcType="TINYINT" />
        </table>-->

        <!--<table schema="CL_DEMO" tableName="user_role_relation"
               enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
               enableSelectByExample="false" selectByExampleQueryId="false" >
            <columnOverride column="state" javaType="java.lang.Integer" jdbcType="TINYINT" />
        </table>
        -->
      <!--  <table schema="CL_DEMO" tableName="menu"
               enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
               enableSelectByExample="false" selectByExampleQueryId="false" >
        </table>-->


       <!-- <table schema="CL_DEMO" tableName="form_obj"
               enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
               enableSelectByExample="false" selectByExampleQueryId="false" >
            <columnOverride column="state" javaType="java.lang.Integer" jdbcType="TINYINT" />
        </table>-->

        <!--<table schema="CL_DEMO" tableName="form_obj_button"
               enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
               enableSelectByExample="false" selectByExampleQueryId="false" >
        </table>

        <table schema="CL_DEMO" tableName="form_obj_api"
               enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
               enableSelectByExample="false" selectByExampleQueryId="false" >
        </table>-->

       <!-- <table schema="CL_DEMO" tableName="role"
               enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
               enableSelectByExample="false" selectByExampleQueryId="false" >
            <columnOverride column="state" javaType="java.lang.Integer" jdbcType="TINYINT" />
        </table>

        <table schema="CL_DEMO" tableName="role_group"
               enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
               enableSelectByExample="false" selectByExampleQueryId="false" >
            <columnOverride column="state" javaType="java.lang.Integer" jdbcType="TINYINT" />
        </table>

        <table schema="CL_DEMO" tableName="role_group_relation"
               enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
               enableSelectByExample="false" selectByExampleQueryId="false" >
        </table>-->


       <!-- <table schema="CL_DEMO" tableName="role_group_relation"
               enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
               enableSelectByExample="false" selectByExampleQueryId="false" >
        </table>

        <table schema="CL_DEMO" tableName="user_menu_relation"
               enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
               enableSelectByExample="false" selectByExampleQueryId="false" >
        </table>-->


       <!-- <table schema="CL_DEMO" tableName="role_menu_relation"
               enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
               enableSelectByExample="false" selectByExampleQueryId="false" >
        </table>-->

        <!--<table schema="CL_DEMO" tableName="role_group_menu_relation"
               enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
               enableSelectByExample="false" selectByExampleQueryId="false" >
        </table>-->

        <!--<table schema="CL_DEMO" tableName="role_menu_form_button_relation"
               enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
               enableSelectByExample="false" selectByExampleQueryId="false" >
            <columnOverride column="state" javaType="java.lang.Integer" jdbcType="TINYINT" />
        </table>

        <table schema="CL_DEMO" tableName="role_menu_form_api_relation"
               enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
               enableSelectByExample="false" selectByExampleQueryId="false" >
            <columnOverride column="state" javaType="java.lang.Integer" jdbcType="TINYINT" />
        </table>-->

        <!--<table schema="CL_DEMO" tableName="target_menu_relation"
               enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
               enableSelectByExample="false" selectByExampleQueryId="false" >
            <columnOverride column="type" javaType="java.lang.Integer" jdbcType="TINYINT" />
        </table>-->

      <!--  <table schema="CL_DEMO" tableName="target_menu_form_button_relation"
               enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
               enableSelectByExample="false" selectByExampleQueryId="false" >
            <columnOverride column="type" javaType="java.lang.Integer" jdbcType="TINYINT" />
            <columnOverride column="state" javaType="java.lang.Integer" jdbcType="TINYINT" />
        </table>

        <table schema="CL_DEMO" tableName="target_menu_form_api_relation"
               enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
               enableSelectByExample="false" selectByExampleQueryId="false" >
            <columnOverride column="type" javaType="java.lang.Integer" jdbcType="TINYINT" />
            <columnOverride column="state" javaType="java.lang.Integer" jdbcType="TINYINT" />
        </table>-->

       <!-- <table schema="CL_DEMO" tableName="dict_data_operate_type"
               enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
               enableSelectByExample="false" selectByExampleQueryId="false" >
        </table>
        -->
       <!-- <table schema="CL_DEMO" tableName="dict_data_operate_range"
               enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
               enableSelectByExample="false" selectByExampleQueryId="false" >
        </table>-->

        <!--<table schema="CL_DEMO" tableName="data_target_operate_range_relation"
               enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
               enableSelectByExample="false" selectByExampleQueryId="false" >
        <columnOverride column="type" javaType="java.lang.Integer" jdbcType="TINYINT" />
        </table>-->

        <!--<table schema="CL_DEMO" tableName="permission_col"
               enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
               enableSelectByExample="false" selectByExampleQueryId="false" >
            <columnOverride column="state" javaType="java.lang.Integer" jdbcType="TINYINT" />
        </table>

        <table schema="CL_DEMO" tableName="permission_col_field"
               enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
               enableSelectByExample="false" selectByExampleQueryId="false" >
        </table>

        <table schema="CL_DEMO" tableName="permission_row"
               enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
               enableSelectByExample="false" selectByExampleQueryId="false" >
            <columnOverride column="state" javaType="java.lang.Integer" jdbcType="TINYINT" />
        </table>

        <table schema="CL_DEMO" tableName="permission_row_field"
               enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
               enableSelectByExample="false" selectByExampleQueryId="false" >
            <columnOverride column="state" javaType="java.lang.Integer" jdbcType="TINYINT" />
        </table>-->


        <!--<table schema="CL_DEMO" tableName="target_form_row"
               enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
               enableSelectByExample="false" selectByExampleQueryId="false" >
            <columnOverride column="type" javaType="java.lang.Integer" jdbcType="TINYINT" />
        </table>


        <table schema="CL_DEMO" tableName="target_form_col"
               enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
               enableSelectByExample="false" selectByExampleQueryId="false" >
            <columnOverride column="type" javaType="java.lang.Integer" jdbcType="TINYINT" />
        </table>-->


      <!--  <table schema="CL_DEMO" tableName="general_function_info"
               enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
               enableSelectByExample="false" selectByExampleQueryId="false" >
            <columnOverride column="state" javaType="java.lang.Integer" jdbcType="TINYINT" />
        </table>

        <table schema="CL_DEMO" tableName="target_function_relation"
               enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
               enableSelectByExample="false" selectByExampleQueryId="false" >
            <columnOverride column="type" javaType="java.lang.Integer" jdbcType="TINYINT" />
        </table>

        <table schema="CL_DEMO" tableName="function_operate_relation"
               enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
               enableSelectByExample="false" selectByExampleQueryId="false" >
            <columnOverride column="type" javaType="java.lang.Integer" jdbcType="TINYINT" />
        </table>-->

        <table schema="platform_user" tableName="authority_organization"
               enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
               enableSelectByExample="false" selectByExampleQueryId="false">
            <columnOverride column="org_level" javaType="java.lang.Integer" jdbcType="TINYINT"/>
            <columnOverride column="state" javaType="java.lang.Integer" jdbcType="TINYINT"/>
        </table>

    </context>
</generatorConfiguration>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值