Commit 5eacdf91 authored by co_dengxiongwen's avatar co_dengxiongwen

接口调整

parent 1744469b
...@@ -45,4 +45,6 @@ public interface SnqxzInfoHourDao extends MyBaseMapper<SnqxzInfoHour> { ...@@ -45,4 +45,6 @@ public interface SnqxzInfoHourDao extends MyBaseMapper<SnqxzInfoHour> {
List<Map<String,Object>> getList(@Param("resourceId")String resourceId, @Param("type") Integer type); List<Map<String,Object>> getList(@Param("resourceId")String resourceId, @Param("type") Integer type);
List<Map<String, Object>> getListFx(@Param("region")Integer region,@Param("type") Integer type); List<Map<String, Object>> getListFx(@Param("region")Integer region,@Param("type") Integer type);
List<Map<String, Object>> getParamGroupByRegion();
} }
...@@ -34,4 +34,6 @@ public interface SnqxzInfoHourService extends MyBaseService<SnqxzInfoHour> { ...@@ -34,4 +34,6 @@ public interface SnqxzInfoHourService extends MyBaseService<SnqxzInfoHour> {
List<Map<String,Object>> getList(String resourceId, Integer type); List<Map<String,Object>> getList(String resourceId, Integer type);
List<Map<String, Object>> getListFx(Integer region, Integer type); List<Map<String, Object>> getListFx(Integer region, Integer type);
List<Map<String, Object>> getParamGroupByRegion();
} }
package com.devplatform.admin.modules.eq.service.impl; package com.devplatform.admin.modules.eq.service.impl;
import com.devplatform.admin.common.utils.Constants;
import com.devplatform.admin.modules.eq.service.*; import com.devplatform.admin.modules.eq.service.*;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -36,13 +37,12 @@ public class EquipmentServiceImpl implements EquipmentService { ...@@ -36,13 +37,12 @@ public class EquipmentServiceImpl implements EquipmentService {
private SwqxzInfoService swqxzInfoService; private SwqxzInfoService swqxzInfoService;
@Autowired @Autowired
private AnalysisService analysisService; private AnalysisService analysisService;
@Autowired
private SnqxzInfoHourService snqxzInfoHourService;
@Override @Override
public Map<String, Object> getList() { public Map<String, Object> getList() {
Map<String,Object> map = new HashMap<String,Object>(16); Map<String,Object> map = new HashMap<String,Object>(32);
// List<Map<String,Object>> list = new ArrayList<>();
//多联室内机 //多联室内机
List<Map<String,Object>> dlsnjList = dlsnjInfoService.getList(); List<Map<String,Object>> dlsnjList = dlsnjInfoService.getList();
//多联室外机 //多联室外机
...@@ -64,16 +64,14 @@ public class EquipmentServiceImpl implements EquipmentService { ...@@ -64,16 +64,14 @@ public class EquipmentServiceImpl implements EquipmentService {
//室外气象站 //室外气象站
List<Map<String,Object>> swqxzList = swqxzInfoService.getList(); List<Map<String,Object>> swqxzList = swqxzInfoService.getList();
Map<String,Object> map1 = new HashMap<String,Object>(16); List<Map<String,Object>> snqxMaps = snqxzInfoHourService.getParamGroupByRegion();
map1.put("temperature",17); for(Map<String,Object> temp : snqxMaps ){
map1.put("humidity",25); if(Constants.STRING_1.equals(temp.get("region").toString())){
map1.put("carbonDioxide",22); map.put("hcdtSnqx",temp);//候车大厅室内
}else if(Constants.STRING_2.equals(temp.get("region").toString())){
Map<String,Object> map2 = new HashMap<String,Object>(16); map.put("bgqySnqx",temp);//办公区域室内
map2.put("temperature",23); }
map2.put("humidity",21); }
map2.put("carbonDioxide",17);
map.put("dlsnjList",dlsnjList);//多联室内机 map.put("dlsnjList",dlsnjList);//多联室内机
map.put("dlswjList",dlswjList);//多联室外机 map.put("dlswjList",dlswjList);//多联室外机
map.put("flrbList",flrbList);//风冷热泵机组 map.put("flrbList",flrbList);//风冷热泵机组
...@@ -85,18 +83,6 @@ public class EquipmentServiceImpl implements EquipmentService { ...@@ -85,18 +83,6 @@ public class EquipmentServiceImpl implements EquipmentService {
map.put("snqxzList",snqxzList);//室内气象站 map.put("snqxzList",snqxzList);//室内气象站
map.put("swqxzList",swqxzList);//室外气象站 map.put("swqxzList",swqxzList);//室外气象站
map.put("syBean",analysisService.getSyParam());//首页数据 map.put("syBean",analysisService.getSyParam());//首页数据
map.put("bgqySnqx",map1);//办公区域室内
map.put("hcdtSnqx",map2);//候车大厅室内
// list.addAll(dlsnjList);
// list.addAll(flrbList);
// list.addAll(jfktgList);
// list.addAll(jfktpList);
// list.addAll(pfjList);
// list.addAll(sbList);
// list.addAll(sljfgList);
// list.addAll(snqxzList);
// list.addAll(swqxzList);
return map; return map;
} }
} }
...@@ -40,4 +40,9 @@ public class SnqxzInfoHourServiceImpl extends MyBaseServiceImpl<SnqxzInfoHourDao ...@@ -40,4 +40,9 @@ public class SnqxzInfoHourServiceImpl extends MyBaseServiceImpl<SnqxzInfoHourDao
public List<Map<String, Object>> getListFx(Integer region, Integer type) { public List<Map<String, Object>> getListFx(Integer region, Integer type) {
return baseMapper.getListFx(region,type); return baseMapper.getListFx(region,type);
} }
@Override
public List<Map<String, Object>> getParamGroupByRegion() {
return baseMapper.getParamGroupByRegion();
}
} }
...@@ -97,9 +97,9 @@ ...@@ -97,9 +97,9 @@
<select id="getListFx" resultType="java.util.Map"> <select id="getListFx" resultType="java.util.Map">
select select
AVG(cast(temperature as decimal(10, 1))) as temperature, cast(AVG(cast(temperature as decimal(10, 1))) as decimal(10, 1)) as temperature,
AVG(cast(humidity as decimal(10, 2))) as humidity, cast(AVG(cast(humidity as decimal(10, 2))) as decimal(10, 2)) as humidity,
AVG(cast(carbon_dioxide as decimal(10, 2))) as carbon_dioxide, cast(AVG(cast(carbon_dioxide as decimal(10, 2))) as decimal(10, 2)) as carbon_dioxide,
create_time create_time
from snqxz_info_hour from snqxz_info_hour
where 1=1 where 1=1
...@@ -121,6 +121,16 @@ ...@@ -121,6 +121,16 @@
group by create_time group by create_time
order by create_time order by create_time
</select> </select>
<select id="getParamGroupByRegion" resultType="java.util.Map">
select
cast(AVG(cast(temperature as decimal(10, 1))) as decimal(10, 1)) as temperature,
cast(AVG(cast(humidity as decimal(10, 2))) as decimal(10, 2)) as humidity,
cast(AVG(cast(carbon_dioxide as decimal(10, 2))) as decimal(10, 2)) as carbon_dioxide,
region
from snqxz_info_hour
where 1=1 and TO_DAYS(create_time) = TO_DAYS(NOW())
group by region
</select>
</mapper> </mapper>
......
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