Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
appbuild
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
appbuild
Commits
ed9df112
Commit
ed9df112
authored
Apr 12, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改数据库字段映射关键字转义问题
parent
5e3804c4
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
57 additions
and
34 deletions
+57
-34
appbuild-manager/src/main/java/com/mortals/xhx/base/system/gentable/model/GentableColumnEntityExt.java
...x/base/system/gentable/model/GentableColumnEntityExt.java
+10
-0
appbuild-manager/src/main/java/com/mortals/xhx/base/system/gentable/service/impl/GentableServiceImpl.java
...ase/system/gentable/service/impl/GentableServiceImpl.java
+4
-0
appbuild-manager/src/main/java/com/mortals/xhx/common/key/GenConstants.java
...rc/main/java/com/mortals/xhx/common/key/GenConstants.java
+12
-3
appbuild-manager/src/main/resources/template/vue/VueDialogShow.vue.ftl
...ger/src/main/resources/template/vue/VueDialogShow.vue.ftl
+1
-1
appbuild-manager/src/main/resources/template/vue/VueDrawerShow.vue.ftl
...ger/src/main/resources/template/vue/VueDrawerShow.vue.ftl
+1
-1
appbuild-manager/src/main/resources/template/vue/VueTreeDialogShow.vue.ftl
...src/main/resources/template/vue/VueTreeDialogShow.vue.ftl
+1
-1
appbuild-manager/src/main/resources/template/xml/sqlMap.xml.ftl
...ld-manager/src/main/resources/template/xml/sqlMap.xml.ftl
+28
-28
No files found.
appbuild-manager/src/main/java/com/mortals/xhx/base/system/gentable/model/GentableColumnEntityExt.java
View file @
ed9df112
...
...
@@ -14,6 +14,8 @@ import java.util.List;
import
java.util.Locale
;
import
java.util.Map
;
import
static
com
.
mortals
.
xhx
.
common
.
key
.
GenConstants
.
KEYWORDS_SET
;
/**
* Description:GentableColumn
* date: 2021-9-28 10:10:15
...
...
@@ -75,6 +77,14 @@ public class GentableColumnEntityExt extends BaseEntityLong {
return
returnStr
;
}
public
static
String
isKeyWord
(
String
columnName
)
{
if
(
KEYWORDS_SET
.
contains
(
columnName
)){
return
"`"
+
columnName
+
'`'
;
}
return
columnName
;
}
public
static
String
randomNumber
()
{
Faker
faker
=
new
Faker
(
Locale
.
CHINESE
);
...
...
appbuild-manager/src/main/java/com/mortals/xhx/base/system/gentable/service/impl/GentableServiceImpl.java
View file @
ed9df112
...
...
@@ -698,6 +698,10 @@ public class GentableServiceImpl extends AbstractCRUDServiceImpl<GentableDao, Ge
protected
void
removeAfter
(
Long
[]
ids
,
Context
context
,
int
result
)
throws
AppException
{
Long
[]
colIds
=
gentableColumnService
.
find
(
new
GentableColumnQuery
().
tableIdList
(
Arrays
.
asList
(
ids
))).
stream
().
map
(
GentableColumnEntity:
:
getId
).
toArray
(
Long
[]::
new
);
gentableColumnService
.
remove
(
colIds
,
context
);
super
.
removeAfter
(
ids
,
context
,
result
);
}
...
...
appbuild-manager/src/main/java/com/mortals/xhx/common/key/GenConstants.java
View file @
ed9df112
package
com.mortals.xhx.common.key
;
import
java.util.Arrays
;
import
java.util.HashSet
;
import
java.util.Set
;
/**
* 代码生成通用常量
*
...
...
@@ -73,19 +77,19 @@ public class GenConstants {
/**
* 页面不需要编辑字段
*/
public
static
final
String
[]
COLUMNNAME_NOT_EDIT
=
{
"id"
,
"createUser"
,
"createUserId"
,
"createTime"
,
"delFlag"
,
"updateUser"
,
"updateUserId"
,
"updateTime"
,
public
static
final
String
[]
COLUMNNAME_NOT_EDIT
=
{
"id"
,
"createUser"
,
"createUserId"
,
"createTime"
,
"delFlag"
,
"updateUser"
,
"updateUserId"
,
"updateTime"
,
"updateTime"
};
/**
* 页面不需要显示的列表字段
*/
public
static
final
String
[]
COLUMNNAME_NOT_LIST
=
{
"id"
,
"createUser"
,
"createUserId"
,
"createTime"
,
"delFlag"
,
"updateUser"
,
"updateUserId"
,
public
static
final
String
[]
COLUMNNAME_NOT_LIST
=
{
"id"
,
"createUser"
,
"createUserId"
,
"createTime"
,
"delFlag"
,
"updateUser"
,
"updateUserId"
,
"updateTime"
};
/**
* 页面不需要查询字段
*/
public
static
final
String
[]
COLUMNNAME_NOT_QUERY
=
{
"id"
,
"createUser"
,
"createUserId"
,
"createTime"
,
"delFlag"
,
"updateUser"
,
"updateUserId"
,
public
static
final
String
[]
COLUMNNAME_NOT_QUERY
=
{
"id"
,
"createUser"
,
"createUserId"
,
"createTime"
,
"delFlag"
,
"updateUser"
,
"updateUserId"
,
"updateTime"
,
"remark"
};
/**
...
...
@@ -192,4 +196,9 @@ public class GenConstants {
* 不需要
*/
public
static
final
Integer
NOREQUIRE
=
0
;
public
static
final
String
[]
MYSQL_KEYWORDS
=
{
"add"
,
"all"
,
"alter"
,
"analyze"
,
"and"
,
"as"
,
"asc"
,
"asensitive"
,
"before"
,
"between"
,
"bigint"
,
"binary"
,
"blob"
,
"both"
,
"by"
,
"call"
,
"cascade"
,
"case"
,
"change"
,
"char"
,
"character"
,
"check"
,
"collate"
,
"column"
,
"condition"
,
"connection"
,
"constraint"
,
"continue"
,
"convert"
,
"create"
,
"cross"
,
"current_date"
,
"current_time"
,
"current_timestamp"
,
"current_user"
,
"cursor"
,
"database"
,
"databases"
,
"day_hour"
,
"day_microsecond"
,
"day_minute"
,
"day_second"
,
"dec"
,
"decimal"
,
"declare"
,
"default"
,
"delayed"
,
"delete"
,
"desc"
,
"describe"
,
"deterministic"
,
"distinct"
,
"distinctrow"
,
"div"
,
"double"
,
"drop"
,
"dual"
,
"each"
,
"else"
,
"elseif"
,
"enclosed"
,
"escaped"
,
"exists"
,
"exit"
,
"explain"
,
"false"
,
"fetch"
,
"float"
,
"float4"
,
"float8"
,
"for"
,
"force"
,
"foreign"
,
"from"
,
"fulltext"
,
"goto"
,
"grant"
,
"group"
,
"having"
,
"high_priority"
,
"hour_microsecond"
,
"hour_minute"
,
"hour_second"
,
"if"
,
"ignore"
,
"in"
,
"index"
,
"infile"
,
"inner"
,
"inout"
,
"insensitive"
,
"insert"
,
"int"
,
"int1"
,
"int2"
,
"int3"
,
"int4"
,
"int8"
,
"integer"
,
"interval"
,
"into"
,
"is"
,
"iterate"
,
"join"
,
"key"
,
"keys"
,
"kill"
,
"label"
,
"leading"
,
"leave"
,
"left"
,
"like"
,
"limit"
,
"linear"
,
"lines"
,
"load"
,
"localtime"
,
"localtimestamp"
,
"lock"
,
"long"
,
"longblob"
,
"longtext"
,
"loop"
,
"low_priority"
,
"match"
,
"mediumblob"
,
"mediumint"
,
"mediumtext"
,
"middleint"
,
"minute_microsecond"
,
"minute_second"
,
"mod"
,
"modifies"
,
"natural"
,
"not"
,
"no_write_to_binlog"
,
"null"
,
"numeric"
,
"on"
,
"optimize"
,
"option"
,
"optionally"
,
"or"
,
"order"
,
"out"
,
"outer"
,
"outfile"
,
"precision"
,
"primary"
,
"procedure"
,
"purge"
,
"raid0"
,
"range"
,
"read"
,
"reads"
,
"real"
,
"references"
,
"regexp"
,
"release"
,
"rename"
,
"repeat"
,
"replace"
,
"require"
,
"restrict"
,
"return"
,
"revoke"
,
"right"
,
"rlike"
,
"schema"
,
"schemas"
,
"second_microsecond"
,
"select"
,
"sensitive"
,
"separator"
,
"set"
,
"show"
,
"smallint"
,
"spatial"
,
"specific"
,
"sql"
,
"sqlexception"
,
"sqlstate"
,
"sqlwarning"
,
"sql_big_result"
,
"sql_calc_found_rows"
,
"sql_small_result"
,
"ssl"
,
"starting"
,
"straight_join"
,
"table"
,
"terminated"
,
"then"
,
"tinyblob"
,
"tinyint"
,
"tinytext"
,
"to"
,
"trailing"
,
"trigger"
,
"true"
,
"undo"
,
"union"
,
"unique"
,
"unlock"
,
"unsigned"
,
"update"
,
"usage"
,
"use"
,
"using"
,
"utc_date"
,
"utc_time"
,
"utc_timestamp"
,
"values"
,
"varbinary"
,
"varchar"
,
"varcharacter"
,
"varying"
,
"when"
,
"where"
,
"while"
,
"with"
,
"write"
,
"x509"
,
"xor"
,
"year_month"
,
"zerofill"
};
public
static
final
Set
<
String
>
KEYWORDS_SET
=
new
HashSet
<>(
Arrays
.
asList
(
MYSQL_KEYWORDS
));
}
appbuild-manager/src/main/resources/template/vue/VueDialogShow.vue.ftl
View file @
ed9df112
...
...
@@ -294,7 +294,7 @@
<#elseif column.javaType=="String" && column.defaultValue??>
<#assign Default>"${column.defaultValue}"</#assign>
<#elseif column.javaType=="BigDecimal" && column.defaultValue??&& column.defaultValue!="">
<#assign Default>
BigDecimal.valueOf(${column.defaultValue})
</#assign>
<#assign Default>
${column.defaultValue}
</#assign>
<#else>
<#assign Default>null</#assign>
</#if>
...
...
appbuild-manager/src/main/resources/template/vue/VueDrawerShow.vue.ftl
View file @
ed9df112
...
...
@@ -271,7 +271,7 @@
<#elseif column.javaType=="String" && column.defaultValue??>
<#assign Default>"${column.defaultValue}"</#assign>
<#elseif column.javaType=="BigDecimal" && column.defaultValue??&& column.defaultValue!="">
<#assign Default>
BigDecimal.valueOf(${column.defaultValue})
</#assign>
<#assign Default>
${column.defaultValue}
</#assign>
<#else>
<#assign Default>null</#assign>
</#if>
...
...
appbuild-manager/src/main/resources/template/vue/VueTreeDialogShow.vue.ftl
View file @
ed9df112
...
...
@@ -220,7 +220,7 @@
<#elseif column.javaType=="String" && column.defaultValue??>
<#assign Default>"${column.defaultValue}"</#assign>
<#elseif column.javaType=="BigDecimal" && column.defaultValue??&& column.defaultValue!="">
<#assign Default>
BigDecimal.valueOf(${column.defaultValue})
</#assign>
<#assign Default>
${column.defaultValue}
</#assign>
<#else>
<#assign Default>null</#assign>
</#if>
...
...
appbuild-manager/src/main/resources/template/xml/sqlMap.xml.ftl
View file @
ed9df112
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment