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
420f7f52
Commit
420f7f52
authored
Aug 30, 2023
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.3版本修改,增加删除功能
parent
648e5ce3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
3 deletions
+10
-3
DaoConst.java
yzg-util-db/src/main/java/com/yanzuoguang/dao/DaoConst.java
+2
-1
TableStruct.java
...b/src/main/java/com/yanzuoguang/dao/impl/TableStruct.java
+8
-2
No files found.
yzg-util-db/src/main/java/com/yanzuoguang/dao/DaoConst.java
View file @
420f7f52
...
...
@@ -141,7 +141,8 @@ public class DaoConst {
/**
* 更新字段模板参数
*/
public
static
final
String
CODE_UPDATE_FIELD_REMOVE
=
",a.%s=CASE WHEN a.%s THEN 0 AND IFNULL(?,0)=0 THEN 1 ELSE IFNULL(?,1) END"
;
public
static
final
String
CODE_REMOVE_FIELD_REMOVE
=
",a.%s=CASE WHEN a.%s=0 AND IFNULL(?,0)=0 THEN 1 ELSE IFNULL(?,1) END"
;
public
static
final
String
CODE_UPDATE_FIELD_REMOVE
=
",a.%s=IFNULL(?,1)"
;
/**
* 等于条件
*/
...
...
yzg-util-db/src/main/java/com/yanzuoguang/dao/impl/TableStruct.java
View file @
420f7f52
...
...
@@ -691,8 +691,14 @@ public class TableStruct {
TableFieldVo
remove
=
this
.
getRemove
();
// 设置删除标记可以通过前台传入
if
(
remove
!=
null
)
{
sql
.
addParaConst
(
remove
.
inputName
,
CODE_FIELD
,
String
.
format
(
CODE_UPDATE_FIELD_REMOVE
,
remove
.
name
,
remove
.
name
));
if
(
sql
.
getSqlType
()
==
SQL_TYPE_REMOVE
)
{
sql
.
addParaConst
(
remove
.
inputName
,
CODE_FIELD
,
String
.
format
(
CODE_REMOVE_FIELD_REMOVE
,
remove
.
name
,
remove
.
name
));
}
else
{
sql
.
addParaConst
(
remove
.
inputName
,
CODE_FIELD
,
String
.
format
(
CODE_UPDATE_FIELD_REMOVE
,
remove
.
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