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
35625195
Commit
35625195
authored
Dec 07, 2021
by
rongkailun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【新增】咨询中心 行业应用、物联网、医疗、物流、物联网、食品安全追溯
parent
7ac928b8
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
215 additions
and
1 deletions
+215
-1
NewsController.java
...a/io/office/modules/manage/controller/NewsController.java
+64
-0
NewsDao.java
src/main/java/io/office/modules/manage/dao/NewsDao.java
+11
-0
MedicalEntity.java
...n/java/io/office/modules/manage/entity/MedicalEntity.java
+7
-0
NewsService.java
...in/java/io/office/modules/manage/service/NewsService.java
+11
-0
NewsServiceImpl.java
...o/office/modules/manage/service/impl/NewsServiceImpl.java
+41
-0
NewsDao.xml
src/main/resources/mapper/manage/NewsDao.xml
+81
-1
No files found.
src/main/java/io/office/modules/manage/controller/NewsController.java
View file @
35625195
...
...
@@ -6,6 +6,7 @@ import java.util.Map;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.office.modules.app.annotation.Login
;
import
io.office.modules.manage.entity.MedicalEntity
;
import
io.office.modules.manage.entity.dto.NewsParams
;
import
io.office.modules.sys.controller.AbstractController
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -162,4 +163,67 @@ public class NewsController extends AbstractController {
NewsEntity
news
=
newsService
.
getById
(
id
);
return
R
.
ok
().
put
(
"data"
,
news
);
}
/**
* 行业应用
*/
@Login
@PostMapping
(
"/api/industryApplication"
)
public
R
industryApplication
(
@RequestBody
NewsParams
newsParams
)
{
Page
<
NewsEntity
>
page
=
this
.
newsService
.
industryApplication
(
newsParams
,
new
Page
(
newsParams
.
getPage
(),
newsParams
.
getLimit
()));
PageUtils
pageUtils
=
new
PageUtils
(
page
);
return
R
.
ok
().
put
(
"data"
,
pageUtils
);
}
/**
* 医疗卫生
*/
@Login
@PostMapping
(
"/api/medicalList"
)
public
R
medicalList
(
@RequestBody
NewsParams
newsParams
)
{
Page
<
MedicalEntity
>
page
=
this
.
newsService
.
medicalList
(
newsParams
,
new
Page
(
newsParams
.
getPage
(),
newsParams
.
getLimit
()));
PageUtils
pageUtils
=
new
PageUtils
(
page
);
return
R
.
ok
().
put
(
"data"
,
pageUtils
);
}
/**
* 物联网
*/
@Login
@PostMapping
(
"/api/iotList"
)
public
R
iotList
(
@RequestBody
NewsParams
newsParams
)
{
Page
<
NewsEntity
>
page
=
this
.
newsService
.
iotList
(
newsParams
,
new
Page
(
newsParams
.
getPage
(),
newsParams
.
getLimit
()));
PageUtils
pageUtils
=
new
PageUtils
(
page
);
return
R
.
ok
().
put
(
"data"
,
pageUtils
);
}
/**
* 物联网
*/
@Login
@PostMapping
(
"/api/otherList"
)
public
R
otherList
(
@RequestBody
NewsParams
newsParams
)
{
Page
<
NewsEntity
>
page
=
this
.
newsService
.
otherList
(
newsParams
,
new
Page
(
newsParams
.
getPage
(),
newsParams
.
getLimit
()));
PageUtils
pageUtils
=
new
PageUtils
(
page
);
return
R
.
ok
().
put
(
"data"
,
pageUtils
);
}
/**
* 食品安全追溯
*/
@Login
@PostMapping
(
"/api/foodSafetyList"
)
public
R
foodSafetyList
(
@RequestBody
NewsParams
newsParams
)
{
Page
<
NewsEntity
>
page
=
this
.
newsService
.
foodSafetyList
(
newsParams
,
new
Page
(
newsParams
.
getPage
(),
newsParams
.
getLimit
()));
PageUtils
pageUtils
=
new
PageUtils
(
page
);
return
R
.
ok
().
put
(
"data"
,
pageUtils
);
}
}
src/main/java/io/office/modules/manage/dao/NewsDao.java
View file @
35625195
package
io
.
office
.
modules
.
manage
.
dao
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.office.modules.manage.entity.MedicalEntity
;
import
io.office.modules.manage.entity.NewsEntity
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
io.office.modules.manage.entity.dto.NewsParams
;
...
...
@@ -35,4 +36,14 @@ public interface NewsDao extends BaseMapper<NewsEntity> {
List
<
NewsEntity
>
getHdbdList
(
@Param
(
"newsParams"
)
NewsParams
newsParams
,
Page
page
);
String
selectClassName
(
Integer
classid
);
List
<
NewsEntity
>
industryApplication
(
NewsParams
newsParams
,
Page
page
);
List
<
MedicalEntity
>
medicalList
(
NewsParams
newsParams
,
Page
page
);
List
<
NewsEntity
>
iotList
(
NewsParams
newsParams
,
Page
page
);
List
<
NewsEntity
>
otherList
(
NewsParams
newsParams
,
Page
page
);
List
<
NewsEntity
>
foodSafetyList
(
NewsParams
newsParams
,
Page
page
);
}
src/main/java/io/office/modules/manage/entity/MedicalEntity.java
View file @
35625195
...
...
@@ -79,4 +79,11 @@ public class MedicalEntity implements Serializable {
@TableField
(
"inputDate"
)
private
Date
inputDate
;
private
String
status
;
private
String
checkname
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
checktime
;
}
src/main/java/io/office/modules/manage/service/NewsService.java
View file @
35625195
...
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
io.office.common.utils.PageUtils
;
import
io.office.common.utils.R
;
import
io.office.modules.manage.entity.MedicalEntity
;
import
io.office.modules.manage.entity.NewsEntity
;
import
io.office.modules.manage.entity.dto.NewsParams
;
import
io.office.modules.sys.entity.SysUserEntity
;
...
...
@@ -36,5 +37,15 @@ public interface NewsService extends IService<NewsEntity> {
Page
<
NewsEntity
>
selectRealTimeInfo
(
NewsParams
newsParams
,
Page
page
);
String
selectClassName
(
Integer
classid
);
Page
<
NewsEntity
>
industryApplication
(
NewsParams
newsParams
,
Page
page
);
Page
<
MedicalEntity
>
medicalList
(
NewsParams
newsParams
,
Page
page
);
Page
<
NewsEntity
>
iotList
(
NewsParams
newsParams
,
Page
page
);
Page
<
NewsEntity
>
otherList
(
NewsParams
newsParams
,
Page
page
);
Page
<
NewsEntity
>
foodSafetyList
(
NewsParams
newsParams
,
Page
page
);
}
src/main/java/io/office/modules/manage/service/impl/NewsServiceImpl.java
View file @
35625195
...
...
@@ -3,6 +3,7 @@ package io.office.modules.manage.service.impl;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.office.common.utils.R
;
import
io.office.modules.manage.entity.MedicalEntity
;
import
io.office.modules.manage.entity.dto.NewsParams
;
import
io.office.modules.sys.entity.SysUserEntity
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -125,6 +126,45 @@ public class NewsServiceImpl extends ServiceImpl<NewsDao, NewsEntity> implements
String
name
=
this
.
newsDao
.
selectClassName
(
classid
);
return
name
;
}
/**
*
* 行业应用
*
* */
@Override
public
Page
<
NewsEntity
>
industryApplication
(
NewsParams
newsParams
,
Page
page
)
{
List
<
NewsEntity
>
list
=
this
.
newsDao
.
industryApplication
(
newsParams
,
page
);
page
.
setRecords
(
list
);
return
page
;
}
@Override
public
Page
<
MedicalEntity
>
medicalList
(
NewsParams
newsParams
,
Page
page
)
{
List
<
MedicalEntity
>
list
=
this
.
newsDao
.
medicalList
(
newsParams
,
page
);
page
.
setRecords
(
list
);
return
page
;
}
@Override
public
Page
<
NewsEntity
>
iotList
(
NewsParams
newsParams
,
Page
page
)
{
List
<
NewsEntity
>
list
=
this
.
newsDao
.
iotList
(
newsParams
,
page
);
page
.
setRecords
(
list
);
return
page
;
}
@Override
public
Page
<
NewsEntity
>
otherList
(
NewsParams
newsParams
,
Page
page
)
{
List
<
NewsEntity
>
list
=
this
.
newsDao
.
otherList
(
newsParams
,
page
);
page
.
setRecords
(
list
);
return
page
;
}
@Override
public
Page
<
NewsEntity
>
foodSafetyList
(
NewsParams
newsParams
,
Page
page
)
{
List
<
NewsEntity
>
list
=
this
.
newsDao
.
foodSafetyList
(
newsParams
,
page
);
page
.
setRecords
(
list
);
return
page
;
}
}
\ No newline at end of file
src/main/resources/mapper/manage/NewsDao.xml
View file @
35625195
...
...
@@ -204,7 +204,7 @@
and t.classid = #{newsParams.classId}
and t.levels > 0
and t.status = '1'
order by t.levels desc,t.
showtime desc ,t.
id desc
order by t.levels desc,t.id desc
</select>
<select
id=
"getHdbdList"
resultMap=
"newsMap"
>
...
...
@@ -235,4 +235,83 @@
<select
id=
"selectClassName"
resultType=
"java.lang.String"
>
SELECT name FROM newsClass t where id = #{classid}
</select>
<!--行业应用-->
<select
id=
"industryApplication"
resultMap=
"newsMap"
>
SELECT
ltrim(b.name) classname ,a.*
FROM
news a
LEFT JOIN newsclass b ON a.classid = b.id
WHERE
status = 1
AND levels > 0
AND p_id NOT IN (2, 3)
AND b.name LIKE '%应用%'
ORDER BY
a.levels DESC,
a.showtime DESC,
a.id DESC
</select>
<!--医疗卫生-->
<select
id=
"medicalList"
resultType=
"io.office.modules.manage.entity.MedicalEntity"
>
SELECT * FROM medical t
where t.level >0
ORDER BY
t.level DESC,
t.id DESC
</select>
<!--物联网-->
<select
id=
"iotList"
resultMap=
"newsMap"
>
SELECT
*
FROM
news
WHERE
1 = 1
AND (keyword LIKE '%物联网%')
AND (
(classid BETWEEN 5 AND 8)
OR (
classid IN (
SELECT
Id
FROM
newsClass
WHERE
p_id = 5
)
)
)
ORDER BY
releasedate DESC
</select>
<select
id=
"otherList"
resultMap=
"newsMap"
>
SELECT
*
FROM
news
WHERE
classid IN ('18','19','20','21')
AND levels > 0
AND status = 1
ORDER BY
levels DESC,
id DESC
</select>
<select
id=
"foodSafetyList"
resultMap=
"newsMap"
>
SELECT
*
FROM
news
WHERE
classid = 16
AND levels > 0
AND status = 1
ORDER BY
levels DESC,
id 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