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
3acbb7e0
Commit
3acbb7e0
authored
Dec 12, 2021
by
rongkailun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【新增】知识检索新增分页接口
parent
aacc9510
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
128 additions
and
0 deletions
+128
-0
NewsController.java
...a/io/office/modules/manage/controller/NewsController.java
+10
-0
NewsDao.java
src/main/java/io/office/modules/manage/dao/NewsDao.java
+1
-0
NewsService.java
...in/java/io/office/modules/manage/service/NewsService.java
+1
-0
NewsServiceImpl.java
...o/office/modules/manage/service/impl/NewsServiceImpl.java
+100
-0
NewsDao.xml
src/main/resources/mapper/manage/NewsDao.xml
+16
-0
No files found.
src/main/java/io/office/modules/manage/controller/NewsController.java
View file @
3acbb7e0
...
...
@@ -391,5 +391,15 @@ public class NewsController extends AbstractController {
return
R
.
ok
().
put
(
"data"
,
list
);
}
/**知识检索分页列表*/
@Login
@PostMapping
(
"/api/searchKnowledgePageList"
)
public
R
searchKnowledgePageList
(
@RequestBody
NewsParams
params
)
{
Page
<
List
<
Map
<
String
,
Object
>>>
page
=
this
.
newsService
.
searchKnowledgePageList
(
params
,
new
Page
(
params
.
getPage
(),
params
.
getLimit
()));
PageUtils
pageUtils
=
new
PageUtils
(
page
);
return
R
.
ok
().
put
(
"data"
,
pageUtils
);
}
}
src/main/java/io/office/modules/manage/dao/NewsDao.java
View file @
3acbb7e0
...
...
@@ -74,4 +74,5 @@ public interface NewsDao extends BaseMapper<NewsEntity> {
List
<
NewsEntity
>
newsTop10
();
List
<
Map
<
String
,
Object
>>
searchKnowledgeInfoNewList
(
@Param
(
"params"
)
Map
<
String
,
Object
>
map
,
Page
page
);
}
src/main/java/io/office/modules/manage/service/NewsService.java
View file @
3acbb7e0
...
...
@@ -73,5 +73,6 @@ public interface NewsService extends IService<NewsEntity> {
List
<
NewsEntity
>
newsTop10
();
Page
<
List
<
Map
<
String
,
Object
>>>
searchKnowledgePageList
(
NewsParams
params
,
Page
page
);
}
src/main/java/io/office/modules/manage/service/impl/NewsServiceImpl.java
View file @
3acbb7e0
...
...
@@ -364,6 +364,106 @@ public class NewsServiceImpl extends ServiceImpl<NewsDao, NewsEntity> implements
return
list
;
}
@Override
public
Page
<
List
<
Map
<
String
,
Object
>>>
searchKnowledgePageList
(
NewsParams
newsParams
,
Page
page
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
if
(
"sptm"
.
equals
(
newsParams
.
getType
())){
map
=
new
HashMap
<>();
map
.
put
(
"name"
,
"40"
);
List
<
String
>
child
=
getChild
(
map
);
map
.
put
(
"list"
,
child
);
map
.
put
(
"typeName"
,
"sptm"
);
map
.
put
(
"title"
,
newsParams
.
getTitle
());
List
<
Map
<
String
,
Object
>>
dataList
=
getDataListNew
(
map
,
page
);
page
.
setRecords
(
dataList
);
}
else
if
(
"ewtm"
.
equals
(
newsParams
.
getType
())){
map
=
new
HashMap
<>();
map
.
put
(
"name"
,
"45"
);
map
.
put
(
"title"
,
newsParams
.
getTitle
());
List
<
String
>
child
=
getChild
(
map
);
map
.
put
(
"list"
,
child
);
map
.
put
(
"typeName"
,
"ewtm"
);
List
<
Map
<
String
,
Object
>>
dataList
=
getDataListNew
(
map
,
page
);
page
.
setRecords
(
dataList
);
}
else
if
(
"zxcbm"
.
equals
(
newsParams
.
getType
())){
map
=
new
HashMap
<>();
map
.
put
(
"name"
,
"93"
);
map
.
put
(
"title"
,
newsParams
.
getTitle
());
List
<
String
>
child
=
getChild
(
map
);
map
.
put
(
"list"
,
child
);
map
.
put
(
"typeName"
,
"zxcbm"
);
List
<
Map
<
String
,
Object
>>
dataList
=
getDataListNew
(
map
,
page
);
page
.
setRecords
(
dataList
);
}
else
if
(
"dwbm"
.
equals
(
newsParams
.
getType
())){
map
=
new
HashMap
<>();
map
.
put
(
"name"
,
"94"
);
map
.
put
(
"title"
,
newsParams
.
getTitle
());
List
<
String
>
child
=
getChild
(
map
);
map
.
put
(
"list"
,
child
);
map
.
put
(
"title"
,
"dwbm"
);
List
<
Map
<
String
,
Object
>>
dataList
=
getDataListNew
(
map
,
page
);
page
.
setRecords
(
dataList
);
}
else
if
(
"gln"
.
equals
(
newsParams
.
getType
())){
map
=
new
HashMap
<>();
map
.
put
(
"name"
,
"95"
);
map
.
put
(
"title"
,
newsParams
.
getTitle
());
List
<
String
>
child
=
getChild
(
map
);
map
.
put
(
"list"
,
child
);
map
.
put
(
"typeName"
,
"gln"
);
List
<
Map
<
String
,
Object
>>
dataList
=
getDataListNew
(
map
,
page
);
page
.
setRecords
(
dataList
);
}
else
if
(
"epc"
.
equals
(
newsParams
.
getType
())){
map
=
new
HashMap
<>();
map
.
put
(
"name"
,
"83"
);
map
.
put
(
"title"
,
newsParams
.
getTitle
());
List
<
String
>
child
=
getChild
(
map
);
map
.
put
(
"list"
,
child
);
List
<
Map
<
String
,
Object
>>
dataList
=
getDataListNew
(
map
,
page
);
page
.
setRecords
(
dataList
);
}
else
if
(
"rfid"
.
equals
(
newsParams
.
getType
())){
map
=
new
HashMap
<>();
map
.
put
(
"name"
,
"77"
);
map
.
put
(
"title"
,
newsParams
.
getTitle
());
List
<
String
>
child
=
getChild
(
map
);
map
.
put
(
"list"
,
child
);
List
<
Map
<
String
,
Object
>>
dataList
=
getDataListNew
(
map
,
page
);
page
.
setRecords
(
dataList
);
}
else
if
(
"gds"
.
equals
(
newsParams
.
getType
())){
map
=
new
HashMap
<>();
map
.
put
(
"name"
,
"85"
);
map
.
put
(
"title"
,
newsParams
.
getTitle
());
List
<
String
>
child
=
getChild
(
map
);
map
.
put
(
"list"
,
child
);
map
.
put
(
"typeName"
,
"gds"
);
List
<
Map
<
String
,
Object
>>
dataList
=
getDataListNew
(
map
,
page
);
page
.
setRecords
(
dataList
);
}
else
if
(
"ecr"
.
equals
(
newsParams
.
getType
())){
map
=
new
HashMap
<>();
map
.
put
(
"name"
,
"81"
);
map
.
put
(
"title"
,
newsParams
.
getTitle
());
List
<
String
>
child
=
getChild
(
map
);
map
.
put
(
"list"
,
child
);
map
.
put
(
"typeName"
,
"ecr"
);
List
<
Map
<
String
,
Object
>>
dataList
=
getDataListNew
(
map
,
page
);
page
.
setRecords
(
dataList
);
}
else
if
(
"ebXML"
.
equals
(
newsParams
.
getType
())){
map
=
new
HashMap
<>();
map
.
put
(
"name"
,
"79"
);
map
.
put
(
"title"
,
newsParams
.
getTitle
());
List
<
String
>
child
=
getChild
(
map
);
map
.
put
(
"list"
,
child
);
map
.
put
(
"typeName"
,
"ebXML"
);
List
<
Map
<
String
,
Object
>>
dataList
=
getDataListNew
(
map
,
page
);
page
.
setRecords
(
dataList
);
}
return
page
;
}
private
List
<
Map
<
String
,
Object
>>
getDataListNew
(
Map
<
String
,
Object
>
map
,
Page
page
)
{
List
<
Map
<
String
,
Object
>>
list
=
this
.
newsDao
.
searchKnowledgeInfoNewList
(
map
,
page
);
return
list
;
}
private
List
<
Map
<
String
,
Object
>>
getDataList
(
Map
<
String
,
Object
>
map
)
{
List
<
Map
<
String
,
Object
>>
list
=
this
.
newsDao
.
searchKnowledgeInfo
(
map
);
return
list
;
...
...
src/main/resources/mapper/manage/NewsDao.xml
View file @
3acbb7e0
...
...
@@ -478,4 +478,19 @@
ORDER BY
hits DESC
</select>
<select
id=
"searchKnowledgeInfoNewList"
resultType=
"java.util.Map"
>
SELECT
Title,knowledgeInfoID,#{params.typeName} as type
FROM
knowledgeInfo t
LEFT JOIN knowledgeCategory tt ON t.knowledgeCategoryID = tt.knowledgeCategoryID
where 1=1
<if
test=
"params.title !=null and params.title !=''"
>
and t.Title like concat(concat('%',#{title}),'%')
</if>
and t.knowledgeCategoryID in
<foreach
collection=
"params.list"
index=
"index"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</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