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
c97fcc31
Commit
c97fcc31
authored
Jun 12, 2020
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
压缩视频
parent
c28c17f4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
14 deletions
+20
-14
TableSqlCache.java
...src/main/java/com/yanzuoguang/dao/impl/TableSqlCache.java
+4
-4
TableStruct.java
...b/src/main/java/com/yanzuoguang/dao/impl/TableStruct.java
+16
-10
No files found.
yzg-util-db/src/main/java/com/yanzuoguang/dao/impl/TableSqlCache.java
View file @
c97fcc31
...
...
@@ -275,11 +275,11 @@ public class TableSqlCache {
/**
* 生成该字段值是否存在的SQL语句
*
* @param sqlName SQL语句名称
* @param
fields
字段
* @param sqlName
SQL语句名称
* @param
allowNullField 允许为空
字段
*/
public
void
addExist
(
String
sqlName
,
String
...
fields
)
{
this
.
addExist
(
sqlName
,
null
,
new
TableFieldString
(
fields
));
public
void
addExist
(
String
sqlName
,
String
...
allowNullField
)
{
this
.
addExist
(
sqlName
,
null
,
new
TableFieldString
(
allowNullField
));
}
/**
...
...
yzg-util-db/src/main/java/com/yanzuoguang/dao/impl/TableStruct.java
View file @
c97fcc31
...
...
@@ -695,18 +695,24 @@ public class TableStruct {
String
.
format
(
DaoConst
.
CODE_WHERE_NOT_EQUALS_PARA
,
this
.
getKey
().
name
)
);
for
(
String
fieldName
:
mustField
.
getFields
())
{
TableFieldVo
field
=
this
.
getField
(
fieldName
);
sql
.
addConst
(
field
.
inputName
,
String
.
format
(
DaoConst
.
CODE_WHERE_EQUALS_PARA
,
field
.
name
)
);
// 必须判断的字段
if
(
mustField
!=
null
&&
mustField
.
getFields
()
!=
null
)
{
for
(
String
fieldName
:
mustField
.
getFields
())
{
TableFieldVo
field
=
this
.
getField
(
fieldName
);
sql
.
addConst
(
field
.
inputName
,
String
.
format
(
DaoConst
.
CODE_WHERE_EQUALS_PARA
,
field
.
name
)
);
}
}
for
(
String
fieldName
:
allowNullField
.
getFields
())
{
TableFieldVo
field
=
this
.
getField
(
fieldName
);
sql
.
addConst
(
field
.
inputName
,
String
.
format
(
DaoConst
.
CODE_WHERE_EQUALS_NOT_EMPTY_PARA
,
field
.
name
)
);
// 允许空值的字段
if
(
allowNullField
!=
null
&&
allowNullField
.
getFields
()
!=
null
)
{
for
(
String
fieldName
:
allowNullField
.
getFields
())
{
TableFieldVo
field
=
this
.
getField
(
fieldName
);
sql
.
addConst
(
field
.
inputName
,
String
.
format
(
DaoConst
.
CODE_WHERE_EQUALS_NOT_EMPTY_PARA
,
field
.
name
)
);
}
}
addWhereRemove
(
sql
);
sqlTableData
.
add
(
sql
);
...
...
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