Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
midjourney-proxy
Overview
Overview
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
徐少华
midjourney-proxy
Commits
67cd11ad
Commit
67cd11ad
authored
Dec 03, 2020
by
tc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feature:[none] 优化公共方法
parent
f575b55b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletions
+7
-1
ListUtils.java
...mmon/src/main/java/com/pcloud/common/utils/ListUtils.java
+7
-1
No files found.
pcloud-common/src/main/java/com/pcloud/common/utils/ListUtils.java
View file @
67cd11ad
...
@@ -6,6 +6,7 @@ package com.pcloud.common.utils;
...
@@ -6,6 +6,7 @@ package com.pcloud.common.utils;
import
org.apache.poi.ss.formula.functions.T
;
import
org.apache.poi.ss.formula.functions.T
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -69,6 +70,9 @@ public class ListUtils {
...
@@ -69,6 +70,9 @@ public class ListUtils {
}
}
public
static
<
T
>
List
<
T
>
groupList4SQL
(
ListForInSQL
<
T
>
listForInSQL
,
List
<
Long
>
idList
){
public
static
<
T
>
List
<
T
>
groupList4SQL
(
ListForInSQL
<
T
>
listForInSQL
,
List
<
Long
>
idList
){
HashSet
<
Long
>
idSet
=
new
HashSet
<>(
idList
);
idList
.
clear
();
idList
.
addAll
(
idSet
);
List
<
T
>
result
=
new
ArrayList
<>();
List
<
T
>
result
=
new
ArrayList
<>();
if
(
idList
!=
null
&&
idList
.
size
()>
500
){
if
(
idList
!=
null
&&
idList
.
size
()>
500
){
List
<
List
<
Long
>>
lists
=
groupList
(
idList
);
List
<
List
<
Long
>>
lists
=
groupList
(
idList
);
...
@@ -77,8 +81,10 @@ public class ListUtils {
...
@@ -77,8 +81,10 @@ public class ListUtils {
result
.
addAll
(
tempList
);
result
.
addAll
(
tempList
);
}
}
return
result
;
return
result
;
}
else
{
}
else
if
(
idList
!=
null
&&
idList
.
size
()>
0
)
{
return
listForInSQL
.
processSQL
(
idList
);
return
listForInSQL
.
processSQL
(
idList
);
}
else
{
return
new
ArrayList
<>();
}
}
}
}
...
...
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