Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
Y
yzg-util
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
YZG
yzg-util
Commits
1f2ce7b6
Commit
1f2ce7b6
authored
Jun 18, 2019
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
常规BUG的修改
parent
2d4ebee9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
1 deletion
+19
-1
DaoConst.java
yzg-util-db/src/main/java/com/yanzuoguang/dao/DaoConst.java
+8
-0
TableStruct.java
...b/src/main/java/com/yanzuoguang/dao/impl/TableStruct.java
+11
-1
No files found.
yzg-util-db/src/main/java/com/yanzuoguang/dao/DaoConst.java
View file @
1f2ce7b6
...
...
@@ -110,6 +110,10 @@ public class DaoConst {
* 删除字段名称
*/
public
static
final
String
REMOVE_FLAG
=
"remove"
;
/**
* 创建字段名称
*/
public
static
final
String
CREATE_FLAG
=
"create"
;
/**
* 更新字段名称
*/
...
...
@@ -159,6 +163,10 @@ public class DaoConst {
* 删除时记录操作状态的字段
*/
public
static
final
int
FIELD_REMOVE_UPDATE
=
5
;
/**
* 删除时记录操作状态的字段
*/
public
static
final
int
FIELD_CREATE
=
6
;
/**
* SQL语句类型-普通语句
...
...
yzg-util-db/src/main/java/com/yanzuoguang/dao/impl/TableStruct.java
View file @
1f2ce7b6
...
...
@@ -265,6 +265,8 @@ public class TableStruct {
return
DaoConst
.
FIELD_MD5
;
}
else
if
(
vo
.
inputLName
.
startsWith
(
DaoConst
.
UPDATE_FLAG
))
{
return
DaoConst
.
FIELD_REMOVE_UPDATE
;
}
else
if
(
vo
.
inputLName
.
startsWith
(
DaoConst
.
CREATE_FLAG
))
{
return
DaoConst
.
FIELD_CREATE
;
}
else
{
return
DaoConst
.
FIELD_COMMON
;
}
...
...
@@ -338,8 +340,16 @@ public class TableStruct {
sql
.
addParaConst
(
this
.
getKey
().
inputName
,
DaoConst
.
FIELD_CODE
,
"a."
+
this
.
getKey
().
name
+
"=a."
+
this
.
getKey
().
name
,
DaoConst
.
WHERE_CODE
,
" AND a."
+
this
.
getKey
().
name
+
"=?"
);
// 删除时更新字段
List
<
TableFieldVo
>
createFields
=
getFieldActionList
(
DaoConst
.
FIELD_CREATE
);
Map
<
TableFieldVo
,
Boolean
>
mapCreate
=
new
HashMap
<>(
createFields
.
size
());
for
(
TableFieldVo
field
:
createFields
)
{
mapCreate
.
put
(
field
,
true
);
}
for
(
TableFieldVo
field
:
this
.
getFields
())
{
if
(
field
==
removeField
||
field
==
versionField
)
{
if
(
field
==
removeField
||
field
==
versionField
||
mapCreate
.
containsKey
(
field
)
)
{
continue
;
}
sql
.
addParaConst
(
field
.
inputName
,
DaoConst
.
FIELD_CODE
,
",a."
+
field
.
name
+
"=?"
);
...
...
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