Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cash-loan-flow-boss
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
QG
cash-loan-flow-boss
Commits
a2938672
Commit
a2938672
authored
Aug 06, 2019
by
suntao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
channel 查询
parent
7614df4a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
19 deletions
+26
-19
ChannelConfigurationRepository.java
...hannel/repository/clf/ChannelConfigurationRepository.java
+2
-12
ChannelConfService.java
...hloanflowboss/api/channel/service/ChannelConfService.java
+24
-7
No files found.
src/main/java/cn/quantgroup/cashloanflowboss/api/channel/repository/clf/ChannelConfigurationRepository.java
View file @
a2938672
...
...
@@ -2,21 +2,11 @@ package cn.quantgroup.cashloanflowboss.api.channel.repository.clf;
import
cn.quantgroup.cashloanflowboss.api.channel.entity.clf.ChannelConfiguration
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.jpa.repository.JpaSpecificationExecutor
;
import
org.springframework.data.repository.PagingAndSortingRepository
;
import
org.springframework.stereotype.Repository
;
@Repository
public
interface
ChannelConfigurationRepository
extends
PagingAndSortingRepository
<
ChannelConfiguration
,
String
>
{
/**
* 获取用户列表(分页)
*
* @param pageable 分页
* @return
*/
Page
<
ChannelConfiguration
>
findAllBy
(
Pageable
pageable
);
ChannelConfiguration
findByRegisteredFrom
(
Integer
channelId
);
public
interface
ChannelConfigurationRepository
extends
PagingAndSortingRepository
<
ChannelConfiguration
,
Long
>,
JpaSpecificationExecutor
<
ChannelConfiguration
>
{
}
src/main/java/cn/quantgroup/cashloanflowboss/api/channel/service/ChannelConfService.java
View file @
a2938672
...
...
@@ -12,6 +12,11 @@ import org.springframework.data.domain.Page;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.stereotype.Service
;
import
javax.persistence.criteria.Predicate
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Objects
;
/**
* function:
* date: 2019/8/2
...
...
@@ -31,13 +36,25 @@ public class ChannelConfService {
public
Page
<
ChannelConfiguration
>
getChannelInfo
(
Pagination
pagination
,
Integer
channelId
)
{
if
(
channelId
==
null
)
{
return
clfChannelConfigurationRepository
.
findAllBy
(
new
PageRequest
(
pagination
.
getPageNumber
(),
pagination
.
getPageSize
()));
}
else
{
ChannelConfiguration
channelConfiguration
=
clfChannelConfigurationRepository
.
findByRegisteredFrom
(
channelId
);
Page
<
ChannelConfiguration
>
result
=
null
;
return
null
;
}
Page
<
ChannelConfiguration
>
page
=
this
.
clfChannelConfigurationRepository
.
findAll
((
root
,
criteriaQuery
,
criteriaBuilder
)
->
{
List
<
Predicate
>
predicates
=
new
ArrayList
<>();
// 指定渠道号
if
(
Objects
.
nonNull
(
channelId
))
{
predicates
.
add
(
criteriaBuilder
.
equal
(
root
.
get
(
"channelId"
),
channelId
));
}
// 指定排序
criteriaQuery
.
orderBy
(
criteriaBuilder
.
desc
(
root
.
get
(
"id"
)));
return
criteriaQuery
.
getRestriction
();
},
new
PageRequest
(
pagination
.
getPageNumber
(),
pagination
.
getPageSize
()));
return
page
;
}
...
...
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