添加查询全部工地信息接口

This commit is contained in:
wuweida 2022-05-26 11:47:28 +08:00
parent 85157456b8
commit 28092b60cd
4 changed files with 26 additions and 3 deletions

View File

@ -59,6 +59,9 @@ public class Controller {
@Autowired @Autowired
private BuildingSiteService buildingSitrService; private BuildingSiteService buildingSitrService;
@Autowired
private BuildingSiteMapper buildingSiteMapper;
@Autowired @Autowired
private ChannelPictureMapper channelPictureMapper; private ChannelPictureMapper channelPictureMapper;
@ -504,4 +507,18 @@ public class Controller {
list = buildingSitrService.listBuildingSiteByPoints(longitude,latitude,radius); list = buildingSitrService.listBuildingSiteByPoints(longitude,latitude,radius);
return Result.success(list); return Result.success(list);
} }
/**
* 查询全部工地信息
* @return
*/
@GetMapping("selectBuildSite")
@ApiOperation("查询全部工地信息")
public Result selectBuildSite(){
List<BuildingSite> buildingSites = buildingSiteMapper.selectBuildSite();
Result success = Result.success(buildingSites);
return success;
}
} }

View File

@ -2,6 +2,9 @@ package com.hisense.monitormanage.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hisense.monitormanage.entity.BuildingSite; import com.hisense.monitormanage.entity.BuildingSite;
import org.apache.ibatis.annotations.Select;
import java.util.List;
/** /**
* @author admin * @author admin
@ -11,4 +14,7 @@ import com.hisense.monitormanage.entity.BuildingSite;
* @createTime 2022年05月12日 13:59:00 * @createTime 2022年05月12日 13:59:00
*/ */
public interface BuildingSiteMapper extends BaseMapper<BuildingSite> { public interface BuildingSiteMapper extends BaseMapper<BuildingSite> {
@Select("select * from t_building_site")
List<BuildingSite> selectBuildSite();
} }

View File

@ -80,7 +80,7 @@ public class SanitationService {
@Scheduled(cron = "0 0 8 * * ?") @Scheduled(cron = "0 0 8 * * ?")
public void saveSanitationTaskScheduled(){ public void saveSanitationTaskScheduled(){
QueryWrapper<SanitationTask> wrapper = new QueryWrapper<>(); QueryWrapper<SanitationTask> wrapper = new QueryWrapper<>();
wrapper.orderByDesc("updatetime"); wrapper.orderByDesc("updatetime").last("limit 1");
SanitationTask sanitationTask = sanitationTaskMapper.selectOne(wrapper); SanitationTask sanitationTask = sanitationTaskMapper.selectOne(wrapper);
List<Map> maps = new ArrayList<>(); List<Map> maps = new ArrayList<>();

View File

@ -5,13 +5,13 @@
<insert id="batchSave" parameterType="java.util.List"> <insert id="batchSave" parameterType="java.util.List">
INSERT INTO t_road_data INSERT INTO t_road_data
(region_name,street_name,road_name,start,end,lng,lat,pm10,pm25,desc_pm10_rank,asc_pm10_rank, (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 VALUES
<foreach collection="list" item="item" separator="," > <foreach collection="list" item="item" separator="," >
( (
#{item.regionName},#{item.streetName},#{item.roadName},#{item.start},#{item.end}, #{item.regionName},#{item.streetName},#{item.roadName},#{item.start},#{item.end},
#{item.lng},#{item.lat},#{item.pm10},#{item.pm25},#{item.desc_pm10_rank}, #{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}
) )
</foreach> </foreach>
</insert> </insert>