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
69de31a3
Commit
69de31a3
authored
Aug 18, 2023
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.3版本修改,增加删除功能
parent
33563ba6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
4 deletions
+38
-4
QueryPara.java
yzg-util-db/src/main/java/com/yanzuoguang/dao/QueryPara.java
+26
-3
BaseDaoSql.java
...db/src/main/java/com/yanzuoguang/dao/impl/BaseDaoSql.java
+12
-1
No files found.
yzg-util-db/src/main/java/com/yanzuoguang/dao/QueryPara.java
View file @
69de31a3
...
@@ -6,22 +6,37 @@ import io.swagger.annotations.ApiModelProperty;
...
@@ -6,22 +6,37 @@ import io.swagger.annotations.ApiModelProperty;
/**
/**
* 查询参数
* 查询参数
*
*
* @author
颜佐光
* @author
颜佐光
*/
*/
@ApiModel
(
description
=
"查询参数"
)
@ApiModel
(
description
=
"查询参数"
)
public
class
QueryPara
{
public
class
QueryPara
{
/**
* 查询删除
*/
public
static
QueryPara
LOAD_REMOVE
=
new
QueryPara
(
false
,
true
);
/**
/**
* 所有条件生效
* 所有条件生效
*/
*/
public
static
QueryPara
FULL_COND
=
new
QueryPara
(
true
);
public
static
QueryPara
FULL_COND
=
new
QueryPara
(
true
,
false
);
/**
/**
* 所有条件生效
* 所有条件生效
*/
*/
@ApiModelProperty
(
notes
=
"所有条件生效,而不仅仅在主键存在时,通过主键加载"
)
@ApiModelProperty
(
notes
=
"所有条件生效,而不仅仅在主键存在时,通过主键加载"
)
private
boolean
fullCond
;
private
boolean
fullCond
;
public
QueryPara
(
boolean
fullCond
)
{
/**
* 查询删除标记的结果
*/
@ApiModelProperty
(
notes
=
"在数据通过删除标记删除时,可以通过该参数查询出来"
)
private
boolean
loadRemove
;
public
QueryPara
(
boolean
fullCond
,
boolean
loadRemove
)
{
this
.
fullCond
=
fullCond
;
this
.
fullCond
=
fullCond
;
this
.
loadRemove
=
loadRemove
;
}
}
public
boolean
isFullCond
()
{
public
boolean
isFullCond
()
{
...
@@ -31,4 +46,12 @@ public class QueryPara {
...
@@ -31,4 +46,12 @@ public class QueryPara {
public
void
setFullCond
(
boolean
fullCond
)
{
public
void
setFullCond
(
boolean
fullCond
)
{
this
.
fullCond
=
fullCond
;
this
.
fullCond
=
fullCond
;
}
}
public
boolean
isLoadRemove
()
{
return
loadRemove
;
}
public
void
setLoadRemove
(
boolean
loadRemove
)
{
this
.
loadRemove
=
loadRemove
;
}
}
}
yzg-util-db/src/main/java/com/yanzuoguang/dao/impl/BaseDaoSql.java
View file @
69de31a3
...
@@ -213,7 +213,18 @@ public abstract class BaseDaoSql {
...
@@ -213,7 +213,18 @@ public abstract class BaseDaoSql {
* @param copy 是否复制
* @param copy 是否复制
*/
*/
protected
SqlData
getSqlQueryPara
(
SqlData
sqlData
,
QueryPara
queryPara
,
boolean
copy
)
{
protected
SqlData
getSqlQueryPara
(
SqlData
sqlData
,
QueryPara
queryPara
,
boolean
copy
)
{
return
sqlData
;
SqlData
copyTo
=
sqlData
;
if
(
queryPara
!=
null
&&
queryPara
.
isLoadRemove
())
{
TableFieldVo
remove
=
this
.
table
.
getTable
().
getRemove
();
SqlDataField
field
=
copyTo
.
getField
(
remove
.
inputName
);
if
(
field
!=
null
)
{
if
(
copy
)
{
copyTo
=
sqlData
.
copy
();
}
copyTo
.
removeField
(
remove
.
inputName
);
}
}
return
copyTo
;
}
}
/**
/**
...
...
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