Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
B
BasicAPI
Project
Project
Details
Activity
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
杜科
BasicAPI
Commits
e27fad09
Commit
e27fad09
authored
Feb 21, 2023
by
shyWang
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
524c07dd
abe4e95a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
126 additions
and
34 deletions
+126
-34
SearchItem.java
src/com/yonde/basedata/search/SearchItem.java
+126
-34
No files found.
src/com/yonde/basedata/search/SearchItem.java
View file @
e27fad09
package
com
.
yonde
.
basedata
.
search
;
package
com
.
yonde
.
basedata
.
search
;
import
com.yonde.basedata.data.DxEnumData
;
import
com.yonde.basedata.data.DxEnumData
;
import
org.apache.commons.lang.builder.ToStringBuilder
;
import
org.apache.commons.lang.builder.ToStringStyle
;
import
java.io.Serializable
;
import
java.io.Serializable
;
public
class
SearchItem
implements
Serializable
{
public
class
SearchItem
implements
Serializable
{
public
enum
Operator
{
EQ
(
0
,
"等于"
),
NEQ
(
1
,
"不等于"
),
LIKE
(
2
,
"模糊查询"
),
GT
(
3
,
"大于"
),
LT
(
4
,
"小于"
),
GTE
(
5
,
"大于等于"
),
LTE
(
6
,
"小于等于"
),
BTWN
(
7
,
"范围查询"
),
IN
(
8
,
"多值查询"
);
/**
* code编码
*/
final
int
code
;
/**
* 获取名称
*/
final
String
value
;
public
int
getCode
()
{
return
code
;
}
public
String
getValue
()
{
return
value
;
}
private
Operator
(
int
code
,
String
value
)
{
this
.
code
=
code
;
this
.
value
=
value
;
}
}
public
String
fieldName
;
public
String
fieldName
;
public
Object
value
;
public
Object
value
;
public
Object
value1
;
public
Object
value1
;
public
String
operator
;
public
Operator
operator
;
public
String
searchItemType
;
public
String
searchItemType
;
public
SearchItem
()
{
public
String
getFieldName
()
{
return
fieldName
;
}
}
public
SearchItem
(
String
fieldName
,
String
operator
,
Object
value
,
Object
value1
)
{
public
void
setFieldName
(
String
fieldName
)
{
this
.
fieldName
=
fieldName
;
this
.
fieldName
=
fieldName
;
}
public
Object
getValue
()
{
return
value
;
}
public
void
setValue
(
Object
value
)
{
this
.
value
=
value
;
this
.
value
=
value
;
this
.
operator
=
operator
;
}
public
Object
getValue1
()
{
return
value1
;
}
public
void
setValue1
(
Object
value1
)
{
this
.
value1
=
value1
;
this
.
value1
=
value1
;
}
}
public
enum
Operator
implements
DxEnumData
{
public
Operator
getOperator
()
{
EQ
(
1
,
"等于"
),
return
operator
;
NEQ
(
2
,
"不等于"
),
}
LIKE
(
3
,
"模糊查询"
),
GT
(
4
,
"大于"
),
LT
(
5
,
"小于"
),
GTE
(
6
,
"大于等于"
),
LTE
(
7
,
"小于等于"
),
BTWN
(
8
,
"范围查询"
),
IN
(
9
,
"in"
),
ISNULL
(
10
,
"空值查询"
),
NOTNULL
(
11
,
"非空查询"
),
FULLLIKE
(
12
,
"全模糊查询"
),
NOTIN
(
13
,
"非集合查询"
);
final
String
code
;
final
String
value
;
Operator
(
int
code
,
String
value
)
{
public
void
setOperator
(
Operator
operator
)
{
this
.
code
=
String
.
format
(
"%04d"
,
code
);
this
.
operator
=
operator
;
this
.
value
=
value
;
}
}
public
String
getCod
e
()
{
public
String
getSearchItemTyp
e
()
{
return
this
.
cod
e
;
return
searchItemTyp
e
;
}
}
public
String
getValue
(
)
{
public
void
setSearchItemType
(
String
searchItemType
)
{
return
this
.
valu
e
;
this
.
searchItemType
=
searchItemTyp
e
;
}
}
Operator
(
String
code
,
String
value
)
{
public
SearchItem
()
{
this
.
code
=
code
;
}
public
SearchItem
(
String
fieldName
,
Operator
operator
,
Object
value
,
Object
value1
)
{
this
.
fieldName
=
fieldName
;
this
.
value
=
value
;
this
.
value
=
value
;
this
.
operator
=
operator
;
this
.
value1
=
value1
;
}
}
@Override
public
SearchItem
clone
()
throws
CloneNotSupportedException
{
return
(
SearchItem
)
super
.
clone
();
}
@Override
public
int
hashCode
()
{
final
int
prime
=
31
;
int
result
=
1
;
result
=
prime
*
result
+
((
fieldName
==
null
)
?
0
:
fieldName
.
hashCode
());
result
=
prime
*
result
+
((
operator
==
null
)
?
0
:
operator
.
hashCode
());
result
=
prime
*
result
+
((
searchItemType
==
null
)
?
0
:
searchItemType
.
hashCode
());
result
=
prime
*
result
+
((
value
==
null
)
?
0
:
value
.
hashCode
());
result
=
prime
*
result
+
((
value1
==
null
)
?
0
:
value1
.
hashCode
());
return
result
;
}
}
@Override
public
boolean
equals
(
Object
obj
)
{
if
(
this
==
obj
)
return
true
;
if
(
obj
==
null
)
return
false
;
if
(
getClass
()
!=
obj
.
getClass
())
return
false
;
SearchItem
other
=
(
SearchItem
)
obj
;
if
(
fieldName
==
null
)
{
if
(
other
.
fieldName
!=
null
)
return
false
;
}
else
if
(!
fieldName
.
equals
(
other
.
fieldName
))
return
false
;
if
(
operator
!=
other
.
operator
)
return
false
;
if
(
searchItemType
==
null
)
{
if
(
other
.
searchItemType
!=
null
)
return
false
;
}
else
if
(!
searchItemType
.
equals
(
other
.
searchItemType
))
return
false
;
if
(
value
==
null
)
{
if
(
other
.
value
!=
null
)
return
false
;
}
else
if
(!
value
.
equals
(
other
.
value
))
return
false
;
if
(
value1
==
null
)
{
if
(
other
.
value1
!=
null
)
return
false
;
}
else
if
(!
value1
.
equals
(
other
.
value1
))
return
false
;
return
true
;
}
@Override
public
String
toString
()
{
return
ToStringBuilder
.
reflectionToString
(
this
,
ToStringStyle
.
DEFAULT_STYLE
);
}
}
}
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