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
f6884d99
Commit
f6884d99
authored
Jun 10, 2019
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
常规BUG的修改
parent
473fbff7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
1 deletion
+18
-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
+10
-1
No files found.
yzg-util-db/src/main/java/com/yanzuoguang/dao/DaoConst.java
View file @
f6884d99
...
@@ -110,6 +110,10 @@ public class DaoConst {
...
@@ -110,6 +110,10 @@ public class DaoConst {
* 删除字段名称
* 删除字段名称
*/
*/
public
static
final
String
REMOVE_FLAG
=
"remove"
;
public
static
final
String
REMOVE_FLAG
=
"remove"
;
/**
* 更新字段名称
*/
public
static
final
String
UPDATE_FLAG
=
"update"
;
/**
/**
* MD5标记字段
* MD5标记字段
*/
*/
...
@@ -151,4 +155,8 @@ public class DaoConst {
...
@@ -151,4 +155,8 @@ public class DaoConst {
* MD5标记字段,用于统计字段
* MD5标记字段,用于统计字段
*/
*/
public
static
final
int
FIELD_MD5
=
4
;
public
static
final
int
FIELD_MD5
=
4
;
/**
* 删除时记录操作状态的字段
*/
public
static
final
int
FIELD_REMOVE_UPDATE
=
5
;
}
}
yzg-util-db/src/main/java/com/yanzuoguang/dao/impl/TableStruct.java
View file @
f6884d99
...
@@ -216,8 +216,12 @@ public class TableStruct {
...
@@ -216,8 +216,12 @@ public class TableStruct {
}
else
{
}
else
{
// 将所有非主键列添加到普通列
// 将所有非主键列添加到普通列
commonActionList
.
add
(
vo
);
commonActionList
.
add
(
vo
);
if
(
fieldAction
==
DaoConst
.
FIELD_REMOVE_UPDATE
||
stringAction
==
DaoConst
.
FIELD_REMOVE_UPDATE
)
{
List
<
TableFieldVo
>
actionList
=
this
.
getFieldActionList
(
DaoConst
.
FIELD_REMOVE_UPDATE
);
actionList
.
add
(
vo
);
}
// 处理其他特殊列
// 处理其他特殊列
if
(
fieldAction
!=
DaoConst
.
FIELD_COMMON
)
{
else
if
(
fieldAction
!=
DaoConst
.
FIELD_COMMON
)
{
// 假如特殊列已经存在,则将已经存在的特殊列删除,并且添加新的特殊列
// 假如特殊列已经存在,则将已经存在的特殊列删除,并且添加新的特殊列
List
<
TableFieldVo
>
actionList
=
this
.
getFieldActionList
(
fieldAction
);
List
<
TableFieldVo
>
actionList
=
this
.
getFieldActionList
(
fieldAction
);
actionList
.
clear
();
actionList
.
clear
();
...
@@ -249,6 +253,8 @@ public class TableStruct {
...
@@ -249,6 +253,8 @@ public class TableStruct {
// 判断是否属于统计字段
// 判断是否属于统计字段
else
if
(
DaoConst
.
MD5_KEY_FLAG
.
equals
(
vo
.
inputLName
))
{
else
if
(
DaoConst
.
MD5_KEY_FLAG
.
equals
(
vo
.
inputLName
))
{
return
DaoConst
.
FIELD_MD5
;
return
DaoConst
.
FIELD_MD5
;
}
else
if
(
vo
.
inputLName
.
startsWith
(
DaoConst
.
UPDATE_FLAG
))
{
return
DaoConst
.
FIELD_REMOVE_UPDATE
;
}
else
{
}
else
{
return
DaoConst
.
FIELD_COMMON
;
return
DaoConst
.
FIELD_COMMON
;
}
}
...
@@ -350,6 +356,9 @@ public class TableStruct {
...
@@ -350,6 +356,9 @@ public class TableStruct {
String
text
=
DaoConst
.
UPDATE_MODEL
.
replace
(
DaoConst
.
TABLE_CODE
,
this
.
name
);
String
text
=
DaoConst
.
UPDATE_MODEL
.
replace
(
DaoConst
.
TABLE_CODE
,
this
.
name
);
SqlData
sql
=
new
SqlData
(
DaoConst
.
REMOVE
,
text
);
SqlData
sql
=
new
SqlData
(
DaoConst
.
REMOVE
,
text
);
sql
.
addCode
(
DaoConst
.
FIELD_CODE
,
removeField
.
name
+
"=1"
);
sql
.
addCode
(
DaoConst
.
FIELD_CODE
,
removeField
.
name
+
"=1"
);
for
(
TableFieldVo
field
:
this
.
getFieldActionList
(
DaoConst
.
FIELD_REMOVE_UPDATE
))
{
sql
.
addParaConst
(
field
.
inputName
,
DaoConst
.
FIELD_CODE
,
","
+
field
.
name
+
"=?"
);
}
if
(
versionField
!=
null
)
{
if
(
versionField
!=
null
)
{
sql
.
addCode
(
DaoConst
.
FIELD_CODE
,
","
+
versionField
.
name
+
"=1+"
+
versionField
.
name
);
sql
.
addCode
(
DaoConst
.
FIELD_CODE
,
","
+
versionField
.
name
+
"=1+"
+
versionField
.
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