diff --git a/src/main/java/xyz/wbsite/dbtool/javafx/manger/callable/SpringBootCallable.java b/src/main/java/xyz/wbsite/dbtool/javafx/manger/callable/SpringBootCallable.java index c1d30480..17dc9fb7 100644 --- a/src/main/java/xyz/wbsite/dbtool/javafx/manger/callable/SpringBootCallable.java +++ b/src/main/java/xyz/wbsite/dbtool/javafx/manger/callable/SpringBootCallable.java @@ -466,6 +466,7 @@ public class SpringBootCallable implements Callable { ctx.put("moduleName", md.getModuleName()); ctx.put("author", md.getProjectAuthor()); ctx.put("date", new Date()); + ctx.put("dataBase", dataBase.toString()); freeMarkerManager.outputTemp(Tool.createFile(ent.getAbsolutePath(), "Dict.java"), option + "/java/module/system/ent/Dict.java", ctx); freeMarkerManager.outputTemp(Tool.createFile(ent.getAbsolutePath(), "DictItem.java"), option + "/java/module/system/ent/DictItem.java", ctx); @@ -479,11 +480,11 @@ public class SpringBootCallable implements Callable { freeMarkerManager.outputTemp(Tool.createFile(mgr.getAbsolutePath(), "FileManagerImpl.java"), option + "/java/module/system/mgr/FileManagerImpl.java", ctx); freeMarkerManager.outputTemp(Tool.createFile(mpr.getAbsolutePath(), "DictItemMapper.java"), option + "/java/module/system/mpr/DictItemMapper.java", ctx); - freeMarkerManager.outputTemp(Tool.createFile(mpr.getAbsolutePath(), "DictItemMapper.xml"), option + "/java/module/system/mpr/DictItemMapper.xml", ctx); + freeMarkerManager.outputTemp(Tool.createFile(mpr.getAbsolutePath(), "DictItemMapper.xml"), option + "/java/module/system/mpr/DictItemMapper_" + dataBase.toString() + ".xml", ctx); freeMarkerManager.outputTemp(Tool.createFile(mpr.getAbsolutePath(), "DictMapper.java"), option + "/java/module/system/mpr/DictMapper.java", ctx); - freeMarkerManager.outputTemp(Tool.createFile(mpr.getAbsolutePath(), "DictMapper.xml"), option + "/java/module/system/mpr/DictMapper.xml", ctx); + freeMarkerManager.outputTemp(Tool.createFile(mpr.getAbsolutePath(), "DictMapper.xml"), option + "/java/module/system/mpr/DictMapper_" + dataBase.toString() + ".xml", ctx); freeMarkerManager.outputTemp(Tool.createFile(mpr.getAbsolutePath(), "FileMapper.java"), option + "/java/module/system/mpr/FileMapper.java", ctx); - freeMarkerManager.outputTemp(Tool.createFile(mpr.getAbsolutePath(), "FileMapper.xml"), option + "/java/module/system/mpr/FileMapper.xml", ctx); + freeMarkerManager.outputTemp(Tool.createFile(mpr.getAbsolutePath(), "FileMapper.xml"), option + "/java/module/system/mpr/FileMapper_" + dataBase.toString() + ".xml", ctx); freeMarkerManager.outputTemp(Tool.createFile(req.getAbsolutePath(), "AuthLoginRequest.java"), option + "/java/module/system/req/AuthLoginRequest.java", ctx); freeMarkerManager.outputTemp(Tool.createFile(req.getAbsolutePath(), "DictCreateRequest.java"), option + "/java/module/system/req/DictCreateRequest.java", ctx); @@ -690,6 +691,14 @@ public class SpringBootCallable implements Callable { freeMarkerManager.outputTemp(Tool.createFile(tableDir.getAbsolutePath(), "ALL_TABLE.sql"), option + "/resources/dbtool/tableAll.ftl", ctx); } + { + File system = Tool.createPath(dbtool.getAbsolutePath(), "system_table"); + freeMarkerManager.outputTemp(Tool.createFile(system.getAbsolutePath(), "ALL_TABLE.sql"), option + "/resources/dbtool/system/ALL_TABLE_" + dataBase.toString() + ".sql", ctx); + freeMarkerManager.outputTemp(Tool.createFile(system.getAbsolutePath(), "DICT.sql"), option + "/resources/dbtool/system/DICT_" + dataBase.toString() + ".sql", ctx); + freeMarkerManager.outputTemp(Tool.createFile(system.getAbsolutePath(), "DICT_ITEM.sql"), option + "/resources/dbtool/system/DICT_ITEM_" + dataBase.toString() + ".sql", ctx); + freeMarkerManager.outputTemp(Tool.createFile(system.getAbsolutePath(), "FILE.sql"), option + "/resources/dbtool/system/FILE_" + dataBase.toString() + ".sql", ctx); + } + if (DataBase.Oracle.name().equals(dataBase.name())) { File lib = Tool.createPath(root.getAbsolutePath(), "lib"); Tool.outputResource(option + "/resources/lib/ojdbc7-12.1.0.2.jar", Tool.createFile(lib.getAbsolutePath(), "ojdbc7-12.1.0.2.jar")); @@ -727,14 +736,6 @@ public class SpringBootCallable implements Callable { } } } - - { - File system = Tool.createPath(dbtool.getAbsolutePath(), "system_table"); - freeMarkerManager.outputTemp(Tool.createFile(system.getAbsolutePath(), "ALL_TABLE.sql"), option + "/resources/dbtool/system/ALL_TABLE.sql", ctx); - freeMarkerManager.outputTemp(Tool.createFile(system.getAbsolutePath(), "DICT.sql"), option + "/resources/dbtool/system/DICT.sql", ctx); - freeMarkerManager.outputTemp(Tool.createFile(system.getAbsolutePath(), "DICT_ITEM.sql"), option + "/resources/dbtool/system/DICT_ITEM.sql", ctx); - freeMarkerManager.outputTemp(Tool.createFile(system.getAbsolutePath(), "FILE.sql"), option + "/resources/dbtool/system/FILE.sql", ctx); - } } public void generateTestResources(File root, Project project, DataBase dataBase, String option) { diff --git a/src/main/java/xyz/wbsite/dbtool/javafx/po/MySQLDBmapper.java b/src/main/java/xyz/wbsite/dbtool/javafx/po/MySQLDBmapper.java index 4420e63b..af8d6a3a 100644 --- a/src/main/java/xyz/wbsite/dbtool/javafx/po/MySQLDBmapper.java +++ b/src/main/java/xyz/wbsite/dbtool/javafx/po/MySQLDBmapper.java @@ -33,7 +33,7 @@ public class MySQLDBmapper extends AbstractDBmapper { } else if (FieldType.Double.name().equals(type.name())) { sb.append("DOUBLE"); } else if (FieldType.Date.name().equals(type.name())) { - sb.append("DATETIME"); + sb.append("INTEGER"); } else if (FieldType.Bytes.name().equals(type.name())) { sb.append("BLOB"); } else if (FieldType.Character.name().equals(type.name())) { diff --git a/src/main/java/xyz/wbsite/dbtool/javafx/po/SQLiteDBmapper.java b/src/main/java/xyz/wbsite/dbtool/javafx/po/SQLiteDBmapper.java index f48d66fe..d5143ff7 100644 --- a/src/main/java/xyz/wbsite/dbtool/javafx/po/SQLiteDBmapper.java +++ b/src/main/java/xyz/wbsite/dbtool/javafx/po/SQLiteDBmapper.java @@ -12,7 +12,7 @@ public class SQLiteDBmapper extends AbstractDBmapper { @Override public String getFieldSql(Field field) { StringBuffer sb = new StringBuffer(""); - sb.append("\"").append(field.getFieldName()).append("\""); + sb.append("\"").append(field.getFieldName()).append("\" "); FieldType type = field.getFieldType(); @@ -38,7 +38,7 @@ public class SQLiteDBmapper extends AbstractDBmapper { sb.append("DATETIME"); } else if (FieldType.Dict.name().equals(type.name())) { sb.append("VARCHAR(10)"); - } else if (FieldType.BigDecimal.name().equals(type.name())) { + } else if (FieldType.BigDecimal.name().equals(type.name())) { sb.append("INTEGER"); } else if (FieldType.String_1.name().equals(type.name())) { sb.append("CHAR(1)"); @@ -90,6 +90,10 @@ public class SQLiteDBmapper extends AbstractDBmapper { return "BOOLEAN"; } else if (FieldType.Byte.name().equals(type.name())) { return "TINYINT"; + } else if (FieldType.Bytes.name().equals(type.name())) { + return "BLOB"; + } else if (FieldType.Character.name().equals(type.name())) { + return "VARCHAR"; } else if (FieldType.Short.name().equals(type.name())) { return "SMALLINT"; } else if (FieldType.Integer.name().equals(type.name())) { @@ -100,8 +104,12 @@ public class SQLiteDBmapper extends AbstractDBmapper { return "FLOAT"; } else if (FieldType.Double.name().equals(type.name())) { return "DOUBLE"; - } else if (FieldType.Character.name().equals(type.name())) { - return "VARCHAR"; + } else if (FieldType.Date.name().equals(type.name())) { + return "DATETIME"; + } else if (FieldType.BigDecimal.name().equals(type.name())) { + return "INTEGER"; + } else if (FieldType.Dict.name().equals(type.name())) { + return "CHARACTER"; } else if (FieldType.String_1.name().equals(type.name())) { return "CHARACTER"; } else if (FieldType.String_10.name().equals(type.name())) { @@ -120,10 +128,8 @@ public class SQLiteDBmapper extends AbstractDBmapper { return "TEXT"; } else if (FieldType.String_var4000.name().equals(type.name())) { return "TEXT"; - } else if (FieldType.Date.name().equals(type.name())) { - return "DATE"; - } else if (FieldType.Bytes.name().equals(type.name())) { - return "BLOB"; + } else if (FieldType.String_super.name().equals(type.name())) { + return "TEXT"; } else { return ""; } diff --git a/src/main/resources/modules/SpringBoot/java/config/SQLiteConfig.java b/src/main/resources/modules/SpringBoot/java/config/SQLiteConfig.java index e558b648..fcf55f7b 100644 --- a/src/main/resources/modules/SpringBoot/java/config/SQLiteConfig.java +++ b/src/main/resources/modules/SpringBoot/java/config/SQLiteConfig.java @@ -12,12 +12,12 @@ import java.util.regex.Pattern; @Configuration public class SQLiteConfig { - @Value("${spring.datasource.url}") + @Value("${r'${spring.datasource.url}'}") private String url; @PostConstruct - public void setSharedVariable() { - Pattern compile = Pattern.compile("jdbc:sqlite:(.*.db)"); + public void generateDB() { + Pattern compile = Pattern.compile("jdbc:sqlite:(.*.db).*"); Matcher matcher = compile.matcher(url); if (matcher.find()) { String group = matcher.group(1); diff --git a/src/main/resources/modules/SpringBoot/java/module/mpr/mapper.ftl b/src/main/resources/modules/SpringBoot/java/module/mpr/mapper.ftl index 3fe2268d..22d4c4d6 100644 --- a/src/main/resources/modules/SpringBoot/java/module/mpr/mapper.ftl +++ b/src/main/resources/modules/SpringBoot/java/module/mpr/mapper.ftl @@ -245,7 +245,7 @@ 0, 0, ${r"#{"}token.userId,jdbcType=NUMERIC}, - <#if dataBase == 'Oracle'>sysdate<#elseif dataBase == 'MySQL'>sysdate()<#elseif dataBase == 'SQLite'>datetime('now'), + <#if dataBase == 'Oracle'>sysdate<#elseif dataBase == 'MySQL'>sysdate()<#elseif dataBase == 'SQLite'>datetime('now','localtime'), NULL, NULL ) @@ -269,7 +269,7 @@ 0, 0, ${r"#{"}token.userId,jdbcType=NUMERIC}, - <#if dataBase == 'Oracle'>sysdate<#elseif dataBase == 'MySQL'>sysdate()<#elseif dataBase == 'SQLite'>datetime('now'), + <#if dataBase == 'Oracle'>sysdate<#elseif dataBase == 'MySQL'>sysdate()<#elseif dataBase == 'SQLite'>datetime('now','localtime'), NULL, NULL ) @@ -326,7 +326,7 @@ ROW_VERSION = ROW_VERSION + 1, LAST_UPDATE_BY = ${r"#{"}token.userId}, - LAST_UPDATE_TIME = datetime('now') + LAST_UPDATE_TIME = datetime('now','localtime') WHERE <#if dataBase == 'Oracle'> diff --git a/src/main/resources/modules/SpringBoot/java/module/system/mpr/DictItemMapper.xml b/src/main/resources/modules/SpringBoot/java/module/system/mpr/DictItemMapper_MySQL.xml similarity index 64% rename from src/main/resources/modules/SpringBoot/java/module/system/mpr/DictItemMapper.xml rename to src/main/resources/modules/SpringBoot/java/module/system/mpr/DictItemMapper_MySQL.xml index 158375f7..d50d1339 100644 --- a/src/main/resources/modules/SpringBoot/java/module/system/mpr/DictItemMapper.xml +++ b/src/main/resources/modules/SpringBoot/java/module/system/mpr/DictItemMapper_MySQL.xml @@ -32,20 +32,20 @@ WHERE `IS_DELETED` = 0 - - AND `ID` = ${r"#{"}request.id} - - AND `DICT_NAME` = ${r"#{"}request.dictName} + AND `DICT_NAME` = ${r"#"}{request.dictName} - AND `KEY` = ${r"#{"}request.key} + AND `KEY` = ${r"#"}{request.key} - AND `VALUE` = ${r"#{"}request.value} + AND `VALUE` = ${r"#"}{request.value} + + + AND `SORT` = ${r"#"}{request.sort} - AND `VALID` = ${r"#{"}request.valid} + AND `VALID` = ${r"#"}{request.valid} @@ -69,19 +69,44 @@ ) VALUES ( - ${r"#{"}request.id}, - ${r"#{"}request.dictName,jdbcType=VARCHAR}, - ${r"#{"}request.key,jdbcType=VARCHAR}, - ${r"#{"}request.value,jdbcType=VARCHAR}, - ${r"#{"}request.sort,jdbcType=INTEGER}, - ${r"#{"}request.valid,jdbcType=BIT}, + ${r"#"}{request.id}, + ${r"#"}{request.dictName,jdbcType=VARCHAR}, + ${r"#"}{request.key,jdbcType=VARCHAR}, + ${r"#"}{request.value,jdbcType=VARCHAR}, + ${r"#"}{request.sort,jdbcType=INTEGER}, + ${r"#"}{request.valid,jdbcType=BIT}, + 0, + 0, + ${r"#"}{token.userId,jdbcType=NUMERIC}, + sysdate(), + NULL, + NULL + ) + + + + INSERT INTO + + ( + + ) + VALUES + + ( + ${r"#"}{item.id}, + ${r"#"}{item.dictName,jdbcType=VARCHAR}, + ${r"#"}{item.key,jdbcType=VARCHAR}, + ${r"#"}{item.value,jdbcType=VARCHAR}, + ${r"#"}{item.sort,jdbcType=INTEGER}, + ${r"#"}{item.valid,jdbcType=BIT}, 0, 0, - ${r"#{"}token.userId,jdbcType=NUMERIC}, + ${r"#"}{token.userId,jdbcType=NUMERIC}, sysdate(), NULL, NULL ) + @@ -89,24 +114,25 @@ SET `IS_DELETED` = 1 WHERE `IS_DELETED` = 0 - AND `ID` = ${r"#{"}request.id} + AND `ID` = ${r"#"}{request.id} UPDATE SET - `KEY` = ${r"#{"}request.key,jdbcType=CHAR}, - `VALUE` = ${r"#{"}request.value,jdbcType=VARCHAR}, - `SORT` = ${r"#{"}request.sort,jdbcType=INTEGER}, - `VALID` = ${r"#{"}request.valid,jdbcType=BIT}, + `DICT_NAME` = ${r"#"}{request.dictName,jdbcType=VARCHAR}, + `KEY` = ${r"#"}{request.key,jdbcType=VARCHAR}, + `VALUE` = ${r"#"}{request.value,jdbcType=VARCHAR}, + `SORT` = ${r"#"}{request.sort,jdbcType=INTEGER}, + `VALID` = ${r"#"}{request.valid,jdbcType=BIT}, `ROW_VERSION` = `ROW_VERSION` + 1, - `LAST_UPDATE_BY` = ${r"#{"}token.userId}, + `LAST_UPDATE_BY` = ${r"#"}{token.userId}, `LAST_UPDATE_TIME` = sysdate() WHERE `IS_DELETED` = 0 - AND `ID` = ${r"#{"}request.id} - AND `ROW_VERSION` = ${r"#{"}request.rowVersion} + AND `ID` = ${r"#"}{request.id} + AND `ROW_VERSION` = ${r"#"}{request.rowVersion} \ No newline at end of file diff --git a/src/main/resources/modules/SpringBoot/java/module/system/mpr/DictItemMapper_Oracle.xml b/src/main/resources/modules/SpringBoot/java/module/system/mpr/DictItemMapper_Oracle.xml new file mode 100644 index 00000000..d92fda3e --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/mpr/DictItemMapper_Oracle.xml @@ -0,0 +1,156 @@ + + + + + "SYS_DICT_ITEM" + + + "ID","DICT_NAME","KEY","VALUE","SORT","VALID","ROW_VERSION","IS_DELETED","CREATE_BY","CREATE_TIME","LAST_UPDATE_BY","LAST_UPDATE_TIME" + + + + + + + + + + + + + + + + + + + + + + + INSERT INTO + + ( + + ) + VALUES + ( + ${r"#"}{request.id}, + ${r"#"}{request.dictName,jdbcType=VARCHAR}, + ${r"#"}{request.key,jdbcType=VARCHAR}, + ${r"#"}{request.value,jdbcType=VARCHAR}, + ${r"#"}{request.sort,jdbcType=INTEGER}, + ${r"#"}{request.valid,jdbcType=BIT}, + 0, + 0, + ${r"#"}{token.userId,jdbcType=NUMERIC}, + sysdate, + NULL, + NULL + ) + + + + INSERT INTO + + ( + + ) + VALUES + + ( + ${r"#"}{item.id}, + ${r"#"}{item.dictName,jdbcType=VARCHAR}, + ${r"#"}{item.key,jdbcType=VARCHAR}, + ${r"#"}{item.value,jdbcType=VARCHAR}, + ${r"#"}{item.sort,jdbcType=INTEGER}, + ${r"#"}{item.valid,jdbcType=BIT}, + 0, + 0, + ${r"#"}{token.userId,jdbcType=NUMERIC}, + sysdate, + NULL, + NULL + ) + + + + + UPDATE + + SET "IS_DELETED" = 1 + WHERE "IS_DELETED" = 0 + AND "ID" = ${r"#"}{request.id} + + + + UPDATE + + SET + "DICT_NAME" = ${r"#"}{request.dictName,jdbcType=VARCHAR}, + "KEY" = ${r"#"}{request.key,jdbcType=VARCHAR}, + "VALUE" = ${r"#"}{request.value,jdbcType=VARCHAR}, + "SORT" = ${r"#"}{request.sort,jdbcType=INTEGER}, + "VALID" = ${r"#"}{request.valid,jdbcType=BIT}, + "ROW_VERSION" = "ROW_VERSION" + 1, + "LAST_UPDATE_BY" = ${r"#"}{token.userId}, + "LAST_UPDATE_TIME" = sysdate + WHERE + "IS_DELETED" = 0 + AND "ID" = ${r"#"}{request.id} + AND "ROW_VERSION" = ${r"#"}{request.rowVersion} + + + + + + \ No newline at end of file diff --git a/src/main/resources/modules/SpringBoot/java/module/system/mpr/DictItemMapper_SQLite.xml b/src/main/resources/modules/SpringBoot/java/module/system/mpr/DictItemMapper_SQLite.xml new file mode 100644 index 00000000..f434f1e8 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/mpr/DictItemMapper_SQLite.xml @@ -0,0 +1,164 @@ + + + + + "SYS_DICT_ITEM" + + + "ID","DICT_NAME","KEY","VALUE","SORT","VALID","ROW_VERSION","IS_DELETED","CREATE_BY","CREATE_TIME","LAST_UPDATE_BY","LAST_UPDATE_TIME" + + + + + + + + + + + + + + + + + + + + + + + INSERT INTO + + ( + + ) + VALUES + ( + ${r"#"}{request.id}, + ${r"#"}{request.dictName,jdbcType=VARCHAR}, + ${r"#"}{request.key,jdbcType=VARCHAR}, + ${r"#"}{request.value,jdbcType=VARCHAR}, + ${r"#"}{request.sort,jdbcType=INTEGER}, + ${r"#"}{request.valid,jdbcType=BIT}, + 0, + 0, + ${r"#"}{token.userId,jdbcType=NUMERIC}, + datetime('now','localtime'), + NULL, + NULL + ) + + + + INSERT INTO + + ( + + ) + VALUES + + ( + ${r"#"}{item.id}, + ${r"#"}{item.dictName,jdbcType=VARCHAR}, + ${r"#"}{item.key,jdbcType=VARCHAR}, + ${r"#"}{item.value,jdbcType=VARCHAR}, + ${r"#"}{item.sort,jdbcType=INTEGER}, + ${r"#"}{item.valid,jdbcType=BIT}, + 0, + 0, + ${r"#"}{token.userId,jdbcType=NUMERIC}, + datetime('now','localtime'), + NULL, + NULL + ) + + + + + UPDATE + + + + + UPDATE + + SET + DICT_NAME = ${r"#"}{request.dictName,jdbcType=VARCHAR}, + KEY = ${r"#"}{request.key,jdbcType=VARCHAR}, + VALUE = ${r"#"}{request.value,jdbcType=VARCHAR}, + SORT = ${r"#"}{request.sort,jdbcType=INTEGER}, + VALID = ${r"#"}{request.valid,jdbcType=BIT}, + ROW_VERSION = ROW_VERSION + 1, + LAST_UPDATE_BY = ${r"#"}{token.userId}, + LAST_UPDATE_TIME = datetime('now','localtime') + WHERE + IS_DELETED = 0 + AND ID = ${r"#"}{request.id} + AND ROW_VERSION = ${r"#"}{request.rowVersion} + + + + + + \ No newline at end of file diff --git a/src/main/resources/modules/SpringBoot/java/module/system/mpr/DictMapper.xml b/src/main/resources/modules/SpringBoot/java/module/system/mpr/DictMapper_MySQL.xml similarity index 70% rename from src/main/resources/modules/SpringBoot/java/module/system/mpr/DictMapper.xml rename to src/main/resources/modules/SpringBoot/java/module/system/mpr/DictMapper_MySQL.xml index 63f9a3c6..08a5460b 100644 --- a/src/main/resources/modules/SpringBoot/java/module/system/mpr/DictMapper.xml +++ b/src/main/resources/modules/SpringBoot/java/module/system/mpr/DictMapper_MySQL.xml @@ -31,9 +31,6 @@ WHERE `IS_DELETED` = 0 - - AND `ID` = ${r"#"}{request.id} - AND `DICT_NAME` = ${r"#"}{request.dictName} @@ -65,18 +62,42 @@ ) VALUES ( - ${r"#{"}request.id}, - ${r"#{"}request.dictName,jdbcType=VARCHAR}, - ${r"#{"}request.dictComment,jdbcType=VARCHAR}, - ${r"#{"}request.version,jdbcType=VARCHAR}, - ${r"#{"}request.valid,jdbcType=BIT}, + ${r"#"}{request.id}, + ${r"#"}{request.dictName,jdbcType=VARCHAR}, + ${r"#"}{request.dictComment,jdbcType=VARCHAR}, + ${r"#"}{request.version,jdbcType=VARCHAR}, + ${r"#"}{request.valid,jdbcType=BIT}, + 0, + 0, + ${r"#"}{token.userId,jdbcType=NUMERIC}, + sysdate(), + NULL, + NULL + ) + + + + INSERT INTO + + ( + + ) + VALUES + + ( + ${r"#"}{item.id}, + ${r"#"}{item.dictName,jdbcType=VARCHAR}, + ${r"#"}{item.dictComment,jdbcType=VARCHAR}, + ${r"#"}{item.version,jdbcType=VARCHAR}, + ${r"#"}{item.valid,jdbcType=BIT}, 0, 0, - ${r"#{"}token.userId,jdbcType=NUMERIC}, + ${r"#"}{token.userId,jdbcType=NUMERIC}, sysdate(), NULL, NULL ) + @@ -84,24 +105,24 @@ SET `IS_DELETED` = 1 WHERE `IS_DELETED` = 0 - AND `ID` = ${r"#{"}request.id} + AND `ID` = ${r"#"}{request.id} UPDATE SET - `DICT_NAME` = ${r"#{"}request.dictName,jdbcType=VARCHAR}, - `DICT_COMMENT` = ${r"#{"}request.dictComment,jdbcType=VARCHAR}, - `VERSION` = ${r"#{"}request.version,jdbcType=VARCHAR}, - `VALID` = ${r"#{"}request.valid,jdbcType=BIT}, + `DICT_NAME` = ${r"#"}{request.dictName,jdbcType=VARCHAR}, + `DICT_COMMENT` = ${r"#"}{request.dictComment,jdbcType=VARCHAR}, + `VERSION` = ${r"#"}{request.version,jdbcType=VARCHAR}, + `VALID` = ${r"#"}{request.valid,jdbcType=BIT}, `ROW_VERSION` = `ROW_VERSION` + 1, - `LAST_UPDATE_BY` = ${r"#{"}token.userId}, + `LAST_UPDATE_BY` = ${r"#"}{token.userId}, `LAST_UPDATE_TIME` = sysdate() WHERE `IS_DELETED` = 0 - AND `ID` = ${r"#{"}request.id} - AND `ROW_VERSION` = ${r"#{"}request.rowVersion} + AND `ID` = ${r"#"}{request.id} + AND `ROW_VERSION` = ${r"#"}{request.rowVersion} \ No newline at end of file diff --git a/src/main/resources/modules/SpringBoot/java/module/system/mpr/DictMapper_Oracle.xml b/src/main/resources/modules/SpringBoot/java/module/system/mpr/DictMapper_Oracle.xml new file mode 100644 index 00000000..27814111 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/mpr/DictMapper_Oracle.xml @@ -0,0 +1,146 @@ + + + + + "SYS_DICT" + + + "ID","DICT_NAME","DICT_COMMENT","VERSION","VALID","ROW_VERSION","IS_DELETED","CREATE_BY","CREATE_TIME","LAST_UPDATE_BY","LAST_UPDATE_TIME" + + + + + + + + + + + + + + + + + + + + + + INSERT INTO + + ( + + ) + VALUES + ( + ${r"#"}{request.id}, + ${r"#"}{request.dictName,jdbcType=VARCHAR}, + ${r"#"}{request.dictComment,jdbcType=VARCHAR}, + ${r"#"}{request.version,jdbcType=VARCHAR}, + ${r"#"}{request.valid,jdbcType=BIT}, + 0, + 0, + ${r"#"}{token.userId,jdbcType=NUMERIC}, + sysdate, + NULL, + NULL + ) + + + + INSERT INTO + + ( + + ) + VALUES + + ( + ${r"#"}{item.id}, + ${r"#"}{item.dictName,jdbcType=VARCHAR}, + ${r"#"}{item.dictComment,jdbcType=VARCHAR}, + ${r"#"}{item.version,jdbcType=VARCHAR}, + ${r"#"}{item.valid,jdbcType=BIT}, + 0, + 0, + ${r"#"}{token.userId,jdbcType=NUMERIC}, + sysdate, + NULL, + NULL + ) + + + + + UPDATE + + SET "IS_DELETED" = 1 + WHERE "IS_DELETED" = 0 + AND "ID" = ${r"#"}{request.id} + + + + UPDATE + + SET + "DICT_NAME" = ${r"#"}{request.dictName,jdbcType=VARCHAR}, + "DICT_COMMENT" = ${r"#"}{request.dictComment,jdbcType=VARCHAR}, + "VERSION" = ${r"#"}{request.version,jdbcType=VARCHAR}, + "VALID" = ${r"#"}{request.valid,jdbcType=BIT}, + "ROW_VERSION" = "ROW_VERSION" + 1, + "LAST_UPDATE_BY" = ${r"#"}{token.userId}, + "LAST_UPDATE_TIME" = sysdate + WHERE + "IS_DELETED" = 0 + AND "ID" = ${r"#"}{request.id} + AND "ROW_VERSION" = ${r"#"}{request.rowVersion} + + + + + + \ No newline at end of file diff --git a/src/main/resources/modules/SpringBoot/java/module/system/mpr/DictMapper_SQLite.xml b/src/main/resources/modules/SpringBoot/java/module/system/mpr/DictMapper_SQLite.xml new file mode 100644 index 00000000..fc09fbbb --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/mpr/DictMapper_SQLite.xml @@ -0,0 +1,153 @@ + + + + + "SYS_DICT" + + + "ID","DICT_NAME","DICT_COMMENT","VERSION","VALID","ROW_VERSION","IS_DELETED","CREATE_BY","CREATE_TIME","LAST_UPDATE_BY","LAST_UPDATE_TIME" + + + + + + + + + + + + + + + + + + + + + + INSERT INTO + + ( + + ) + VALUES + ( + ${r"#"}{request.id}, + ${r"#"}{request.dictName,jdbcType=VARCHAR}, + ${r"#"}{request.dictComment,jdbcType=VARCHAR}, + ${r"#"}{request.version,jdbcType=VARCHAR}, + ${r"#"}{request.valid,jdbcType=BIT}, + 0, + 0, + ${r"#"}{token.userId,jdbcType=NUMERIC}, + datetime('now','localtime'), + NULL, + NULL + ) + + + + INSERT INTO + + ( + + ) + VALUES + + ( + ${r"#"}{item.id}, + ${r"#"}{item.dictName,jdbcType=VARCHAR}, + ${r"#"}{item.dictComment,jdbcType=VARCHAR}, + ${r"#"}{item.version,jdbcType=VARCHAR}, + ${r"#"}{item.valid,jdbcType=BIT}, + 0, + 0, + ${r"#"}{token.userId,jdbcType=NUMERIC}, + datetime('now','localtime'), + NULL, + NULL + ) + + + + + UPDATE + + + + + UPDATE + + SET + DICT_NAME = ${r"#"}{request.dictName,jdbcType=VARCHAR}, + DICT_COMMENT = ${r"#"}{request.dictComment,jdbcType=VARCHAR}, + VERSION = ${r"#"}{request.version,jdbcType=VARCHAR}, + VALID = ${r"#"}{request.valid,jdbcType=BIT}, + ROW_VERSION = ROW_VERSION + 1, + LAST_UPDATE_BY = ${r"#"}{token.userId}, + LAST_UPDATE_TIME = datetime('now','localtime') + WHERE + IS_DELETED = 0 + AND ID = ${r"#"}{request.id} + AND ROW_VERSION = ${r"#"}{request.rowVersion} + + + + + + \ No newline at end of file diff --git a/src/main/resources/modules/SpringBoot/java/module/system/mpr/FileMapper.xml b/src/main/resources/modules/SpringBoot/java/module/system/mpr/FileMapper_MySQL.xml similarity index 99% rename from src/main/resources/modules/SpringBoot/java/module/system/mpr/FileMapper.xml rename to src/main/resources/modules/SpringBoot/java/module/system/mpr/FileMapper_MySQL.xml index 8a7c0584..26793cdc 100644 --- a/src/main/resources/modules/SpringBoot/java/module/system/mpr/FileMapper.xml +++ b/src/main/resources/modules/SpringBoot/java/module/system/mpr/FileMapper_MySQL.xml @@ -4,7 +4,7 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - `SYSFILE` + `SYS_FILE` `ID`,`NAME`,`FILE_TYPE`,`ATTRIBUTE1`,`ATTRIBUTE2`,`LOCATION`,`URL`,`URL_DOWNLOAD`,`ROW_VERSION`,`IS_DELETED`,`CREATE_BY`,`CREATE_TIME`,`LAST_UPDATE_BY`,`LAST_UPDATE_TIME` diff --git a/src/main/resources/modules/SpringBoot/java/module/system/mpr/FileMapper_Oracle.xml b/src/main/resources/modules/SpringBoot/java/module/system/mpr/FileMapper_Oracle.xml new file mode 100644 index 00000000..69bbce61 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/mpr/FileMapper_Oracle.xml @@ -0,0 +1,161 @@ + + + + + "SYS_FILE" + + + "ID","NAME","FILE_TYPE","ATTRIBUTE1","ATTRIBUTE2","LOCATION","URL","URL_DOWNLOAD","ROW_VERSION","IS_DELETED","CREATE_BY","CREATE_TIME","LAST_UPDATE_BY","LAST_UPDATE_TIME" + + + + + + + + + + + + + + + + + + + + + + + + + INSERT INTO + + ( + + ) + VALUES + ( + ${r"#"}{request.id}, + ${r"#"}{request.name,jdbcType=VARCHAR}, + ${r"#"}{request.fileType,jdbcType=VARCHAR}, + ${r"#"}{request.attribute1,jdbcType=VARCHAR}, + ${r"#"}{request.attribute2,jdbcType=VARCHAR}, + ${r"#"}{request.location,jdbcType=VARCHAR}, + ${r"#"}{request.url,jdbcType=VARCHAR}, + ${r"#"}{request.urlDownload,jdbcType=VARCHAR}, + 0, + 0, + ${r"#"}{token.userId,jdbcType=NUMERIC}, + sysdate, + NULL, + NULL + ) + + + + INSERT INTO + + ( + + ) + VALUES + + ( + ${r"#"}{item.id}, + ${r"#"}{item.name,jdbcType=VARCHAR}, + ${r"#"}{item.fileType,jdbcType=VARCHAR}, + ${r"#"}{item.attribute1,jdbcType=VARCHAR}, + ${r"#"}{item.attribute2,jdbcType=VARCHAR}, + ${r"#"}{item.location,jdbcType=VARCHAR}, + ${r"#"}{item.url,jdbcType=VARCHAR}, + ${r"#"}{item.urlDownload,jdbcType=VARCHAR}, + 0, + 0, + ${r"#"}{token.userId,jdbcType=NUMERIC}, + sysdate, + NULL, + NULL + ) + + + + + UPDATE + + SET "IS_DELETED" = 1 + WHERE "IS_DELETED" = 0 + AND "ID" = ${r"#"}{request.id} + + + + UPDATE + + SET + "NAME" = ${r"#"}{request.name,jdbcType=VARCHAR}, + "FILE_TYPE" = ${r"#"}{request.fileType,jdbcType=VARCHAR}, + "ATTRIBUTE1" = ${r"#"}{request.attribute1,jdbcType=VARCHAR}, + "ATTRIBUTE2" = ${r"#"}{request.attribute2,jdbcType=VARCHAR}, + "LOCATION" = ${r"#"}{request.location,jdbcType=VARCHAR}, + "URL" = ${r"#"}{request.url,jdbcType=VARCHAR}, + "URL_DOWNLOAD" = ${r"#"}{request.urlDownload,jdbcType=VARCHAR}, + "ROW_VERSION" = "ROW_VERSION" + 1, + "LAST_UPDATE_BY" = ${r"#"}{token.userId}, + "LAST_UPDATE_TIME" = sysdate + WHERE + "IS_DELETED" = 0 + AND "ID" = ${r"#"}{request.id} + AND "ROW_VERSION" = ${r"#"}{request.rowVersion} + + + + + + \ No newline at end of file diff --git a/src/main/resources/modules/SpringBoot/java/module/system/mpr/FileMapper_SQLite.xml b/src/main/resources/modules/SpringBoot/java/module/system/mpr/FileMapper_SQLite.xml new file mode 100644 index 00000000..a1ab4ead --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/mpr/FileMapper_SQLite.xml @@ -0,0 +1,171 @@ + + + + + "SYS_FILE" + + + "ID","NAME","FILE_TYPE","ATTRIBUTE1","ATTRIBUTE2","LOCATION","URL","URL_DOWNLOAD","ROW_VERSION","IS_DELETED","CREATE_BY","CREATE_TIME","LAST_UPDATE_BY","LAST_UPDATE_TIME" + + + + + + + + + + + + + + + + + + + + + + + + + INSERT INTO + + ( + + ) + VALUES + ( + ${r"#"}{request.id}, + ${r"#"}{request.name,jdbcType=VARCHAR}, + ${r"#"}{request.fileType,jdbcType=VARCHAR}, + ${r"#"}{request.attribute1,jdbcType=VARCHAR}, + ${r"#"}{request.attribute2,jdbcType=VARCHAR}, + ${r"#"}{request.location,jdbcType=VARCHAR}, + ${r"#"}{request.url,jdbcType=VARCHAR}, + ${r"#"}{request.urlDownload,jdbcType=VARCHAR}, + 0, + 0, + ${r"#"}{token.userId,jdbcType=NUMERIC}, + datetime('now','localtime'), + NULL, + NULL + ) + + + + INSERT INTO + + ( + + ) + VALUES + + ( + ${r"#"}{item.id}, + ${r"#"}{item.name,jdbcType=VARCHAR}, + ${r"#"}{item.fileType,jdbcType=VARCHAR}, + ${r"#"}{item.attribute1,jdbcType=VARCHAR}, + ${r"#"}{item.attribute2,jdbcType=VARCHAR}, + ${r"#"}{item.location,jdbcType=VARCHAR}, + ${r"#"}{item.url,jdbcType=VARCHAR}, + ${r"#"}{item.urlDownload,jdbcType=VARCHAR}, + 0, + 0, + ${r"#"}{token.userId,jdbcType=NUMERIC}, + datetime('now','localtime'), + NULL, + NULL + ) + + + + + UPDATE + + + + + UPDATE + + SET + NAME = ${r"#"}{request.name,jdbcType=VARCHAR}, + FILE_TYPE = ${r"#"}{request.fileType,jdbcType=VARCHAR}, + ATTRIBUTE1 = ${r"#"}{request.attribute1,jdbcType=VARCHAR}, + ATTRIBUTE2 = ${r"#"}{request.attribute2,jdbcType=VARCHAR}, + LOCATION = ${r"#"}{request.location,jdbcType=VARCHAR}, + URL = ${r"#"}{request.url,jdbcType=VARCHAR}, + URL_DOWNLOAD = ${r"#"}{request.urlDownload,jdbcType=VARCHAR}, + ROW_VERSION = ROW_VERSION + 1, + LAST_UPDATE_BY = ${r"#"}{token.userId}, + LAST_UPDATE_TIME = datetime('now','localtime') + WHERE + IS_DELETED = 0 + AND ID = ${r"#"}{request.id} + AND ROW_VERSION = ${r"#"}{request.rowVersion} + + + + + + \ No newline at end of file diff --git a/src/main/resources/modules/SpringBoot/resources/application-dev.ftl b/src/main/resources/modules/SpringBoot/resources/application-dev.ftl index 34a79d24..2bc0f8d4 100644 --- a/src/main/resources/modules/SpringBoot/resources/application-dev.ftl +++ b/src/main/resources/modules/SpringBoot/resources/application-dev.ftl @@ -40,7 +40,7 @@ mybatis.configuration.map-underscore-to-camel-case=true <#if dataBase == 'SQLite'> # SQLite spring.datasource.url=jdbc:sqlite::resource:example.db spring.datasource.driver-class-name=org.sqlite.JDBC -spring.datasource.url=jdbc:sqlite:${projectName?default("SpringBoot")}.db +spring.datasource.url=jdbc:sqlite:${projectName?default("SpringBoot")}.db?date_string_format=yyyy-MM-dd HH:mm:ss spring.datasource.username=test spring.datasource.password=123456 # mybatis diff --git a/src/main/resources/modules/SpringBoot/resources/application-prod.ftl b/src/main/resources/modules/SpringBoot/resources/application-prod.ftl index 0f2b346e..f02ae799 100644 --- a/src/main/resources/modules/SpringBoot/resources/application-prod.ftl +++ b/src/main/resources/modules/SpringBoot/resources/application-prod.ftl @@ -40,7 +40,7 @@ mybatis.configuration.map-underscore-to-camel-case=true <#if dataBase == 'SQLite'> # SQLite spring.datasource.url=jdbc:sqlite::resource:example.db spring.datasource.driver-class-name=org.sqlite.JDBC -spring.datasource.url=jdbc:sqlite:${projectName?default("SpringBoot")}.db +spring.datasource.url=jdbc:sqlite:${projectName?default("SpringBoot")}.db?date_string_format=yyyy-MM-dd HH:mm:ss spring.datasource.username=test spring.datasource.password=123456 # mybatis diff --git a/src/main/resources/modules/SpringBoot/resources/dbtool/system/ALL_TABLE.sql b/src/main/resources/modules/SpringBoot/resources/dbtool/system/ALL_TABLE.sql deleted file mode 100644 index 64d0b15d..00000000 --- a/src/main/resources/modules/SpringBoot/resources/dbtool/system/ALL_TABLE.sql +++ /dev/null @@ -1,238 +0,0 @@ -<#if dataBase == 'MySQL'> --- ---------------------------- --- Table structure for DICT - 字典 --- Target : MySQL --- Author : wangbing --- Date: : 2019-12-16 --- ---------------------------- -CREATE TABLE `SYS_DICT` ( - `ID` BIGINT(20) NOT NULL COMMENT '主键', - `DICT_NAME` VARCHAR(50) NOT NULL COMMENT '字典名称', - `DICT_COMMENT` VARCHAR(50) NOT NULL COMMENT '字典描述', - `VERSION` VARCHAR(50) NOT NULL COMMENT '字典版本', - `VALID` TINYINT(1) NOT NULL COMMENT '是否有效', - `ROW_VERSION` BIGINT(20) NOT NULL DEFAULT 0 COMMENT '行版本', - `IS_DELETED` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '是否已删除', - `CREATE_BY` BIGINT(20) NOT NULL COMMENT '创建用户', - `CREATE_TIME` DATETIME NOT NULL COMMENT '创建时间', - `LAST_UPDATE_BY` BIGINT(20) DEFAULT NULL COMMENT '最后更新用户', - `LAST_UPDATE_TIME` DATETIME DEFAULT NULL COMMENT '最后更新时间', -PRIMARY KEY (`ID`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='字典'; - --- ---------------------------- --- Table structure for DICT_ITEM - 字典项 --- Target : MySQL --- Author : wangbing --- Date: : 2019-12-16 --- ---------------------------- -CREATE TABLE `SYS_DICT_ITEM` ( - `ID` BIGINT(20) NOT NULL COMMENT '主键', - `DICT_NAME` BIGINT(20) NOT NULL COMMENT '字典名称', - `KEY` CHAR(10) NOT NULL COMMENT '字典键', - `VALUE` VARCHAR(100) NOT NULL COMMENT '字典值', - `SORT` INTEGER(10) NOT NULL COMMENT '排序', - `VALID` TINYINT(1) NOT NULL COMMENT '是否有效', - `ROW_VERSION` BIGINT(20) NOT NULL DEFAULT 0 COMMENT '行版本', - `IS_DELETED` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '是否已删除', - `CREATE_BY` BIGINT(20) NOT NULL COMMENT '创建用户', - `CREATE_TIME` DATETIME NOT NULL COMMENT '创建时间', - `LAST_UPDATE_BY` BIGINT(20) DEFAULT NULL COMMENT '最后更新用户', - `LAST_UPDATE_TIME` DATETIME DEFAULT NULL COMMENT '最后更新时间', -PRIMARY KEY (`ID`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='字典项'; - --- ---------------------------- --- Table structure for FILE - 文件 --- Target : MySQL --- Author : wangbing --- Date: : 2019-12-16 --- ---------------------------- -CREATE TABLE `SYS_FILE` ( - `ID` BIGINT(20) NOT NULL COMMENT '主键', - `NAME` VARCHAR(250) COMMENT '文件名称', - `FILE_TYPE` VARCHAR(10) COMMENT '文件类型', - `ATTRIBUTE1` VARCHAR(50) COMMENT '扩展属性1', - `ATTRIBUTE2` VARCHAR(50) COMMENT '扩展属性2', - `LOCATION` VARCHAR(500) COMMENT '存放地址', - `URL` VARCHAR(500) COMMENT '访问地址', - `URL_DOWNLOAD` VARCHAR(500) COMMENT '下载地址', - `ROW_VERSION` BIGINT(20) NOT NULL DEFAULT 0 COMMENT '行版本', - `IS_DELETED` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '是否已删除', - `CREATE_BY` BIGINT(20) NOT NULL COMMENT '创建用户', - `CREATE_TIME` DATETIME NOT NULL COMMENT '创建时间', - `LAST_UPDATE_BY` BIGINT(20) DEFAULT NULL COMMENT '最后更新用户', - `LAST_UPDATE_TIME` DATETIME DEFAULT NULL COMMENT '最后更新时间', -PRIMARY KEY (`ID`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='文件'; - -<#if dataBase == 'Oracle'> --- ---------------------------- --- Table structure for DICT - 字典 --- Target : Oracle --- Author : wangbing --- Date: : 2019-12-16 --- ---------------------------- -CREATE TABLE "SYS_DICT" ( -"ID" NUMBER(19) NOT NULL, -"DICT_NAME" VARCHAR2(50) NULL, -"DICT_COMMENT" VARCHAR2(50) NULL, -"VERSION" VARCHAR2(50) NULL, -"VALID" CHAR(1) NULL, -"ROW_VERSION" NUMBER(19) NOT NULL, -"IS_DELETED" CHAR(1) NOT NULL, -"CREATE_BY" NUMBER(19) NOT NULL, -"CREATE_TIME" DATE NOT NULL, -"LAST_UPDATE_BY" NUMBER(19) NULL, -"LAST_UPDATE_TIME" DATE NULL -); -COMMENT ON TABLE "SYS_DICT" is '字典'; -COMMENT ON COLUMN "SYS_DICT"."ID" is '主键'; -COMMENT ON COLUMN "SYS_DICT"."DICT_NAME" is '字典名称'; -COMMENT ON COLUMN "SYS_DICT"."DICT_COMMENT" is '字典描述'; -COMMENT ON COLUMN "SYS_DICT"."VERSION" is '字典版本'; -COMMENT ON COLUMN "SYS_DICT"."VALID" is '是否有效'; -COMMENT ON COLUMN "SYS_DICT"."ROW_VERSION" is '行版本'; -COMMENT ON COLUMN "SYS_DICT"."IS_DELETED" is '是否已删除'; -COMMENT ON COLUMN "SYS_DICT"."CREATE_BY" is '创建用户'; -COMMENT ON COLUMN "SYS_DICT"."CREATE_TIME" is '创建时间'; -COMMENT ON COLUMN "SYS_DICT"."LAST_UPDATE_BY" is '最后更新用户'; -COMMENT ON COLUMN "SYS_DICT"."LAST_UPDATE_TIME" is '最后更新时间'; - --- ---------------------------- --- Table structure for DICT_ITEM - 字典项 --- Target : Oracle --- Author : wangbing --- Date: : 2019-12-16 --- ---------------------------- -CREATE TABLE "SYS_DICT_ITEM" ( -"ID" NUMBER(19) NOT NULL, -"DICT_NAME" NUMBER(19) NULL, -"KEY" CHAR(10) NULL, -"VALUE" VARCHAR2(100) NULL, -"SORT" NUMBER(10) NULL, -"VALID" CHAR(1) NULL, -"ROW_VERSION" NUMBER(19) NOT NULL, -"IS_DELETED" CHAR(1) NOT NULL, -"CREATE_BY" NUMBER(19) NOT NULL, -"CREATE_TIME" DATE NOT NULL, -"LAST_UPDATE_BY" NUMBER(19) NULL, -"LAST_UPDATE_TIME" DATE NULL -); -COMMENT ON TABLE "SYS_DICT_ITEM" is '字典项'; -COMMENT ON COLUMN "SYS_DICT_ITEM"."ID" is '主键'; -COMMENT ON COLUMN "SYS_DICT_ITEM"."DICT_NAME" is '字典名称'; -COMMENT ON COLUMN "SYS_DICT_ITEM"."KEY" is '字典键'; -COMMENT ON COLUMN "SYS_DICT_ITEM"."VALUE" is '字典值'; -COMMENT ON COLUMN "SYS_DICT_ITEM"."SORT" is '排序'; -COMMENT ON COLUMN "SYS_DICT_ITEM"."VALID" is '是否有效'; -COMMENT ON COLUMN "SYS_DICT_ITEM"."ROW_VERSION" is '行版本'; -COMMENT ON COLUMN "SYS_DICT_ITEM"."IS_DELETED" is '是否已删除'; -COMMENT ON COLUMN "SYS_DICT_ITEM"."CREATE_BY" is '创建用户'; -COMMENT ON COLUMN "SYS_DICT_ITEM"."CREATE_TIME" is '创建时间'; -COMMENT ON COLUMN "SYS_DICT_ITEM"."LAST_UPDATE_BY" is '最后更新用户'; -COMMENT ON COLUMN "SYS_DICT_ITEM"."LAST_UPDATE_TIME" is '最后更新时间'; - --- ---------------------------- --- Table structure for FILE - 文件 --- Target : Oracle --- Author : wangbing --- Date: : 2019-12-16 --- ---------------------------- -CREATE TABLE "SYS_FILE" ( -"ID" NUMBER(19) NOT NULL, -"NAME" VARCHAR2(250) NULL, -"FILE_TYPE" VARCHAR(10) NULL, -"ATTRIBUTE1" VARCHAR2(50) NULL, -"ATTRIBUTE2" VARCHAR2(50) NULL, -"LOCATION" VARCHAR2(500) NULL, -"URL" VARCHAR2(500) NULL, -"URL_DOWNLOAD" VARCHAR2(500) NULL, -"ROW_VERSION" NUMBER(19) NOT NULL, -"IS_DELETED" CHAR(1) NOT NULL, -"CREATE_BY" NUMBER(19) NOT NULL, -"CREATE_TIME" DATE NOT NULL, -"LAST_UPDATE_BY" NUMBER(19) NULL, -"LAST_UPDATE_TIME" DATE NULL -); -COMMENT ON TABLE "SYS_FILE" is '文件'; -COMMENT ON COLUMN "SYS_FILE"."ID" is '主键'; -COMMENT ON COLUMN "SYS_FILE"."NAME" is '文件名称'; -COMMENT ON COLUMN "SYS_FILE"."FILE_TYPE" is '文件类型'; -COMMENT ON COLUMN "SYS_FILE"."ATTRIBUTE1" is '扩展属性1'; -COMMENT ON COLUMN "SYS_FILE"."ATTRIBUTE2" is '扩展属性2'; -COMMENT ON COLUMN "SYS_FILE"."LOCATION" is '存放地址'; -COMMENT ON COLUMN "SYS_FILE"."URL" is '访问地址'; -COMMENT ON COLUMN "SYS_FILE"."URL_DOWNLOAD" is '下载地址'; -COMMENT ON COLUMN "SYS_FILE"."ROW_VERSION" is '行版本'; -COMMENT ON COLUMN "SYS_FILE"."IS_DELETED" is '是否已删除'; -COMMENT ON COLUMN "SYS_FILE"."CREATE_BY" is '创建用户'; -COMMENT ON COLUMN "SYS_FILE"."CREATE_TIME" is '创建时间'; -COMMENT ON COLUMN "SYS_FILE"."LAST_UPDATE_BY" is '最后更新用户'; -COMMENT ON COLUMN "SYS_FILE"."LAST_UPDATE_TIME" is '最后更新时间'; - -<#if dataBase == 'SQLite'> --- ---------------------------- --- Table structure for DICT - 字典 --- Target : SQLite --- Author : wangbing --- Date: : 2019-12-16 --- ---------------------------- -CREATE TABLE IF NOT EXISTS "SYS_DICT" ( - "ID" BIGINT PRIMARY KEY NOT NULL, - "DICT_NAME" VARCHAR(50) NOT NULL, - "DICT_COMMENT" VARCHAR(50) NOT NULL, - "VERSION" VARCHAR(50) NOT NULL, - "VALID" BOOLEAN NOT NULL, - "ROW_VERSION" BIGINT NOT NULL, - "IS_DELETED" BOOLEAN NOT NULL, - "CREATE_BY" BIGINT NOT NULL, - "CREATE_TIME" DATETIME NOT NULL, - "LAST_UPDATE_BY" BIGINT, - "LAST_UPDATE_TIME" DATETIME -); - --- ---------------------------- --- Table structure for DICT_ITEM - 字典项 --- Target : SQLite --- Author : wangbing --- Date: : 2019-12-16 --- ---------------------------- -CREATE TABLE IF NOT EXISTS "SYS_DICT_ITEM" ( - "ID" BIGINT PRIMARY KEY NOT NULL, - "DICT_NAME" BIGINT NOT NULL, - "KEY" CHAR(10) NOT NULL, - "VALUE" VARCHAR(100) NOT NULL, - "SORT" MEDIUMINT NOT NULL, - "VALID" BOOLEAN NOT NULL, - "ROW_VERSION" BIGINT NOT NULL, - "IS_DELETED" BOOLEAN NOT NULL, - "CREATE_BY" BIGINT NOT NULL, - "CREATE_TIME" DATETIME NOT NULL, - "LAST_UPDATE_BY" BIGINT, - "LAST_UPDATE_TIME" DATETIME -); - --- ---------------------------- --- Table structure for FILE - 文件 --- Target : SQLite --- Author : wangbing --- Date: : 2019-12-16 --- ---------------------------- -CREATE TABLE IF NOT EXISTS "SYS_FILE" ( - "ID" BIGINT PRIMARY KEY NOT NULL, - "NAME" VARCHAR(250), - "FILE_TYPE" VARCHAR(10), - "ATTRIBUTE1" VARCHAR(50), - "ATTRIBUTE2" VARCHAR(50), - "LOCATION" VARCHAR(500), - "URL" VARCHAR(500), - "URL_DOWNLOAD" VARCHAR(500), - "ROW_VERSION" BIGINT NOT NULL, - "IS_DELETED" BOOLEAN NOT NULL, - "CREATE_BY" BIGINT NOT NULL, - "CREATE_TIME" DATETIME NOT NULL, - "LAST_UPDATE_BY" BIGINT, - "LAST_UPDATE_TIME" DATETIME -); - \ No newline at end of file diff --git a/src/main/resources/modules/SpringBoot/resources/dbtool/system/ALL_TABLE_MySQL.sql b/src/main/resources/modules/SpringBoot/resources/dbtool/system/ALL_TABLE_MySQL.sql new file mode 100644 index 00000000..d2d69960 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/resources/dbtool/system/ALL_TABLE_MySQL.sql @@ -0,0 +1,67 @@ +-- ---------------------------- +-- Table structure for DICT - 字典 +-- Target : MySQL +-- Author : wangbing +-- Date: : 2019-12-17 +-- ---------------------------- +CREATE TABLE `SYS_DICT` ( + `ID` BIGINT(20) NOT NULL COMMENT '主键', + `DICT_NAME` VARCHAR(50) NOT NULL COMMENT '字典名称', + `DICT_COMMENT` VARCHAR(50) NOT NULL COMMENT '字典描述', + `VERSION` VARCHAR(50) NOT NULL COMMENT '字典版本', + `VALID` TINYINT(1) NOT NULL COMMENT '是否有效', + `ROW_VERSION` BIGINT(20) NOT NULL DEFAULT 0 COMMENT '行版本', + `IS_DELETED` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '是否已删除', + `CREATE_BY` BIGINT(20) NOT NULL COMMENT '创建用户', + `CREATE_TIME` INTEGER NOT NULL COMMENT '创建时间', + `LAST_UPDATE_BY` BIGINT(20) DEFAULT NULL COMMENT '最后更新用户', + `LAST_UPDATE_TIME` INTEGER DEFAULT NULL COMMENT '最后更新时间', +PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='字典'; + +-- ---------------------------- +-- Table structure for DICT_ITEM - 字典项 +-- Target : MySQL +-- Author : wangbing +-- Date: : 2019-12-17 +-- ---------------------------- +CREATE TABLE `SYS_DICT_ITEM` ( + `ID` BIGINT(20) NOT NULL COMMENT '主键', + `DICT_NAME` VARCHAR(50) NOT NULL COMMENT '字典名称', + `KEY` VARCHAR(20) NOT NULL COMMENT '字典键', + `VALUE` VARCHAR(100) NOT NULL COMMENT '字典值', + `SORT` INTEGER(10) NOT NULL COMMENT '排序', + `VALID` TINYINT(1) NOT NULL COMMENT '是否有效', + `ROW_VERSION` BIGINT(20) NOT NULL DEFAULT 0 COMMENT '行版本', + `IS_DELETED` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '是否已删除', + `CREATE_BY` BIGINT(20) NOT NULL COMMENT '创建用户', + `CREATE_TIME` INTEGER NOT NULL COMMENT '创建时间', + `LAST_UPDATE_BY` BIGINT(20) DEFAULT NULL COMMENT '最后更新用户', + `LAST_UPDATE_TIME` INTEGER DEFAULT NULL COMMENT '最后更新时间', +PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='字典项'; + +-- ---------------------------- +-- Table structure for FILE - 文件 +-- Target : MySQL +-- Author : wangbing +-- Date: : 2019-12-17 +-- ---------------------------- +CREATE TABLE `SYS_FILE` ( + `ID` BIGINT(20) NOT NULL COMMENT '主键', + `NAME` VARCHAR(250) COMMENT '文件名称', + `FILE_TYPE` VARCHAR(10) COMMENT '文件类型', + `ATTRIBUTE1` VARCHAR(50) COMMENT '扩展属性1', + `ATTRIBUTE2` VARCHAR(50) COMMENT '扩展属性2', + `LOCATION` VARCHAR(500) COMMENT '存放地址', + `URL` VARCHAR(500) COMMENT '访问地址', + `URL_DOWNLOAD` VARCHAR(500) COMMENT '下载地址', + `ROW_VERSION` BIGINT(20) NOT NULL DEFAULT 0 COMMENT '行版本', + `IS_DELETED` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '是否已删除', + `CREATE_BY` BIGINT(20) NOT NULL COMMENT '创建用户', + `CREATE_TIME` INTEGER NOT NULL COMMENT '创建时间', + `LAST_UPDATE_BY` BIGINT(20) DEFAULT NULL COMMENT '最后更新用户', + `LAST_UPDATE_TIME` INTEGER DEFAULT NULL COMMENT '最后更新时间', +PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='文件'; + diff --git a/src/main/resources/modules/SpringBoot/resources/dbtool/system/ALL_TABLE_Oracle.sql b/src/main/resources/modules/SpringBoot/resources/dbtool/system/ALL_TABLE_Oracle.sql new file mode 100644 index 00000000..483922c1 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/resources/dbtool/system/ALL_TABLE_Oracle.sql @@ -0,0 +1,104 @@ +-- ---------------------------- +-- Table structure for DICT - 字典 +-- Target : Oracle +-- Author : wangbing +-- Date: : 2019-12-17 +-- ---------------------------- +CREATE TABLE "SYS_DICT" ( +"ID" NUMBER(19) NOT NULL, +"DICT_NAME" VARCHAR2(50) NULL, +"DICT_COMMENT" VARCHAR2(50) NULL, +"VERSION" VARCHAR2(50) NULL, +"VALID" CHAR(1) NULL, +"ROW_VERSION" NUMBER(19) NOT NULL, +"IS_DELETED" CHAR(1) NOT NULL, +"CREATE_BY" NUMBER(19) NOT NULL, +"CREATE_TIME" DATE NOT NULL, +"LAST_UPDATE_BY" NUMBER(19) NULL, +"LAST_UPDATE_TIME" DATE NULL +); +COMMENT ON TABLE "SYS_DICT" is '字典'; +COMMENT ON COLUMN "SYS_DICT"."ID" is '主键'; +COMMENT ON COLUMN "SYS_DICT"."DICT_NAME" is '字典名称'; +COMMENT ON COLUMN "SYS_DICT"."DICT_COMMENT" is '字典描述'; +COMMENT ON COLUMN "SYS_DICT"."VERSION" is '字典版本'; +COMMENT ON COLUMN "SYS_DICT"."VALID" is '是否有效'; +COMMENT ON COLUMN "SYS_DICT"."ROW_VERSION" is '行版本'; +COMMENT ON COLUMN "SYS_DICT"."IS_DELETED" is '是否已删除'; +COMMENT ON COLUMN "SYS_DICT"."CREATE_BY" is '创建用户'; +COMMENT ON COLUMN "SYS_DICT"."CREATE_TIME" is '创建时间'; +COMMENT ON COLUMN "SYS_DICT"."LAST_UPDATE_BY" is '最后更新用户'; +COMMENT ON COLUMN "SYS_DICT"."LAST_UPDATE_TIME" is '最后更新时间'; + +-- ---------------------------- +-- Table structure for DICT_ITEM - 字典项 +-- Target : Oracle +-- Author : wangbing +-- Date: : 2019-12-17 +-- ---------------------------- +CREATE TABLE "SYS_DICT_ITEM" ( +"ID" NUMBER(19) NOT NULL, +"DICT_NAME" VARCHAR2(50) NULL, +"KEY" VARCHAR2(20) NULL, +"VALUE" VARCHAR2(100) NULL, +"SORT" NUMBER(10) NULL, +"VALID" CHAR(1) NULL, +"ROW_VERSION" NUMBER(19) NOT NULL, +"IS_DELETED" CHAR(1) NOT NULL, +"CREATE_BY" NUMBER(19) NOT NULL, +"CREATE_TIME" DATE NOT NULL, +"LAST_UPDATE_BY" NUMBER(19) NULL, +"LAST_UPDATE_TIME" DATE NULL +); +COMMENT ON TABLE "SYS_DICT_ITEM" is '字典项'; +COMMENT ON COLUMN "SYS_DICT_ITEM"."ID" is '主键'; +COMMENT ON COLUMN "SYS_DICT_ITEM"."DICT_NAME" is '字典名称'; +COMMENT ON COLUMN "SYS_DICT_ITEM"."KEY" is '字典键'; +COMMENT ON COLUMN "SYS_DICT_ITEM"."VALUE" is '字典值'; +COMMENT ON COLUMN "SYS_DICT_ITEM"."SORT" is '排序'; +COMMENT ON COLUMN "SYS_DICT_ITEM"."VALID" is '是否有效'; +COMMENT ON COLUMN "SYS_DICT_ITEM"."ROW_VERSION" is '行版本'; +COMMENT ON COLUMN "SYS_DICT_ITEM"."IS_DELETED" is '是否已删除'; +COMMENT ON COLUMN "SYS_DICT_ITEM"."CREATE_BY" is '创建用户'; +COMMENT ON COLUMN "SYS_DICT_ITEM"."CREATE_TIME" is '创建时间'; +COMMENT ON COLUMN "SYS_DICT_ITEM"."LAST_UPDATE_BY" is '最后更新用户'; +COMMENT ON COLUMN "SYS_DICT_ITEM"."LAST_UPDATE_TIME" is '最后更新时间'; + +-- ---------------------------- +-- Table structure for FILE - 文件 +-- Target : Oracle +-- Author : wangbing +-- Date: : 2019-12-17 +-- ---------------------------- +CREATE TABLE "SYS_FILE" ( +"ID" NUMBER(19) NOT NULL, +"NAME" VARCHAR2(250) NULL, +"FILE_TYPE" VARCHAR(10) NULL, +"ATTRIBUTE1" VARCHAR2(50) NULL, +"ATTRIBUTE2" VARCHAR2(50) NULL, +"LOCATION" VARCHAR2(500) NULL, +"URL" VARCHAR2(500) NULL, +"URL_DOWNLOAD" VARCHAR2(500) NULL, +"ROW_VERSION" NUMBER(19) NOT NULL, +"IS_DELETED" CHAR(1) NOT NULL, +"CREATE_BY" NUMBER(19) NOT NULL, +"CREATE_TIME" DATE NOT NULL, +"LAST_UPDATE_BY" NUMBER(19) NULL, +"LAST_UPDATE_TIME" DATE NULL +); +COMMENT ON TABLE "SYS_FILE" is '文件'; +COMMENT ON COLUMN "SYS_FILE"."ID" is '主键'; +COMMENT ON COLUMN "SYS_FILE"."NAME" is '文件名称'; +COMMENT ON COLUMN "SYS_FILE"."FILE_TYPE" is '文件类型'; +COMMENT ON COLUMN "SYS_FILE"."ATTRIBUTE1" is '扩展属性1'; +COMMENT ON COLUMN "SYS_FILE"."ATTRIBUTE2" is '扩展属性2'; +COMMENT ON COLUMN "SYS_FILE"."LOCATION" is '存放地址'; +COMMENT ON COLUMN "SYS_FILE"."URL" is '访问地址'; +COMMENT ON COLUMN "SYS_FILE"."URL_DOWNLOAD" is '下载地址'; +COMMENT ON COLUMN "SYS_FILE"."ROW_VERSION" is '行版本'; +COMMENT ON COLUMN "SYS_FILE"."IS_DELETED" is '是否已删除'; +COMMENT ON COLUMN "SYS_FILE"."CREATE_BY" is '创建用户'; +COMMENT ON COLUMN "SYS_FILE"."CREATE_TIME" is '创建时间'; +COMMENT ON COLUMN "SYS_FILE"."LAST_UPDATE_BY" is '最后更新用户'; +COMMENT ON COLUMN "SYS_FILE"."LAST_UPDATE_TIME" is '最后更新时间'; + diff --git a/src/main/resources/modules/SpringBoot/resources/dbtool/system/ALL_TABLE_SQLite.sql b/src/main/resources/modules/SpringBoot/resources/dbtool/system/ALL_TABLE_SQLite.sql new file mode 100644 index 00000000..0918d6f0 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/resources/dbtool/system/ALL_TABLE_SQLite.sql @@ -0,0 +1,23 @@ +-- ---------------------------- +-- Table structure for FILE - 文件 +-- Target : SQLite +-- Author : wangbing +-- Date: : 2019-12-17 +-- ---------------------------- +CREATE TABLE IF NOT EXISTS SYS_FILE ( + "ID" BIGINT PRIMARY KEY NOT NULL, + "NAME" VARCHAR(250), + "FILE_TYPE" VARCHAR(10), + "ATTRIBUTE1" VARCHAR(50), + "ATTRIBUTE2" VARCHAR(50), + "LOCATION" VARCHAR(500), + "URL" VARCHAR(500), + "URL_DOWNLOAD" VARCHAR(500), + "ROW_VERSION" BIGINT NOT NULL, + "IS_DELETED" BOOLEAN NOT NULL, + "CREATE_BY" BIGINT NOT NULL, + "CREATE_TIME" DATETIME NOT NULL, + "LAST_UPDATE_BY" BIGINT, + "LAST_UPDATE_TIME" DATETIME +); + diff --git a/src/main/resources/modules/SpringBoot/resources/dbtool/system/DICT.sql b/src/main/resources/modules/SpringBoot/resources/dbtool/system/DICT.sql deleted file mode 100644 index 0c0492d6..00000000 --- a/src/main/resources/modules/SpringBoot/resources/dbtool/system/DICT.sql +++ /dev/null @@ -1,77 +0,0 @@ -<#if dataBase == 'MySQL'> --- ---------------------------- --- Table structure for DICT - 字典 --- Target : MySQL --- Author : wangbing --- Date: : 2019-12-16 --- ---------------------------- -CREATE TABLE `SYS_DICT` ( - `ID` BIGINT(20) NOT NULL COMMENT '主键', - `DICT_NAME` VARCHAR(50) NOT NULL COMMENT '字典名称', - `DICT_COMMENT` VARCHAR(50) NOT NULL COMMENT '字典描述', - `VERSION` VARCHAR(50) NOT NULL COMMENT '字典版本', - `VALID` TINYINT(1) NOT NULL COMMENT '是否有效', - `ROW_VERSION` BIGINT(20) NOT NULL DEFAULT 0 COMMENT '行版本', - `IS_DELETED` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '是否已删除', - `CREATE_BY` BIGINT(20) NOT NULL COMMENT '创建用户', - `CREATE_TIME` DATETIME NOT NULL COMMENT '创建时间', - `LAST_UPDATE_BY` BIGINT(20) DEFAULT NULL COMMENT '最后更新用户', - `LAST_UPDATE_TIME` DATETIME DEFAULT NULL COMMENT '最后更新时间', -PRIMARY KEY (`ID`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='字典'; - -<#if dataBase == 'Oracle'> --- ---------------------------- --- Table structure for DICT - 字典 --- Target : Oracle --- Author : wangbing --- Date: : 2019-12-16 --- ---------------------------- -CREATE TABLE "SYS_DICT" ( - "ID" NUMBER(19) NOT NULL, - "DICT_NAME" VARCHAR2(50) NULL, - "DICT_COMMENT" VARCHAR2(50) NULL, - "VERSION" VARCHAR2(50) NULL, - "VALID" CHAR(1) NULL, - "ROW_VERSION" NUMBER(19) NOT NULL, - "IS_DELETED" CHAR(1) NOT NULL, - "CREATE_BY" NUMBER(19) NOT NULL, - "CREATE_TIME" DATE NOT NULL, - "LAST_UPDATE_BY" NUMBER(19) NULL, - "LAST_UPDATE_TIME" DATE NULL -); - -COMMENT ON TABLE "SYS_DICT" is '字典'; -COMMENT ON COLUMN "SYS_DICT"."ID" is '主键'; -COMMENT ON COLUMN "SYS_DICT"."DICT_NAME" is '字典名称'; -COMMENT ON COLUMN "SYS_DICT"."DICT_COMMENT" is '字典描述'; -COMMENT ON COLUMN "SYS_DICT"."VERSION" is '字典版本'; -COMMENT ON COLUMN "SYS_DICT"."VALID" is '是否有效'; -COMMENT ON COLUMN "SYS_DICT"."ROW_VERSION" is '行版本'; -COMMENT ON COLUMN "SYS_DICT"."IS_DELETED" is '是否已删除'; -COMMENT ON COLUMN "SYS_DICT"."CREATE_BY" is '创建用户'; -COMMENT ON COLUMN "SYS_DICT"."CREATE_TIME" is '创建时间'; -COMMENT ON COLUMN "SYS_DICT"."LAST_UPDATE_BY" is '最后更新用户'; -COMMENT ON COLUMN "SYS_DICT"."LAST_UPDATE_TIME" is '最后更新时间'; - -<#if dataBase == 'SQLite'> --- ---------------------------- --- Table structure for DICT - 字典 --- Target : SQLite --- Author : wangbing --- Date: : 2019-12-16 --- ---------------------------- -CREATE TABLE IF NOT EXISTS "SYS_DICT" ( - "ID" BIGINT PRIMARY KEY NOT NULL, - "DICT_NAME" VARCHAR(50) NOT NULL, - "DICT_COMMENT" VARCHAR(50) NOT NULL, - "VERSION" VARCHAR(50) NOT NULL, - "VALID" BOOLEAN NOT NULL, - "ROW_VERSION" BIGINT NOT NULL, - "IS_DELETED" BOOLEAN NOT NULL, - "CREATE_BY" BIGINT NOT NULL, - "CREATE_TIME" DATETIME NOT NULL, - "LAST_UPDATE_BY" BIGINT, - "LAST_UPDATE_TIME" DATETIME -); - \ No newline at end of file diff --git a/src/main/resources/modules/SpringBoot/resources/dbtool/system/DICT_ITEM.sql b/src/main/resources/modules/SpringBoot/resources/dbtool/system/DICT_ITEM.sql deleted file mode 100644 index 663a06af..00000000 --- a/src/main/resources/modules/SpringBoot/resources/dbtool/system/DICT_ITEM.sql +++ /dev/null @@ -1,81 +0,0 @@ -<#if dataBase == 'MySQL'> --- ---------------------------- --- Table structure for DICT_ITEM - 字典项 --- Target : MySQL --- Author : wangbing --- Date: : 2019-12-16 --- ---------------------------- -CREATE TABLE `SYS_DICT_ITEM` ( - `ID` BIGINT(20) NOT NULL COMMENT '主键', - `DICT_NAME` BIGINT(20) NOT NULL COMMENT '字典名称', - `KEY` CHAR(10) NOT NULL COMMENT '字典键', - `VALUE` VARCHAR(100) NOT NULL COMMENT '字典值', - `SORT` INTEGER(10) NOT NULL COMMENT '排序', - `VALID` TINYINT(1) NOT NULL COMMENT '是否有效', - `ROW_VERSION` BIGINT(20) NOT NULL DEFAULT 0 COMMENT '行版本', - `IS_DELETED` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '是否已删除', - `CREATE_BY` BIGINT(20) NOT NULL COMMENT '创建用户', - `CREATE_TIME` DATETIME NOT NULL COMMENT '创建时间', - `LAST_UPDATE_BY` BIGINT(20) DEFAULT NULL COMMENT '最后更新用户', - `LAST_UPDATE_TIME` DATETIME DEFAULT NULL COMMENT '最后更新时间', -PRIMARY KEY (`ID`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='字典项'; - -<#if dataBase == 'Oracle'> --- ---------------------------- --- Table structure for DICT_ITEM - 字典项 --- Target : Oracle --- Author : wangbing --- Date: : 2019-12-16 --- ---------------------------- -CREATE TABLE "SYS_DICT_ITEM" ( - "ID" NUMBER(19) NOT NULL, - "DICT_NAME" NUMBER(19) NULL, - "KEY" CHAR(10) NULL, - "VALUE" VARCHAR2(100) NULL, - "SORT" NUMBER(10) NULL, - "VALID" CHAR(1) NULL, - "ROW_VERSION" NUMBER(19) NOT NULL, - "IS_DELETED" CHAR(1) NOT NULL, - "CREATE_BY" NUMBER(19) NOT NULL, - "CREATE_TIME" DATE NOT NULL, - "LAST_UPDATE_BY" NUMBER(19) NULL, - "LAST_UPDATE_TIME" DATE NULL -); - -COMMENT ON TABLE "SYS_DICT_ITEM" is '字典项'; -COMMENT ON COLUMN "SYS_DICT_ITEM"."ID" is '主键'; -COMMENT ON COLUMN "SYS_DICT_ITEM"."DICT_NAME" is '字典名称'; -COMMENT ON COLUMN "SYS_DICT_ITEM"."KEY" is '字典键'; -COMMENT ON COLUMN "SYS_DICT_ITEM"."VALUE" is '字典值'; -COMMENT ON COLUMN "SYS_DICT_ITEM"."SORT" is '排序'; -COMMENT ON COLUMN "SYS_DICT_ITEM"."VALID" is '是否有效'; -COMMENT ON COLUMN "SYS_DICT_ITEM"."ROW_VERSION" is '行版本'; -COMMENT ON COLUMN "SYS_DICT_ITEM"."IS_DELETED" is '是否已删除'; -COMMENT ON COLUMN "SYS_DICT_ITEM"."CREATE_BY" is '创建用户'; -COMMENT ON COLUMN "SYS_DICT_ITEM"."CREATE_TIME" is '创建时间'; -COMMENT ON COLUMN "SYS_DICT_ITEM"."LAST_UPDATE_BY" is '最后更新用户'; -COMMENT ON COLUMN "SYS_DICT_ITEM"."LAST_UPDATE_TIME" is '最后更新时间'; - -<#if dataBase == 'SQLite'> --- ---------------------------- --- Table structure for DICT_ITEM - 字典项 --- Target : SQLite --- Author : wangbing --- Date: : 2019-12-16 --- ---------------------------- -CREATE TABLE IF NOT EXISTS "SYS_DICT_ITEM" ( - "ID" BIGINT PRIMARY KEY NOT NULL, - "DICT_NAME" BIGINT NOT NULL, - "KEY" CHAR(10) NOT NULL, - "VALUE" VARCHAR(100) NOT NULL, - "SORT" MEDIUMINT NOT NULL, - "VALID" BOOLEAN NOT NULL, - "ROW_VERSION" BIGINT NOT NULL, - "IS_DELETED" BOOLEAN NOT NULL, - "CREATE_BY" BIGINT NOT NULL, - "CREATE_TIME" DATETIME NOT NULL, - "LAST_UPDATE_BY" BIGINT, - "LAST_UPDATE_TIME" DATETIME -); - \ No newline at end of file diff --git a/src/main/resources/modules/SpringBoot/resources/dbtool/system/DICT_ITEM_MySQL.sql b/src/main/resources/modules/SpringBoot/resources/dbtool/system/DICT_ITEM_MySQL.sql new file mode 100644 index 00000000..0aca2189 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/resources/dbtool/system/DICT_ITEM_MySQL.sql @@ -0,0 +1,21 @@ +-- ---------------------------- +-- Table structure for DICT_ITEM - 字典项 +-- Target : MySQL +-- Author : wangbing +-- Date: : 2019-12-17 +-- ---------------------------- +CREATE TABLE `SYS_DICT_ITEM` ( + `ID` BIGINT(20) NOT NULL COMMENT '主键', + `DICT_NAME` VARCHAR(50) NOT NULL COMMENT '字典名称', + `KEY` VARCHAR(20) NOT NULL COMMENT '字典键', + `VALUE` VARCHAR(100) NOT NULL COMMENT '字典值', + `SORT` INTEGER(10) NOT NULL COMMENT '排序', + `VALID` TINYINT(1) NOT NULL COMMENT '是否有效', + `ROW_VERSION` BIGINT(20) NOT NULL DEFAULT 0 COMMENT '行版本', + `IS_DELETED` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '是否已删除', + `CREATE_BY` BIGINT(20) NOT NULL COMMENT '创建用户', + `CREATE_TIME` INTEGER NOT NULL COMMENT '创建时间', + `LAST_UPDATE_BY` BIGINT(20) DEFAULT NULL COMMENT '最后更新用户', + `LAST_UPDATE_TIME` INTEGER DEFAULT NULL COMMENT '最后更新时间', +PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='字典项'; diff --git a/src/main/resources/modules/SpringBoot/resources/dbtool/system/DICT_ITEM_Oracle.sql b/src/main/resources/modules/SpringBoot/resources/dbtool/system/DICT_ITEM_Oracle.sql new file mode 100644 index 00000000..f1a94434 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/resources/dbtool/system/DICT_ITEM_Oracle.sql @@ -0,0 +1,34 @@ +-- ---------------------------- +-- Table structure for DICT_ITEM - 字典项 +-- Target : Oracle +-- Author : wangbing +-- Date: : 2019-12-17 +-- ---------------------------- +CREATE TABLE "SYS_DICT_ITEM" ( + "ID" NUMBER(19) NOT NULL, + "DICT_NAME" VARCHAR2(50) NULL, + "KEY" VARCHAR2(20) NULL, + "VALUE" VARCHAR2(100) NULL, + "SORT" NUMBER(10) NULL, + "VALID" CHAR(1) NULL, + "ROW_VERSION" NUMBER(19) NOT NULL, + "IS_DELETED" CHAR(1) NOT NULL, + "CREATE_BY" NUMBER(19) NOT NULL, + "CREATE_TIME" DATE NOT NULL, + "LAST_UPDATE_BY" NUMBER(19) NULL, + "LAST_UPDATE_TIME" DATE NULL +); + +COMMENT ON TABLE "SYS_DICT_ITEM" is '字典项'; +COMMENT ON COLUMN "SYS_DICT_ITEM"."ID" is '主键'; +COMMENT ON COLUMN "SYS_DICT_ITEM"."DICT_NAME" is '字典名称'; +COMMENT ON COLUMN "SYS_DICT_ITEM"."KEY" is '字典键'; +COMMENT ON COLUMN "SYS_DICT_ITEM"."VALUE" is '字典值'; +COMMENT ON COLUMN "SYS_DICT_ITEM"."SORT" is '排序'; +COMMENT ON COLUMN "SYS_DICT_ITEM"."VALID" is '是否有效'; +COMMENT ON COLUMN "SYS_DICT_ITEM"."ROW_VERSION" is '行版本'; +COMMENT ON COLUMN "SYS_DICT_ITEM"."IS_DELETED" is '是否已删除'; +COMMENT ON COLUMN "SYS_DICT_ITEM"."CREATE_BY" is '创建用户'; +COMMENT ON COLUMN "SYS_DICT_ITEM"."CREATE_TIME" is '创建时间'; +COMMENT ON COLUMN "SYS_DICT_ITEM"."LAST_UPDATE_BY" is '最后更新用户'; +COMMENT ON COLUMN "SYS_DICT_ITEM"."LAST_UPDATE_TIME" is '最后更新时间'; diff --git a/src/main/resources/modules/SpringBoot/resources/dbtool/system/DICT_ITEM_SQLite.sql b/src/main/resources/modules/SpringBoot/resources/dbtool/system/DICT_ITEM_SQLite.sql new file mode 100644 index 00000000..872113da --- /dev/null +++ b/src/main/resources/modules/SpringBoot/resources/dbtool/system/DICT_ITEM_SQLite.sql @@ -0,0 +1,20 @@ +-- ---------------------------- +-- Table structure for DICT_ITEM - 字典项 +-- Target : SQLite +-- Author : wangbing +-- Date: : 2019-12-17 +-- ---------------------------- +CREATE TABLE IF NOT EXISTS SYS_DICT_ITEM ( + "ID" BIGINT PRIMARY KEY NOT NULL, + "DICT_NAME" VARCHAR(50) NOT NULL, + "KEY" VARCHAR(20) NOT NULL, + "VALUE" VARCHAR(100) NOT NULL, + "SORT" MEDIUMINT NOT NULL, + "VALID" BOOLEAN NOT NULL, + "ROW_VERSION" BIGINT NOT NULL, + "IS_DELETED" BOOLEAN NOT NULL, + "CREATE_BY" BIGINT NOT NULL, + "CREATE_TIME" DATETIME NOT NULL, + "LAST_UPDATE_BY" BIGINT, + "LAST_UPDATE_TIME" DATETIME +); diff --git a/src/main/resources/modules/SpringBoot/resources/dbtool/system/DICT_MySQL.sql b/src/main/resources/modules/SpringBoot/resources/dbtool/system/DICT_MySQL.sql new file mode 100644 index 00000000..a1cec9de --- /dev/null +++ b/src/main/resources/modules/SpringBoot/resources/dbtool/system/DICT_MySQL.sql @@ -0,0 +1,20 @@ +-- ---------------------------- +-- Table structure for DICT - 字典 +-- Target : MySQL +-- Author : wangbing +-- Date: : 2019-12-17 +-- ---------------------------- +CREATE TABLE `SYS_DICT` ( + `ID` BIGINT(20) NOT NULL COMMENT '主键', + `DICT_NAME` VARCHAR(50) NOT NULL COMMENT '字典名称', + `DICT_COMMENT` VARCHAR(50) NOT NULL COMMENT '字典描述', + `VERSION` VARCHAR(50) NOT NULL COMMENT '字典版本', + `VALID` TINYINT(1) NOT NULL COMMENT '是否有效', + `ROW_VERSION` BIGINT(20) NOT NULL DEFAULT 0 COMMENT '行版本', + `IS_DELETED` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '是否已删除', + `CREATE_BY` BIGINT(20) NOT NULL COMMENT '创建用户', + `CREATE_TIME` INTEGER NOT NULL COMMENT '创建时间', + `LAST_UPDATE_BY` BIGINT(20) DEFAULT NULL COMMENT '最后更新用户', + `LAST_UPDATE_TIME` INTEGER DEFAULT NULL COMMENT '最后更新时间', +PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='字典'; diff --git a/src/main/resources/modules/SpringBoot/resources/dbtool/system/DICT_Oracle.sql b/src/main/resources/modules/SpringBoot/resources/dbtool/system/DICT_Oracle.sql new file mode 100644 index 00000000..b18b61d5 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/resources/dbtool/system/DICT_Oracle.sql @@ -0,0 +1,32 @@ +-- ---------------------------- +-- Table structure for DICT - 字典 +-- Target : Oracle +-- Author : wangbing +-- Date: : 2019-12-17 +-- ---------------------------- +CREATE TABLE "SYS_DICT" ( + "ID" NUMBER(19) NOT NULL, + "DICT_NAME" VARCHAR2(50) NULL, + "DICT_COMMENT" VARCHAR2(50) NULL, + "VERSION" VARCHAR2(50) NULL, + "VALID" CHAR(1) NULL, + "ROW_VERSION" NUMBER(19) NOT NULL, + "IS_DELETED" CHAR(1) NOT NULL, + "CREATE_BY" NUMBER(19) NOT NULL, + "CREATE_TIME" DATE NOT NULL, + "LAST_UPDATE_BY" NUMBER(19) NULL, + "LAST_UPDATE_TIME" DATE NULL +); + +COMMENT ON TABLE "SYS_DICT" is '字典'; +COMMENT ON COLUMN "SYS_DICT"."ID" is '主键'; +COMMENT ON COLUMN "SYS_DICT"."DICT_NAME" is '字典名称'; +COMMENT ON COLUMN "SYS_DICT"."DICT_COMMENT" is '字典描述'; +COMMENT ON COLUMN "SYS_DICT"."VERSION" is '字典版本'; +COMMENT ON COLUMN "SYS_DICT"."VALID" is '是否有效'; +COMMENT ON COLUMN "SYS_DICT"."ROW_VERSION" is '行版本'; +COMMENT ON COLUMN "SYS_DICT"."IS_DELETED" is '是否已删除'; +COMMENT ON COLUMN "SYS_DICT"."CREATE_BY" is '创建用户'; +COMMENT ON COLUMN "SYS_DICT"."CREATE_TIME" is '创建时间'; +COMMENT ON COLUMN "SYS_DICT"."LAST_UPDATE_BY" is '最后更新用户'; +COMMENT ON COLUMN "SYS_DICT"."LAST_UPDATE_TIME" is '最后更新时间'; diff --git a/src/main/resources/modules/SpringBoot/resources/dbtool/system/DICT_SQLite.sql b/src/main/resources/modules/SpringBoot/resources/dbtool/system/DICT_SQLite.sql new file mode 100644 index 00000000..46ddc506 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/resources/dbtool/system/DICT_SQLite.sql @@ -0,0 +1,19 @@ +-- ---------------------------- +-- Table structure for DICT - 字典 +-- Target : SQLite +-- Author : wangbing +-- Date: : 2019-12-17 +-- ---------------------------- +CREATE TABLE IF NOT EXISTS SYS_DICT ( + "ID" BIGINT PRIMARY KEY NOT NULL, + "DICT_NAME" VARCHAR(50) NOT NULL, + "DICT_COMMENT" VARCHAR(50) NOT NULL, + "VERSION" VARCHAR(50) NOT NULL, + "VALID" BOOLEAN NOT NULL, + "ROW_VERSION" BIGINT NOT NULL, + "IS_DELETED" BOOLEAN NOT NULL, + "CREATE_BY" BIGINT NOT NULL, + "CREATE_TIME" DATETIME NOT NULL, + "LAST_UPDATE_BY" BIGINT, + "LAST_UPDATE_TIME" DATETIME +); diff --git a/src/main/resources/modules/SpringBoot/resources/dbtool/system/FILE.sql b/src/main/resources/modules/SpringBoot/resources/dbtool/system/FILE.sql deleted file mode 100644 index 1d48b200..00000000 --- a/src/main/resources/modules/SpringBoot/resources/dbtool/system/FILE.sql +++ /dev/null @@ -1,89 +0,0 @@ -<#if dataBase == 'MySQL'> --- ---------------------------- --- Table structure for FILE - 文件 --- Target : MySQL --- Author : wangbing --- Date: : 2019-12-16 --- ---------------------------- -CREATE TABLE `SYS_FILE` ( - `ID` BIGINT(20) NOT NULL COMMENT '主键', - `NAME` VARCHAR(250) COMMENT '文件名称', - `FILE_TYPE` VARCHAR(10) COMMENT '文件类型', - `ATTRIBUTE1` VARCHAR(50) COMMENT '扩展属性1', - `ATTRIBUTE2` VARCHAR(50) COMMENT '扩展属性2', - `LOCATION` VARCHAR(500) COMMENT '存放地址', - `URL` VARCHAR(500) COMMENT '访问地址', - `URL_DOWNLOAD` VARCHAR(500) COMMENT '下载地址', - `ROW_VERSION` BIGINT(20) NOT NULL DEFAULT 0 COMMENT '行版本', - `IS_DELETED` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '是否已删除', - `CREATE_BY` BIGINT(20) NOT NULL COMMENT '创建用户', - `CREATE_TIME` DATETIME NOT NULL COMMENT '创建时间', - `LAST_UPDATE_BY` BIGINT(20) DEFAULT NULL COMMENT '最后更新用户', - `LAST_UPDATE_TIME` DATETIME DEFAULT NULL COMMENT '最后更新时间', -PRIMARY KEY (`ID`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='文件'; - -<#if dataBase == 'Oracle'> --- ---------------------------- --- Table structure for FILE - 文件 --- Target : Oracle --- Author : wangbing --- Date: : 2019-12-16 --- ---------------------------- -CREATE TABLE "SYS_FILE" ( - "ID" NUMBER(19) NOT NULL, - "NAME" VARCHAR2(250) NULL, - "FILE_TYPE" VARCHAR(10) NULL, - "ATTRIBUTE1" VARCHAR2(50) NULL, - "ATTRIBUTE2" VARCHAR2(50) NULL, - "LOCATION" VARCHAR2(500) NULL, - "URL" VARCHAR2(500) NULL, - "URL_DOWNLOAD" VARCHAR2(500) NULL, - "ROW_VERSION" NUMBER(19) NOT NULL, - "IS_DELETED" CHAR(1) NOT NULL, - "CREATE_BY" NUMBER(19) NOT NULL, - "CREATE_TIME" DATE NOT NULL, - "LAST_UPDATE_BY" NUMBER(19) NULL, - "LAST_UPDATE_TIME" DATE NULL -); - -COMMENT ON TABLE "SYS_FILE" is '文件'; -COMMENT ON COLUMN "SYS_FILE"."ID" is '主键'; -COMMENT ON COLUMN "SYS_FILE"."NAME" is '文件名称'; -COMMENT ON COLUMN "SYS_FILE"."FILE_TYPE" is '文件类型'; -COMMENT ON COLUMN "SYS_FILE"."ATTRIBUTE1" is '扩展属性1'; -COMMENT ON COLUMN "SYS_FILE"."ATTRIBUTE2" is '扩展属性2'; -COMMENT ON COLUMN "SYS_FILE"."LOCATION" is '存放地址'; -COMMENT ON COLUMN "SYS_FILE"."URL" is '访问地址'; -COMMENT ON COLUMN "SYS_FILE"."URL_DOWNLOAD" is '下载地址'; -COMMENT ON COLUMN "SYS_FILE"."ROW_VERSION" is '行版本'; -COMMENT ON COLUMN "SYS_FILE"."IS_DELETED" is '是否已删除'; -COMMENT ON COLUMN "SYS_FILE"."CREATE_BY" is '创建用户'; -COMMENT ON COLUMN "SYS_FILE"."CREATE_TIME" is '创建时间'; -COMMENT ON COLUMN "SYS_FILE"."LAST_UPDATE_BY" is '最后更新用户'; -COMMENT ON COLUMN "SYS_FILE"."LAST_UPDATE_TIME" is '最后更新时间'; - -<#if dataBase == 'SQLite'> --- ---------------------------- --- Table structure for FILE - 文件 --- Target : SQLite --- Author : wangbing --- Date: : 2019-12-16 --- ---------------------------- -CREATE TABLE IF NOT EXISTS "SYS_FILE" ( - "ID" BIGINT PRIMARY KEY NOT NULL, - "NAME" VARCHAR(250), - "FILE_TYPE" VARCHAR(10), - "ATTRIBUTE1" VARCHAR(50), - "ATTRIBUTE2" VARCHAR(50), - "LOCATION" VARCHAR(500), - "URL" VARCHAR(500), - "URL_DOWNLOAD" VARCHAR(500), - "ROW_VERSION" BIGINT NOT NULL, - "IS_DELETED" BOOLEAN NOT NULL, - "CREATE_BY" BIGINT NOT NULL, - "CREATE_TIME" DATETIME NOT NULL, - "LAST_UPDATE_BY" BIGINT, - "LAST_UPDATE_TIME" DATETIME -); - \ No newline at end of file diff --git a/src/main/resources/modules/SpringBoot/resources/dbtool/system/FILE_MySQL.sql b/src/main/resources/modules/SpringBoot/resources/dbtool/system/FILE_MySQL.sql new file mode 100644 index 00000000..9b3aede6 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/resources/dbtool/system/FILE_MySQL.sql @@ -0,0 +1,23 @@ +-- ---------------------------- +-- Table structure for FILE - 文件 +-- Target : MySQL +-- Author : wangbing +-- Date: : 2019-12-17 +-- ---------------------------- +CREATE TABLE `SYS_FILE` ( + `ID` BIGINT(20) NOT NULL COMMENT '主键', + `NAME` VARCHAR(250) COMMENT '文件名称', + `FILE_TYPE` VARCHAR(10) COMMENT '文件类型', + `ATTRIBUTE1` VARCHAR(50) COMMENT '扩展属性1', + `ATTRIBUTE2` VARCHAR(50) COMMENT '扩展属性2', + `LOCATION` VARCHAR(500) COMMENT '存放地址', + `URL` VARCHAR(500) COMMENT '访问地址', + `URL_DOWNLOAD` VARCHAR(500) COMMENT '下载地址', + `ROW_VERSION` BIGINT(20) NOT NULL DEFAULT 0 COMMENT '行版本', + `IS_DELETED` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '是否已删除', + `CREATE_BY` BIGINT(20) NOT NULL COMMENT '创建用户', + `CREATE_TIME` INTEGER NOT NULL COMMENT '创建时间', + `LAST_UPDATE_BY` BIGINT(20) DEFAULT NULL COMMENT '最后更新用户', + `LAST_UPDATE_TIME` INTEGER DEFAULT NULL COMMENT '最后更新时间', +PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='文件'; diff --git a/src/main/resources/modules/SpringBoot/resources/dbtool/system/FILE_Oracle.sql b/src/main/resources/modules/SpringBoot/resources/dbtool/system/FILE_Oracle.sql new file mode 100644 index 00000000..97db02f7 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/resources/dbtool/system/FILE_Oracle.sql @@ -0,0 +1,38 @@ +-- ---------------------------- +-- Table structure for FILE - 文件 +-- Target : Oracle +-- Author : wangbing +-- Date: : 2019-12-17 +-- ---------------------------- +CREATE TABLE "SYS_FILE" ( + "ID" NUMBER(19) NOT NULL, + "NAME" VARCHAR2(250) NULL, + "FILE_TYPE" VARCHAR(10) NULL, + "ATTRIBUTE1" VARCHAR2(50) NULL, + "ATTRIBUTE2" VARCHAR2(50) NULL, + "LOCATION" VARCHAR2(500) NULL, + "URL" VARCHAR2(500) NULL, + "URL_DOWNLOAD" VARCHAR2(500) NULL, + "ROW_VERSION" NUMBER(19) NOT NULL, + "IS_DELETED" CHAR(1) NOT NULL, + "CREATE_BY" NUMBER(19) NOT NULL, + "CREATE_TIME" DATE NOT NULL, + "LAST_UPDATE_BY" NUMBER(19) NULL, + "LAST_UPDATE_TIME" DATE NULL +); + +COMMENT ON TABLE "SYS_FILE" is '文件'; +COMMENT ON COLUMN "SYS_FILE"."ID" is '主键'; +COMMENT ON COLUMN "SYS_FILE"."NAME" is '文件名称'; +COMMENT ON COLUMN "SYS_FILE"."FILE_TYPE" is '文件类型'; +COMMENT ON COLUMN "SYS_FILE"."ATTRIBUTE1" is '扩展属性1'; +COMMENT ON COLUMN "SYS_FILE"."ATTRIBUTE2" is '扩展属性2'; +COMMENT ON COLUMN "SYS_FILE"."LOCATION" is '存放地址'; +COMMENT ON COLUMN "SYS_FILE"."URL" is '访问地址'; +COMMENT ON COLUMN "SYS_FILE"."URL_DOWNLOAD" is '下载地址'; +COMMENT ON COLUMN "SYS_FILE"."ROW_VERSION" is '行版本'; +COMMENT ON COLUMN "SYS_FILE"."IS_DELETED" is '是否已删除'; +COMMENT ON COLUMN "SYS_FILE"."CREATE_BY" is '创建用户'; +COMMENT ON COLUMN "SYS_FILE"."CREATE_TIME" is '创建时间'; +COMMENT ON COLUMN "SYS_FILE"."LAST_UPDATE_BY" is '最后更新用户'; +COMMENT ON COLUMN "SYS_FILE"."LAST_UPDATE_TIME" is '最后更新时间'; diff --git a/src/main/resources/modules/SpringBoot/resources/dbtool/system/FILE_SQLite.sql b/src/main/resources/modules/SpringBoot/resources/dbtool/system/FILE_SQLite.sql new file mode 100644 index 00000000..05ca02fe --- /dev/null +++ b/src/main/resources/modules/SpringBoot/resources/dbtool/system/FILE_SQLite.sql @@ -0,0 +1,22 @@ +-- ---------------------------- +-- Table structure for FILE - 文件 +-- Target : SQLite +-- Author : wangbing +-- Date: : 2019-12-17 +-- ---------------------------- +CREATE TABLE IF NOT EXISTS SYS_FILE ( + "ID" BIGINT PRIMARY KEY NOT NULL, + "NAME" VARCHAR(250), + "FILE_TYPE" VARCHAR(10), + "ATTRIBUTE1" VARCHAR(50), + "ATTRIBUTE2" VARCHAR(50), + "LOCATION" VARCHAR(500), + "URL" VARCHAR(500), + "URL_DOWNLOAD" VARCHAR(500), + "ROW_VERSION" BIGINT NOT NULL, + "IS_DELETED" BOOLEAN NOT NULL, + "CREATE_BY" BIGINT NOT NULL, + "CREATE_TIME" DATETIME NOT NULL, + "LAST_UPDATE_BY" BIGINT, + "LAST_UPDATE_TIME" DATETIME +); diff --git a/src/main/resources/modules/SpringBoot/resources/dbtool/wadmin.xml b/src/main/resources/modules/SpringBoot/resources/dbtool/wadmin.xml index bc79ec95..48417e91 100644 --- a/src/main/resources/modules/SpringBoot/resources/dbtool/wadmin.xml +++ b/src/main/resources/modules/SpringBoot/resources/dbtool/wadmin.xml @@ -1,65 +1,65 @@ -wadmin -xyz.wbsite -wangbing - - -系统 -SYS_ -system -true - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - -
-
-
-
+ wadmin + xyz.wbsite + wangbing + + + 系统 + SYS_ + system + true + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + +
+
+
+
diff --git a/src/main/resources/modules/SpringBoot/test/application.properties b/src/main/resources/modules/SpringBoot/test/application.properties index 34a79d24..2bc0f8d4 100644 --- a/src/main/resources/modules/SpringBoot/test/application.properties +++ b/src/main/resources/modules/SpringBoot/test/application.properties @@ -40,7 +40,7 @@ mybatis.configuration.map-underscore-to-camel-case=true <#if dataBase == 'SQLite'> # SQLite spring.datasource.url=jdbc:sqlite::resource:example.db spring.datasource.driver-class-name=org.sqlite.JDBC -spring.datasource.url=jdbc:sqlite:${projectName?default("SpringBoot")}.db +spring.datasource.url=jdbc:sqlite:${projectName?default("SpringBoot")}.db?date_string_format=yyyy-MM-dd HH:mm:ss spring.datasource.username=test spring.datasource.password=123456 # mybatis