根据建筑编号查询近7天近30天噪声和扬尘信息
This commit is contained in:
parent
2ca138ffb1
commit
1aaf4edd25
|
@ -1,6 +1,7 @@
|
||||||
package com.hisense.monitormanage.controller;
|
package com.hisense.monitormanage.controller;
|
||||||
|
|
||||||
import com.hisense.monitormanage.dto.BuildingRecordsDto;
|
import com.hisense.monitormanage.dto.BuildingRecordsDto;
|
||||||
|
import com.hisense.monitormanage.dto.BuildingRecordsDtos;
|
||||||
import com.hisense.monitormanage.entity.BuildingRecords;
|
import com.hisense.monitormanage.entity.BuildingRecords;
|
||||||
import com.hisense.monitormanage.entity.Result;
|
import com.hisense.monitormanage.entity.Result;
|
||||||
import com.hisense.monitormanage.mapper.BuildingRecordsMapper;
|
import com.hisense.monitormanage.mapper.BuildingRecordsMapper;
|
||||||
|
@ -16,6 +17,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
@ -64,7 +66,7 @@ public class BuildingController {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询所有工地
|
* 查询所有工地最新列表
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GetMapping("selectAllBuilding")
|
@GetMapping("selectAllBuilding")
|
||||||
|
@ -76,13 +78,25 @@ public class BuildingController {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询近7天工地噪声和扬尘的信息
|
* 根据建筑编号查询近7天工地噪声和扬尘的信息
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GetMapping("selectWeekPmAndNoice")
|
@GetMapping("selectWeekPmAndNoice")
|
||||||
@ApiOperation("查询近7天工地噪声和扬尘的信息")
|
@ApiOperation("查询近7天工地噪声和扬尘的信息")
|
||||||
public Result selectWeekPmAndNoice(){
|
public Result selectWeekPmAndNoice(String buildLicense){
|
||||||
List<BuildingRecordsDto> recordsDtos = buildingRecordsMapper.selectWeekPmAndNoice();
|
List<BuildingRecordsDtos> recordsDtos = buildingRecordsMapper.selectWeekPmAndNoice(buildLicense);
|
||||||
|
Result success = Result.success(recordsDtos);
|
||||||
|
return success;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据建筑编号查询近30天工地噪声和扬尘的信息
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("selectMonthPmAndNoice")
|
||||||
|
@ApiOperation("查询近30天工地噪声和扬尘的信息")
|
||||||
|
public Result selectMonthPmAndNoice(String buildLicense){
|
||||||
|
List<BuildingRecordsDtos> recordsDtos = buildingRecordsMapper.selectMonthPmAndNoice(buildLicense);
|
||||||
Result success = Result.success(recordsDtos);
|
Result success = Result.success(recordsDtos);
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
@ -99,19 +113,6 @@ public class BuildingController {
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询近30天工地噪声和扬尘的信息
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@GetMapping("selectMonthPmAndNoice")
|
|
||||||
@ApiOperation("查询近30天工地噪声和扬尘的信息")
|
|
||||||
public Result selectMonthPmAndNoice(){
|
|
||||||
List<BuildingRecordsDto> recordsDtos = buildingRecordsMapper.selectMonthPmAndNoice();
|
|
||||||
Result success = Result.success(recordsDtos);
|
|
||||||
return success;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据工地名称搜索工地
|
* 根据工地名称搜索工地
|
||||||
* @param projectName
|
* @param projectName
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
package com.hisense.monitormanage.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class BuildingRecordsDtos {
|
||||||
|
private String pushTime;
|
||||||
|
private Integer pm10;
|
||||||
|
private Integer noice;
|
||||||
|
}
|
|
@ -2,6 +2,7 @@ package com.hisense.monitormanage.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.hisense.monitormanage.dto.BuildingRecordsDto;
|
import com.hisense.monitormanage.dto.BuildingRecordsDto;
|
||||||
|
import com.hisense.monitormanage.dto.BuildingRecordsDtos;
|
||||||
import com.hisense.monitormanage.entity.BuildingRecords;
|
import com.hisense.monitormanage.entity.BuildingRecords;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.apache.ibatis.annotations.Select;
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
@ -21,16 +22,15 @@ public interface BuildingRecordsMapper extends BaseMapper<BuildingRecords> {
|
||||||
|
|
||||||
void batchUpdate(@Param("list") List<Map> list);
|
void batchUpdate(@Param("list") List<Map> list);
|
||||||
|
|
||||||
@Select("SELECT * FROM t_building_new_site bns JOIN t_building_records br ON bns.gdmc = br.project_name")
|
@Select("select * from (SELECT bns.*,br.project_name,br.push_time,br.pm10,br.noice,br.build_license FROM t_building_records br JOIN t_building_new_site bns " +
|
||||||
|
"ON br.project_name = bns.gdmc ORDER BY br.push_time DESC LIMIT 93) bs LEFT JOIN t_channel_picture cp ON bs.channel_code = cp.channel_code")
|
||||||
List<BuildingRecordsDto> selectAllBuilding();
|
List<BuildingRecordsDto> selectAllBuilding();
|
||||||
|
|
||||||
@Select("select * from t_building_records br JOIN t_building_new_site bs on br.project_name = bs.gdmc" +
|
@Select("select DATE_FORMAT(br.push_time,'%Y%-%m-%d') pushTime,ROUND(AVG(br.pm10)) pm10,ROUND(AVG(br.noice)) noice from t_building_records br JOIN t_building_new_site bns ON br.project_name = bns.gdmc WHERE br.build_license = #{buildLicense} AND DATE_SUB(CURDATE(), INTERVAL 7 DAY) < date(br.push_time) group by pushTime")
|
||||||
" where DATE_SUB(CURDATE(), INTERVAL 7 DAY) < date(br.push_time)")
|
List<BuildingRecordsDtos> selectWeekPmAndNoice(String buildLicense);
|
||||||
List<BuildingRecordsDto> selectWeekPmAndNoice();
|
|
||||||
|
|
||||||
@Select("select * from t_building_records br JOIN t_building_new_site bs on br.project_name = bs.gdmc" +
|
@Select("select DATE_FORMAT(br.push_time,'%Y%-%m-%d') pushTime,ROUND(AVG(br.pm10)) pm10,ROUND(AVG(br.noice)) noice from t_building_records br JOIN t_building_new_site bns ON br.project_name = bns.gdmc WHERE br.build_license = #{buildLicense} AND DATE_SUB(CURDATE(), INTERVAL 30 DAY) < date(br.push_time) group by pushTime")
|
||||||
" where DATE_SUB(CURDATE(), INTERVAL 30 DAY) < date(br.push_time)")
|
List<BuildingRecordsDtos> selectMonthPmAndNoice(String buildLicense);
|
||||||
List<BuildingRecordsDto> selectMonthPmAndNoice();
|
|
||||||
|
|
||||||
List<BuildingRecordsDto> selectRaise(@Param("page") Integer page,@Param("pageSize") Integer pageSize);
|
List<BuildingRecordsDto> selectRaise(@Param("page") Integer page,@Param("pageSize") Integer pageSize);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue