From 28092b60cdccc4b26b39ae19a6c1e875ec2bce30 Mon Sep 17 00:00:00 2001 From: wuweida <2918581207@qq.com> Date: Thu, 26 May 2022 11:47:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=9F=A5=E8=AF=A2=E5=85=A8?= =?UTF-8?q?=E9=83=A8=E5=B7=A5=E5=9C=B0=E4=BF=A1=E6=81=AF=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../monitormanage/controller/Controller.java | 17 +++++++++++++++++ .../mapper/BuildingSiteMapper.java | 6 ++++++ .../service/SanitationService.java | 2 +- src/main/resources/mapper/RoadDataMapper.xml | 4 ++-- 4 files changed, 26 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/hisense/monitormanage/controller/Controller.java b/src/main/java/com/hisense/monitormanage/controller/Controller.java index 1bf8807..9569db2 100644 --- a/src/main/java/com/hisense/monitormanage/controller/Controller.java +++ b/src/main/java/com/hisense/monitormanage/controller/Controller.java @@ -59,6 +59,9 @@ public class Controller { @Autowired private BuildingSiteService buildingSitrService; + @Autowired + private BuildingSiteMapper buildingSiteMapper; + @Autowired private ChannelPictureMapper channelPictureMapper; @@ -504,4 +507,18 @@ public class Controller { list = buildingSitrService.listBuildingSiteByPoints(longitude,latitude,radius); return Result.success(list); } + + /** + * 查询全部工地信息 + * @return + */ + @GetMapping("selectBuildSite") + @ApiOperation("查询全部工地信息") + public Result selectBuildSite(){ + List buildingSites = buildingSiteMapper.selectBuildSite(); + Result success = Result.success(buildingSites); + return success; + } + + } diff --git a/src/main/java/com/hisense/monitormanage/mapper/BuildingSiteMapper.java b/src/main/java/com/hisense/monitormanage/mapper/BuildingSiteMapper.java index a88f9e9..780fe71 100644 --- a/src/main/java/com/hisense/monitormanage/mapper/BuildingSiteMapper.java +++ b/src/main/java/com/hisense/monitormanage/mapper/BuildingSiteMapper.java @@ -2,6 +2,9 @@ package com.hisense.monitormanage.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.hisense.monitormanage.entity.BuildingSite; +import org.apache.ibatis.annotations.Select; + +import java.util.List; /** * @author admin @@ -11,4 +14,7 @@ import com.hisense.monitormanage.entity.BuildingSite; * @createTime 2022年05月12日 13:59:00 */ public interface BuildingSiteMapper extends BaseMapper { + + @Select("select * from t_building_site") + List selectBuildSite(); } diff --git a/src/main/java/com/hisense/monitormanage/service/SanitationService.java b/src/main/java/com/hisense/monitormanage/service/SanitationService.java index d115d60..5c4e74c 100644 --- a/src/main/java/com/hisense/monitormanage/service/SanitationService.java +++ b/src/main/java/com/hisense/monitormanage/service/SanitationService.java @@ -80,7 +80,7 @@ public class SanitationService { @Scheduled(cron = "0 0 8 * * ?") public void saveSanitationTaskScheduled(){ QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.orderByDesc("updatetime"); + wrapper.orderByDesc("updatetime").last("limit 1"); SanitationTask sanitationTask = sanitationTaskMapper.selectOne(wrapper); List maps = new ArrayList<>(); diff --git a/src/main/resources/mapper/RoadDataMapper.xml b/src/main/resources/mapper/RoadDataMapper.xml index 5c0a104..e07994d 100644 --- a/src/main/resources/mapper/RoadDataMapper.xml +++ b/src/main/resources/mapper/RoadDataMapper.xml @@ -5,13 +5,13 @@ INSERT INTO t_road_data (region_name,street_name,road_name,start,end,lng,lat,pm10,pm25,desc_pm10_rank,asc_pm10_rank, - desc_pm25_rank,asc_pm25_rank,points) + desc_pm25_rank,asc_pm25_rank,points,dt) VALUES ( #{item.regionName},#{item.streetName},#{item.roadName},#{item.start},#{item.end}, #{item.lng},#{item.lat},#{item.pm10},#{item.pm25},#{item.desc_pm10_rank}, - #{item.asc_pm10_rank},#{item.desc_pm25_rank},#{item.asc_pm25_rank},#{item.points} + #{item.asc_pm10_rank},#{item.desc_pm25_rank},#{item.asc_pm25_rank},#{item.points},#{item.dt} )