Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gs1-office-web-sit
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
吴迪
gs1-office-web-sit
Commits
b11571a2
Commit
b11571a2
authored
Dec 14, 2021
by
rongkailun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【修改】资讯中心相关链接 关键字支持半角/全角逗号
parent
440c8ca9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
2 deletions
+21
-2
NewsServiceImpl.java
...o/office/modules/manage/service/impl/NewsServiceImpl.java
+17
-1
NewsDao.xml
src/main/resources/mapper/manage/NewsDao.xml
+4
-1
No files found.
src/main/java/io/office/modules/manage/service/impl/NewsServiceImpl.java
View file @
b11571a2
...
...
@@ -2,11 +2,11 @@ package io.office.modules.manage.service.impl;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.qiniu.util.StringUtils
;
import
io.office.common.utils.R
;
import
io.office.modules.manage.entity.*
;
import
io.office.modules.manage.entity.dto.NewsParams
;
import
io.office.modules.sys.entity.SysUserEntity
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -503,6 +503,22 @@ public class NewsServiceImpl extends ServiceImpl<NewsDao, NewsEntity> implements
@Override
public
List
<
NewsEntity
>
relatedLinks
(
Map
<
String
,
Object
>
params
)
{
StringBuffer
stringBuffer
=
new
StringBuffer
();
if
(
params
.
containsKey
(
"keyword"
)){
if
(
StringUtils
.
isNotBlank
(
String
.
valueOf
(
params
.
get
(
"keyword"
)))){
String
[]
keywords
=
params
.
get
(
"keyword"
).
toString
().
split
(
","
).
length
==
0
?
params
.
get
(
"keyword"
).
toString
().
split
(
","
)
:
params
.
get
(
"keyword"
).
toString
().
split
(
","
);
int
length
=
keywords
.
length
;
for
(
int
i
=
0
;
i
<
length
;
i
++)
{
stringBuffer
.
append
(
"keyword LIKE concat ('%','"
)
.
append
(
keywords
[
i
]).
append
(
"', '%')"
);
if
(
i
!=
length
-
1
){
stringBuffer
.
append
(
" or "
);
}
}
params
.
put
(
"sql"
,
stringBuffer
.
toString
());
}
}
List
<
NewsEntity
>
list
=
this
.
newsDao
.
relatedLinks
(
params
);
return
list
;
}
...
...
src/main/resources/mapper/manage/NewsDao.xml
View file @
b11571a2
...
...
@@ -602,7 +602,9 @@ WHERE
levels > 0
AND status = 1
AND Id != #{id}
AND keyword LIKE concat ('%', #{keyword}, '%')
<if
test=
"sql !=null"
>
AND (${sql})
</if>
order by releasedate desc
</select>
</mapper>
\ No newline at end of file
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