Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yd-backend
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
AutogeneralShanghai
yd-backend
Commits
60946daa
Commit
60946daa
authored
Oct 13, 2021
by
wenyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ydLief寿险公告信息排序调整(序号按大到小排序,并且置顶的排序到最前面)
parent
40cb2648
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
7 deletions
+18
-7
yd-api/src/main/java/com/yd/dal/service/marketing/Impl/MktAnnouncementDALServiceImpl.java
+18
-7
No files found.
yd-api/src/main/java/com/yd/dal/service/marketing/Impl/MktAnnouncementDALServiceImpl.java
View file @
60946daa
package
com
.
yd
.
dal
.
service
.
marketing
.
Impl
;
import
java.util.Date
;
import
java.util.List
;
import
javax.annotation.Resource
;
import
org.apache.commons.beanutils.BeanPropertyValueEqualsPredicate
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.stereotype.Service
;
import
com.github.pagehelper.Page
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.yd.dal.entity.marketing.MktAnnouncement
;
import
com.yd.dal.entity.marketing.MktLeadsAssignedTrack
;
import
com.yd.dal.mapper.marketing.MktAnnouncementMapper
;
import
com.yd.dal.service.marketing.MktAnnouncementDALService
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.util.Date
;
import
java.util.List
;
@Service
(
"mktAnnouncementDALService"
)
public
class
MktAnnouncementDALServiceImpl
implements
MktAnnouncementDALService
{
...
...
@@ -24,14 +27,22 @@ public class MktAnnouncementDALServiceImpl implements MktAnnouncementDALService
}
@Override
@SuppressWarnings
(
"unchecked"
)
public
List
<
MktAnnouncement
>
findByType
(
Long
announcementType
)
{
MktAnnouncement
info
=
new
MktAnnouncement
();
info
.
setAnnouncementType
(
announcementType
);
info
.
setIsActive
(
1
);
PageHelper
.
orderBy
(
"seq
a
sc , created_at desc"
);
PageHelper
.
orderBy
(
"seq
de
sc , created_at desc"
);
Page
<
MktAnnouncement
>
mktAnnouncementPageInfo
=
mktAnnouncementMapper
.
selectByObj
(
info
);
PageInfo
<
MktAnnouncement
>
pageInfo
=
new
PageInfo
<>(
mktAnnouncementPageInfo
);
List
<
MktAnnouncement
>
list
=
pageInfo
.
getList
();
BeanPropertyValueEqualsPredicate
predicateClause
=
new
BeanPropertyValueEqualsPredicate
(
"seq"
,
0
);
List
<
MktAnnouncement
>
listTop
=
(
List
<
MktAnnouncement
>)
CollectionUtils
.
select
(
list
,
predicateClause
);
if
(
listTop
!=
null
&&
listTop
.
size
()
>
0
){
list
.
removeAll
(
listTop
);
listTop
.
addAll
(
list
);
return
listTop
;
}
return
list
;
}
...
...
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