From 649e0b8833e7aea9ee68ab9dc720f33d25ac1cad Mon Sep 17 00:00:00 2001 From: shuzheng <469741414@qq.com> Date: Thu, 6 Apr 2017 18:26:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BB=A3=E7=A0=81=E7=94=9F?= =?UTF-8?q?=E6=88=90=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/zheng/cms/dao/Generator.java | 10 +++++++++- .../src/main/java/com/zheng/pay/dao/Generator.java | 10 +++++++++- .../src/main/java/com/zheng/ucenter/dao/Generator.java | 10 +++++++++- .../main/java/com/zheng/wechat/mp/dao/Generator.java | 10 +++++++++- 4 files changed, 36 insertions(+), 4 deletions(-) diff --git a/zheng-cms/zheng-cms-dao/src/main/java/com/zheng/cms/dao/Generator.java b/zheng-cms/zheng-cms-dao/src/main/java/com/zheng/cms/dao/Generator.java index aba3a6d3..cc247989 100644 --- a/zheng-cms/zheng-cms-dao/src/main/java/com/zheng/cms/dao/Generator.java +++ b/zheng-cms/zheng-cms-dao/src/main/java/com/zheng/cms/dao/Generator.java @@ -3,6 +3,9 @@ package com.zheng.cms.dao; import com.zheng.common.util.MybatisGeneratorUtil; import com.zheng.common.util.PropertiesFileUtil; +import java.util.HashMap; +import java.util.Map; + /** * 代码生成类 * Created by ZhangShuzheng on 2017/1/10. @@ -18,13 +21,18 @@ public class Generator { private static String JDBC_URL = PropertiesFileUtil.getInstance("generator").get("generator.jdbc.url"); private static String JDBC_USERNAME = PropertiesFileUtil.getInstance("generator").get("generator.jdbc.username"); private static String JDBC_PASSWORD = PropertiesFileUtil.getInstance("generator").get("generator.jdbc.password"); + // 需要insert后返回主键的表配置,key:表名,value:主键名 + private static Map LAST_INSERT_ID_TABLES = new HashMap<>(); + static { + + } /** * 自动代码生成 * @param args */ public static void main(String[] args) throws Exception { - MybatisGeneratorUtil.generator(JDBC_DRIVER, JDBC_URL, JDBC_USERNAME, JDBC_PASSWORD, MODULE, DATABASE, TABLE_PREFIX, PACKAGE_NAME); + MybatisGeneratorUtil.generator(JDBC_DRIVER, JDBC_URL, JDBC_USERNAME, JDBC_PASSWORD, MODULE, DATABASE, TABLE_PREFIX, PACKAGE_NAME, LAST_INSERT_ID_TABLES); } } diff --git a/zheng-pay/zheng-pay-dao/src/main/java/com/zheng/pay/dao/Generator.java b/zheng-pay/zheng-pay-dao/src/main/java/com/zheng/pay/dao/Generator.java index 377d4fb0..0e5152dd 100644 --- a/zheng-pay/zheng-pay-dao/src/main/java/com/zheng/pay/dao/Generator.java +++ b/zheng-pay/zheng-pay-dao/src/main/java/com/zheng/pay/dao/Generator.java @@ -3,6 +3,9 @@ package com.zheng.pay.dao; import com.zheng.common.util.MybatisGeneratorUtil; import com.zheng.common.util.PropertiesFileUtil; +import java.util.HashMap; +import java.util.Map; + /** * 代码生成类 * Created by ZhangShuzheng on 2017/1/10. @@ -18,13 +21,18 @@ public class Generator { private static String JDBC_URL = PropertiesFileUtil.getInstance("generator").get("generator.jdbc.url"); private static String JDBC_USERNAME = PropertiesFileUtil.getInstance("generator").get("generator.jdbc.username"); private static String JDBC_PASSWORD = PropertiesFileUtil.getInstance("generator").get("generator.jdbc.password"); + // 需要insert后返回主键的表配置,key:表名,value:主键名 + private static Map LAST_INSERT_ID_TABLES = new HashMap<>(); + static { + + } /** * 自动代码生成 * @param args */ public static void main(String[] args) throws Exception { - MybatisGeneratorUtil.generator(JDBC_DRIVER, JDBC_URL, JDBC_USERNAME, JDBC_PASSWORD, MODULE, DATABASE, TABLE_PREFIX, PACKAGE_NAME); + MybatisGeneratorUtil.generator(JDBC_DRIVER, JDBC_URL, JDBC_USERNAME, JDBC_PASSWORD, MODULE, DATABASE, TABLE_PREFIX, PACKAGE_NAME, LAST_INSERT_ID_TABLES); } } diff --git a/zheng-ucenter/zheng-ucenter-dao/src/main/java/com/zheng/ucenter/dao/Generator.java b/zheng-ucenter/zheng-ucenter-dao/src/main/java/com/zheng/ucenter/dao/Generator.java index 036d4c0b..dd878fd6 100644 --- a/zheng-ucenter/zheng-ucenter-dao/src/main/java/com/zheng/ucenter/dao/Generator.java +++ b/zheng-ucenter/zheng-ucenter-dao/src/main/java/com/zheng/ucenter/dao/Generator.java @@ -3,6 +3,9 @@ package com.zheng.ucenter.dao; import com.zheng.common.util.MybatisGeneratorUtil; import com.zheng.common.util.PropertiesFileUtil; +import java.util.HashMap; +import java.util.Map; + /** * 代码生成类 * Created by ZhangShuzheng on 2017/1/10. @@ -18,13 +21,18 @@ public class Generator { private static String JDBC_URL = PropertiesFileUtil.getInstance("jdbc").get("master.jdbc.url"); private static String JDBC_USERNAME = PropertiesFileUtil.getInstance("jdbc").get("master.jdbc.username"); private static String JDBC_PASSWORD = PropertiesFileUtil.getInstance("jdbc").get("master.jdbc.password"); + // 需要insert后返回主键的表配置,key:表名,value:主键名 + private static Map LAST_INSERT_ID_TABLES = new HashMap<>(); + static { + + } /** * 自动代码生成 * @param args */ public static void main(String[] args) throws Exception { - MybatisGeneratorUtil.generator(JDBC_DRIVER, JDBC_URL, JDBC_USERNAME, JDBC_PASSWORD, MODULE, DATABASE, TABLE_PREFIX, PACKAGE_NAME); + MybatisGeneratorUtil.generator(JDBC_DRIVER, JDBC_URL, JDBC_USERNAME, JDBC_PASSWORD, MODULE, DATABASE, TABLE_PREFIX, PACKAGE_NAME, LAST_INSERT_ID_TABLES); } } diff --git a/zheng-wechat/zheng-wechat-mp/zheng-wechat-mp-dao/src/main/java/com/zheng/wechat/mp/dao/Generator.java b/zheng-wechat/zheng-wechat-mp/zheng-wechat-mp-dao/src/main/java/com/zheng/wechat/mp/dao/Generator.java index 5e2aa0a6..c3af671f 100644 --- a/zheng-wechat/zheng-wechat-mp/zheng-wechat-mp-dao/src/main/java/com/zheng/wechat/mp/dao/Generator.java +++ b/zheng-wechat/zheng-wechat-mp/zheng-wechat-mp-dao/src/main/java/com/zheng/wechat/mp/dao/Generator.java @@ -3,6 +3,9 @@ package com.zheng.wechat.mp.dao; import com.zheng.common.util.MybatisGeneratorUtil; import com.zheng.common.util.PropertiesFileUtil; +import java.util.HashMap; +import java.util.Map; + /** * 代码生成类 * Created by ZhangShuzheng on 2017/1/10. @@ -18,13 +21,18 @@ public class Generator { private static String JDBC_URL = PropertiesFileUtil.getInstance("jdbc").get("master.jdbc.url"); private static String JDBC_USERNAME = PropertiesFileUtil.getInstance("jdbc").get("master.jdbc.username"); private static String JDBC_PASSWORD = PropertiesFileUtil.getInstance("jdbc").get("master.jdbc.password"); + // 需要insert后返回主键的表配置,key:表名,value:主键名 + private static Map LAST_INSERT_ID_TABLES = new HashMap<>(); + static { + + } /** * 自动代码生成 * @param args */ public static void main(String[] args) throws Exception { - MybatisGeneratorUtil.generator(JDBC_DRIVER, JDBC_URL, JDBC_USERNAME, JDBC_PASSWORD, MODULE, DATABASE, TABLE_PREFIX, PACKAGE_NAME); + MybatisGeneratorUtil.generator(JDBC_DRIVER, JDBC_URL, JDBC_USERNAME, JDBC_PASSWORD, MODULE, DATABASE, TABLE_PREFIX, PACKAGE_NAME, LAST_INSERT_ID_TABLES); } }