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
625b0a0c
Commit
625b0a0c
authored
Dec 15, 2021
by
吴迪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【修改】高级查询修改
parent
9cd35792
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
10 deletions
+25
-10
NewsController.java
...a/io/office/modules/manage/controller/NewsController.java
+1
-1
NewsDao.java
src/main/java/io/office/modules/manage/dao/NewsDao.java
+1
-1
NewsService.java
...in/java/io/office/modules/manage/service/NewsService.java
+1
-1
NewsServiceImpl.java
...o/office/modules/manage/service/impl/NewsServiceImpl.java
+12
-4
NewsDao.xml
src/main/resources/mapper/manage/NewsDao.xml
+10
-3
No files found.
src/main/java/io/office/modules/manage/controller/NewsController.java
View file @
625b0a0c
...
...
@@ -535,7 +535,7 @@ public class NewsController extends AbstractController {
@RequestMapping
(
"/api/getSearchInfo"
)
// @RequiresPermissions("manage:product:findPage")
public
R
getSearchInfo
(
@RequestBody
Map
<
String
,
String
>
param
)
{
Page
<
SearchVo
>
pag
=
this
.
newsService
.
getSearchInfo
(
param
.
get
(
"name"
)
==
null
?
null
:
param
.
get
(
"name"
),
Page
<
SearchVo
>
pag
=
this
.
newsService
.
getSearchInfo
(
param
.
get
(
"name"
)
==
null
?
null
:
param
.
get
(
"name"
),
param
.
get
(
"type"
)
==
null
?
null
:
param
.
get
(
"type"
),
new
Page
(
Integer
.
valueOf
(
param
.
get
(
"page"
)),
Integer
.
valueOf
(
param
.
get
(
"size"
))));
PageUtils
pageUtils
=
new
PageUtils
(
pag
);
...
...
src/main/java/io/office/modules/manage/dao/NewsDao.java
View file @
625b0a0c
...
...
@@ -94,5 +94,5 @@ public interface NewsDao extends BaseMapper<NewsEntity> {
List
<
NewsEntity
>
relatedLinks
(
Map
<
String
,
Object
>
params
);
List
<
SearchVo
>
getSearchInfo
(
@Param
(
"name"
)
String
name
,
Page
page
);
List
<
SearchVo
>
getSearchInfo
(
@Param
(
"name"
)
String
name
,
@Param
(
"type"
)
String
type
,
Page
page
);
}
src/main/java/io/office/modules/manage/service/NewsService.java
View file @
625b0a0c
...
...
@@ -92,6 +92,6 @@ public interface NewsService extends IService<NewsEntity> {
List
<
NewsEntity
>
relatedLinks
(
Map
<
String
,
Object
>
params
);
Page
<
SearchVo
>
getSearchInfo
(
String
name
,
Page
page
);
Page
<
SearchVo
>
getSearchInfo
(
String
name
,
String
type
,
Page
page
);
}
src/main/java/io/office/modules/manage/service/impl/NewsServiceImpl.java
View file @
625b0a0c
...
...
@@ -542,12 +542,20 @@ public class NewsServiceImpl extends ServiceImpl<NewsDao, NewsEntity> implements
@Override
public
Page
<
SearchVo
>
getSearchInfo
(
String
name
,
Page
page
)
{
List
<
SearchVo
>
list
=
this
.
newsDao
.
getSearchInfo
(
name
,
page
);
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
for
(
SearchVo
searchVo
:
list
)
{
public
Page
<
SearchVo
>
getSearchInfo
(
String
name
,
String
type
,
Page
page
)
{
if
(
StringUtils
.
isNotBlank
(
type
)&&
type
.
indexOf
(
","
)>-
1
)
{
String
[]
splitStr
=
type
.
split
(
","
);
String
finalStr
=
""
;
for
(
String
s
:
splitStr
)
{
finalStr
=
s
+
","
;
}
type
=
finalStr
.
substring
(
0
,
finalStr
.
length
()-
1
);
}
List
<
SearchVo
>
list
=
this
.
newsDao
.
getSearchInfo
(
name
,
type
,
page
);
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
for
(
SearchVo
searchVo
:
list
)
{
if
(
StringUtils
.
isNotBlank
(
searchVo
.
getContent
()))
{
searchVo
.
setContent
(
searchVo
.
getContent
().
replaceAll
(
name
,
"<font color='red'>"
+
name
+
"</font>"
));
}
...
...
src/main/resources/mapper/manage/NewsDao.xml
View file @
625b0a0c
...
...
@@ -611,9 +611,16 @@ order by releasedate desc
<select
id=
"getSearchInfo"
parameterType=
"string"
resultType=
"io.office.modules.manage.vo.response.SearchVo"
>
select * from NewsSearch
<if
test=
"name!=null and name!=''"
>
where (title like concat('%',#{name},'%') or keyword like concat('%',#{name},'%') or content like concat('%',#{name},'%'))
</if>
<where>
<if
test=
"name!=null and name!=''"
>
(title like concat('%',#{name},'%') or keyword like concat('%',#{name},'%') or content like concat('%',#{name},'%'))
</if>
<if
test=
"type!=null and type!=''"
>
and type in (${type})
</if>
</where>
</select>
...
...
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