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
b1256682
Commit
b1256682
authored
Jun 14, 2020
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
压缩视频
parent
87e4264f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
14 deletions
+12
-14
StringHelper.java
...c/main/java/com/yanzuoguang/util/helper/StringHelper.java
+5
-11
SqlCondEquals.java
...src/main/java/com/yanzuoguang/dao/cond/SqlCondEquals.java
+7
-3
No files found.
yzg-util-base/src/main/java/com/yanzuoguang/util/helper/StringHelper.java
View file @
b1256682
...
...
@@ -73,20 +73,14 @@ public class StringHelper {
if
(
val
==
null
)
{
return
true
;
}
boolean
isArray
=
val
instanceof
List
||
val
.
getClass
().
isArray
();
// 判断是否属于数组
boolean
isArray
=
ArrayHelper
.
isArrayOrList
(
val
);
// 不是数组,则为常规值
if
(!
isArray
)
{
return
false
;
}
List
list
;
// 判断处理
if
(
val
instanceof
List
)
{
list
=
(
List
)
val
;
}
else
{
Object
[]
arr
=
(
Object
[])
val
;
list
=
Arrays
.
asList
(
arr
);
}
int
length
=
list
.
size
();
return
length
==
0
;
List
list
=
ArrayHelper
.
getList
(
val
);
return
list
.
isEmpty
();
}
/**
...
...
yzg-util-db/src/main/java/com/yanzuoguang/dao/cond/SqlCondEquals.java
View file @
b1256682
...
...
@@ -2,6 +2,7 @@ package com.yanzuoguang.dao.cond;
import
com.yanzuoguang.dao.impl.SqlDataField
;
import
com.yanzuoguang.util.base.ObjectHelper
;
import
com.yanzuoguang.util.helper.ArrayHelper
;
import
com.yanzuoguang.util.helper.StringHelper
;
import
java.util.Arrays
;
...
...
@@ -43,9 +44,12 @@ public class SqlCondEquals extends SqlCondBase<SqlCondEquals> {
if
(
StringHelper
.
isEmpty
(
val
)
||
StringHelper
.
isEmptyArray
(
val
))
{
continue
;
}
if
(
StringHelper
.
compare
(
val
,
this
.
val
))
{
// 只要有值不为空,则条件满足
return
COND_TYPE_CODE_COND
;
List
list
=
ArrayHelper
.
getList
(
val
);
for
(
Object
item
:
list
)
{
if
(
StringHelper
.
compare
(
item
,
this
.
val
))
{
// 只要有值不为空,则条件满足
return
COND_TYPE_CODE_COND
;
}
}
}
}
...
...
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