更新代码生成器

This commit is contained in:
shuzheng 2017-04-06 18:26:14 +08:00
parent 8d7edddfa4
commit 649e0b8833
4 changed files with 36 additions and 4 deletions

View File

@ -3,6 +3,9 @@ package com.zheng.cms.dao;
import com.zheng.common.util.MybatisGeneratorUtil; import com.zheng.common.util.MybatisGeneratorUtil;
import com.zheng.common.util.PropertiesFileUtil; import com.zheng.common.util.PropertiesFileUtil;
import java.util.HashMap;
import java.util.Map;
/** /**
* 代码生成类 * 代码生成类
* Created by ZhangShuzheng on 2017/1/10. * 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_URL = PropertiesFileUtil.getInstance("generator").get("generator.jdbc.url");
private static String JDBC_USERNAME = PropertiesFileUtil.getInstance("generator").get("generator.jdbc.username"); private static String JDBC_USERNAME = PropertiesFileUtil.getInstance("generator").get("generator.jdbc.username");
private static String JDBC_PASSWORD = PropertiesFileUtil.getInstance("generator").get("generator.jdbc.password"); private static String JDBC_PASSWORD = PropertiesFileUtil.getInstance("generator").get("generator.jdbc.password");
// 需要insert后返回主键的表配置key:表名,value:主键名
private static Map<String, String> LAST_INSERT_ID_TABLES = new HashMap<>();
static {
}
/** /**
* 自动代码生成 * 自动代码生成
* @param args * @param args
*/ */
public static void main(String[] args) throws Exception { 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);
} }
} }

View File

@ -3,6 +3,9 @@ package com.zheng.pay.dao;
import com.zheng.common.util.MybatisGeneratorUtil; import com.zheng.common.util.MybatisGeneratorUtil;
import com.zheng.common.util.PropertiesFileUtil; import com.zheng.common.util.PropertiesFileUtil;
import java.util.HashMap;
import java.util.Map;
/** /**
* 代码生成类 * 代码生成类
* Created by ZhangShuzheng on 2017/1/10. * 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_URL = PropertiesFileUtil.getInstance("generator").get("generator.jdbc.url");
private static String JDBC_USERNAME = PropertiesFileUtil.getInstance("generator").get("generator.jdbc.username"); private static String JDBC_USERNAME = PropertiesFileUtil.getInstance("generator").get("generator.jdbc.username");
private static String JDBC_PASSWORD = PropertiesFileUtil.getInstance("generator").get("generator.jdbc.password"); private static String JDBC_PASSWORD = PropertiesFileUtil.getInstance("generator").get("generator.jdbc.password");
// 需要insert后返回主键的表配置key:表名,value:主键名
private static Map<String, String> LAST_INSERT_ID_TABLES = new HashMap<>();
static {
}
/** /**
* 自动代码生成 * 自动代码生成
* @param args * @param args
*/ */
public static void main(String[] args) throws Exception { 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);
} }
} }

View File

@ -3,6 +3,9 @@ package com.zheng.ucenter.dao;
import com.zheng.common.util.MybatisGeneratorUtil; import com.zheng.common.util.MybatisGeneratorUtil;
import com.zheng.common.util.PropertiesFileUtil; import com.zheng.common.util.PropertiesFileUtil;
import java.util.HashMap;
import java.util.Map;
/** /**
* 代码生成类 * 代码生成类
* Created by ZhangShuzheng on 2017/1/10. * 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_URL = PropertiesFileUtil.getInstance("jdbc").get("master.jdbc.url");
private static String JDBC_USERNAME = PropertiesFileUtil.getInstance("jdbc").get("master.jdbc.username"); private static String JDBC_USERNAME = PropertiesFileUtil.getInstance("jdbc").get("master.jdbc.username");
private static String JDBC_PASSWORD = PropertiesFileUtil.getInstance("jdbc").get("master.jdbc.password"); private static String JDBC_PASSWORD = PropertiesFileUtil.getInstance("jdbc").get("master.jdbc.password");
// 需要insert后返回主键的表配置key:表名,value:主键名
private static Map<String, String> LAST_INSERT_ID_TABLES = new HashMap<>();
static {
}
/** /**
* 自动代码生成 * 自动代码生成
* @param args * @param args
*/ */
public static void main(String[] args) throws Exception { 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);
} }
} }

View File

@ -3,6 +3,9 @@ package com.zheng.wechat.mp.dao;
import com.zheng.common.util.MybatisGeneratorUtil; import com.zheng.common.util.MybatisGeneratorUtil;
import com.zheng.common.util.PropertiesFileUtil; import com.zheng.common.util.PropertiesFileUtil;
import java.util.HashMap;
import java.util.Map;
/** /**
* 代码生成类 * 代码生成类
* Created by ZhangShuzheng on 2017/1/10. * 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_URL = PropertiesFileUtil.getInstance("jdbc").get("master.jdbc.url");
private static String JDBC_USERNAME = PropertiesFileUtil.getInstance("jdbc").get("master.jdbc.username"); private static String JDBC_USERNAME = PropertiesFileUtil.getInstance("jdbc").get("master.jdbc.username");
private static String JDBC_PASSWORD = PropertiesFileUtil.getInstance("jdbc").get("master.jdbc.password"); private static String JDBC_PASSWORD = PropertiesFileUtil.getInstance("jdbc").get("master.jdbc.password");
// 需要insert后返回主键的表配置key:表名,value:主键名
private static Map<String, String> LAST_INSERT_ID_TABLES = new HashMap<>();
static {
}
/** /**
* 自动代码生成 * 自动代码生成
* @param args * @param args
*/ */
public static void main(String[] args) throws Exception { 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);
} }
} }