Commit 35625195 by rongkailun

【新增】咨询中心 行业应用、物联网、医疗、物流、物联网、食品安全追溯

parent 7ac928b8
......@@ -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);
}
}
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);
}
......@@ -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;
}
......@@ -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);
}
......@@ -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
......@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment