Commit f863406d authored by co_dengxiongwen's avatar co_dengxiongwen

接口调整

parent 67bb17c4
...@@ -142,13 +142,13 @@ public class AnalysisController extends AbstractController { ...@@ -142,13 +142,13 @@ public class AnalysisController extends AbstractController {
String time = DateUtils.format((Date) list.get(i).get("create_time"),"yyyy-MM-dd HH:mm:ss"); String time = DateUtils.format((Date) list.get(i).get("create_time"),"yyyy-MM-dd HH:mm:ss");
temperatureListDetail.add(time); temperatureListDetail.add(time);
temperatureListDetail.add((String) list.get(i).get("temperature")); temperatureListDetail.add(list.get(i).get("temperature").toString());
humidityListDetail.add(time); humidityListDetail.add(time);
humidityListDetail.add((String) list.get(i).get("humidity")); humidityListDetail.add(list.get(i).get("humidity").toString());
carbonDioxideListDetail.add(time); carbonDioxideListDetail.add(time);
carbonDioxideListDetail.add((String) list.get(i).get("carbon_dioxide")); carbonDioxideListDetail.add(list.get(i).get("carbon_dioxide").toString());
temperatureList.add(temperatureListDetail); temperatureList.add(temperatureListDetail);
humidityList.add(humidityListDetail); humidityList.add(humidityListDetail);
......
...@@ -136,7 +136,7 @@ public class AnalysisServiceImpl implements AnalysisService { ...@@ -136,7 +136,7 @@ public class AnalysisServiceImpl implements AnalysisService {
for (int i = 0; i < page.getRecords().size(); i++) { for (int i = 0; i < page.getRecords().size(); i++) {
List<String> listDetail = new ArrayList<String>(); List<String> listDetail = new ArrayList<String>();
listDetail.add(DateUtils.format((Date) page.getRecords().get(i).get("create_time"),"yyyy-MM-dd HH:mm:ss")); listDetail.add(DateUtils.format((Date) page.getRecords().get(i).get("create_time"),"yyyy-MM-dd HH:mm:ss"));
listDetail.add((String) page.getRecords().get(i).get("electric_energy")); listDetail.add(page.getRecords().get(i).get("electric_energy").toString());
listTj.add(listDetail); listTj.add(listDetail);
} }
return listTj; return listTj;
...@@ -165,7 +165,7 @@ public class AnalysisServiceImpl implements AnalysisService { ...@@ -165,7 +165,7 @@ public class AnalysisServiceImpl implements AnalysisService {
for (int i = 0; i < list.size(); i++) { for (int i = 0; i < list.size(); i++) {
List<String> listDetail = new ArrayList<String>(); List<String> listDetail = new ArrayList<String>();
listDetail.add(DateUtils.format((Date) list.get(i).get("create_time"),"yyyy-MM-dd HH:mm:ss")); listDetail.add(DateUtils.format((Date) list.get(i).get("create_time"),"yyyy-MM-dd HH:mm:ss"));
listDetail.add((String) list.get(i).get("electric_energy")); listDetail.add(list.get(i).get("electric_energy").toString());
listTj.add(listDetail); listTj.add(listDetail);
} }
return listTj; return listTj;
......
...@@ -61,11 +61,11 @@ public class DlswjInfoServiceImpl extends MyBaseServiceImpl<DlswjInfoDao, DlswjI ...@@ -61,11 +61,11 @@ public class DlswjInfoServiceImpl extends MyBaseServiceImpl<DlswjInfoDao, DlswjI
@Override @Override
public List<Map<String, Object>> queryListByParam(Integer type) { public List<Map<String, Object>> queryListByParam(Integer type) {
List<Map<String,Object>> list = new ArrayList<>(); List<Map<String,Object>> list = new ArrayList<>();
if(Constants.STRING_1.equals(type)){ if(type == Constants.INT_1){
list = dlswjInfoHourService.queryListByParam(type); list = dlswjInfoHourService.queryListByParam(type);
}else if(Constants.STRING_2.equals(type) || Constants.STRING_3.equals(type)){ }else if(type == Constants.INT_2 || type == Constants.INT_3){
list = dlswjInfoDayService.queryListByParam(type); list = dlswjInfoDayService.queryListByParam(type);
}else if(Constants.STRING_4.equals(type)){ }else if(type == Constants.INT_4){
list = dlswjInfoMonthService.queryListByParam(type); list = dlswjInfoMonthService.queryListByParam(type);
} }
return list; return list;
......
...@@ -61,11 +61,11 @@ public class FlrbInfoServiceImpl extends MyBaseServiceImpl<FlrbInfoDao, FlrbInfo ...@@ -61,11 +61,11 @@ public class FlrbInfoServiceImpl extends MyBaseServiceImpl<FlrbInfoDao, FlrbInfo
@Override @Override
public List<Map<String, Object>> queryListByParam(Integer type) { public List<Map<String, Object>> queryListByParam(Integer type) {
List<Map<String,Object>> list = new ArrayList<>(); List<Map<String,Object>> list = new ArrayList<>();
if(Constants.STRING_1.equals(type)){ if(type == Constants.INT_1){
list = flrbInfoHourService.queryListByParam(type); list = flrbInfoHourService.queryListByParam(type);
}else if(Constants.STRING_2.equals(type) || Constants.STRING_3.equals(type)){ }else if(type == Constants.INT_2 || type == Constants.INT_3){
list = flrbInfoDayService.queryListByParam(type); list = flrbInfoDayService.queryListByParam(type);
}else if(Constants.STRING_4.equals(type)){ }else if(type == Constants.INT_4){
list = flrbInfoMonthService.queryListByParam(type); list = flrbInfoMonthService.queryListByParam(type);
} }
return list; return list;
......
...@@ -61,11 +61,11 @@ public class JfktgInfoServiceImpl extends MyBaseServiceImpl<JfktgInfoDao, JfktgI ...@@ -61,11 +61,11 @@ public class JfktgInfoServiceImpl extends MyBaseServiceImpl<JfktgInfoDao, JfktgI
@Override @Override
public List<Map<String, Object>> queryListByParam(Integer type) { public List<Map<String, Object>> queryListByParam(Integer type) {
List<Map<String,Object>> list = new ArrayList<>(); List<Map<String,Object>> list = new ArrayList<>();
if(Constants.STRING_1.equals(type)){ if(type == Constants.INT_1){
list = jfktgInfoHourService.queryListByParam(type); list = jfktgInfoHourService.queryListByParam(type);
}else if(Constants.STRING_2.equals(type) || Constants.STRING_3.equals(type)){ }else if(type == Constants.INT_2 || type == Constants.INT_3){
list = jfktgInfoDayService.queryListByParam(type); list = jfktgInfoDayService.queryListByParam(type);
}else if(Constants.STRING_4.equals(type)){ }else if(type == Constants.INT_4){
list = jfktgInfoMonthService.queryListByParam(type); list = jfktgInfoMonthService.queryListByParam(type);
} }
return list; return list;
......
...@@ -62,11 +62,11 @@ public class JfktpInfoServiceImpl extends MyBaseServiceImpl<JfktpInfoDao, JfktpI ...@@ -62,11 +62,11 @@ public class JfktpInfoServiceImpl extends MyBaseServiceImpl<JfktpInfoDao, JfktpI
@Override @Override
public List<Map<String, Object>> queryListByParam(Integer type) { public List<Map<String, Object>> queryListByParam(Integer type) {
List<Map<String,Object>> list = new ArrayList<>(); List<Map<String,Object>> list = new ArrayList<>();
if(Constants.STRING_1.equals(type)){ if(type == Constants.INT_1){
list = jfktpInfoHourService.queryListByParam(type); list = jfktpInfoHourService.queryListByParam(type);
}else if(Constants.STRING_2.equals(type) || Constants.STRING_3.equals(type)){ }else if(type == Constants.INT_2|| type == Constants.INT_3){
list = jfktpInfoDayService.queryListByParam(type); list = jfktpInfoDayService.queryListByParam(type);
}else if(Constants.STRING_4.equals(type)){ }else if(type == Constants.INT_4){
list = jfktpInfoMonthService.queryListByParam(type); list = jfktpInfoMonthService.queryListByParam(type);
} }
return list; return list;
......
...@@ -61,11 +61,11 @@ public class PfjInfoServiceImpl extends MyBaseServiceImpl<PfjInfoDao, PfjInfo> i ...@@ -61,11 +61,11 @@ public class PfjInfoServiceImpl extends MyBaseServiceImpl<PfjInfoDao, PfjInfo> i
@Override @Override
public List<Map<String, Object>> queryListByParam(Integer type) { public List<Map<String, Object>> queryListByParam(Integer type) {
List<Map<String,Object>> list = new ArrayList<>(); List<Map<String,Object>> list = new ArrayList<>();
if(Constants.STRING_1.equals(type)){ if(type == Constants.INT_1){
list = pfjInfoHourService.queryListByParam(type); list = pfjInfoHourService.queryListByParam(type);
}else if(Constants.STRING_2.equals(type) || Constants.STRING_3.equals(type)){ }else if(type == Constants.INT_2 || type == Constants.INT_3){
list = pfjInfoDayService.queryListByParam(type); list = pfjInfoDayService.queryListByParam(type);
}else if(Constants.STRING_4.equals(type)){ }else if(type == Constants.INT_4){
list = pfjInfoMonthService.queryListByParam(type); list = pfjInfoMonthService.queryListByParam(type);
} }
return list; return list;
......
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
</select> </select>
<select id="queryListByParam" resultType="java.util.Map"> <select id="queryListByParam" resultType="java.util.Map">
select create_time,sum(cast(electric_energy as decimal(10, 5))) select create_time,sum(cast(electric_energy as decimal(10, 5))) as electric_energy
from dlswj_info_day from dlswj_info_day
where 1=1 where 1=1
<if test="type == 2"> <if test="type == 2">
......
...@@ -61,10 +61,10 @@ ...@@ -61,10 +61,10 @@
</select> </select>
<select id="queryListByParam" resultType="java.util.Map"> <select id="queryListByParam" resultType="java.util.Map">
select create_time,sum(cast(electric_energy as decimal(10, 5))) select create_time,sum(cast(electric_energy as decimal(10, 5))) as electric_energy
from dlswj_info_hour from dlswj_info_hour
where 1=1 where 1=1
<if test="params.type == 1"> <if test="type == 1">
and TO_DAYS(create_time) = TO_DAYS(NOW()) and TO_DAYS(create_time) = TO_DAYS(NOW())
</if> </if>
group by create_time group by create_time
......
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
</select> </select>
<select id="queryListByParam" resultType="java.util.Map"> <select id="queryListByParam" resultType="java.util.Map">
select create_time,sum(cast(electric_energy as decimal(10, 5))) select create_time,sum(cast(electric_energy as decimal(10, 5))) as electric_energy
from dlswj_info_month from dlswj_info_month
where 1=1 where 1=1
<if test="type == 4"> <if test="type == 4">
......
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
</select> </select>
<select id="queryListByParam" resultType="java.util.Map"> <select id="queryListByParam" resultType="java.util.Map">
select create_time,sum(cast(electric_energy as decimal(10, 5))) select create_time,sum(cast(electric_energy as decimal(10, 5))) as electric_energy
from flrb_info_day from flrb_info_day
where 1=1 where 1=1
<if test="type == 2"> <if test="type == 2">
......
...@@ -61,10 +61,10 @@ ...@@ -61,10 +61,10 @@
</select> </select>
<select id="queryListByParam" resultType="java.util.Map"> <select id="queryListByParam" resultType="java.util.Map">
select create_time,sum(cast(electric_energy as decimal(10, 5))) select create_time,sum(cast(electric_energy as decimal(10, 5))) as electric_energy
from flrb_info_hour from flrb_info_hour
where 1=1 where 1=1
<if test="params.type == 1"> <if test="type == 1">
and TO_DAYS(create_time) = TO_DAYS(NOW()) and TO_DAYS(create_time) = TO_DAYS(NOW())
</if> </if>
group by create_time group by create_time
......
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
</select> </select>
<select id="queryListByParam" resultType="java.util.Map"> <select id="queryListByParam" resultType="java.util.Map">
select create_time,sum(cast(electric_energy as decimal(10, 5))) select create_time,sum(cast(electric_energy as decimal(10, 5))) as electric_energy
from flrb_info_month from flrb_info_month
where 1=1 where 1=1
<if test="type == 4"> <if test="type == 4">
......
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
</select> </select>
<select id="queryListByParam" resultType="java.util.Map"> <select id="queryListByParam" resultType="java.util.Map">
select create_time,sum(cast(electric_energy as decimal(10, 5))) select create_time,sum(cast(electric_energy as decimal(10, 5))) as electric_energy
from jfktg_info_day from jfktg_info_day
where 1=1 where 1=1
<if test="type == 2"> <if test="type == 2">
......
...@@ -61,10 +61,10 @@ ...@@ -61,10 +61,10 @@
</select> </select>
<select id="queryListByParam" resultType="java.util.Map"> <select id="queryListByParam" resultType="java.util.Map">
select create_time,sum(cast(electric_energy as decimal(10, 5))) select create_time,sum(cast(electric_energy as decimal(10, 5))) as electric_energy
from jfktg_info_hour from jfktg_info_hour
where 1=1 where 1=1
<if test="params.type == 1"> <if test="type == 1">
and TO_DAYS(create_time) = TO_DAYS(NOW()) and TO_DAYS(create_time) = TO_DAYS(NOW())
</if> </if>
group by create_time group by create_time
......
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
</select> </select>
<select id="queryListByParam" resultType="java.util.Map"> <select id="queryListByParam" resultType="java.util.Map">
select create_time,sum(cast(electric_energy as decimal(10, 5))) select create_time,sum(cast(electric_energy as decimal(10, 5))) as electric_energy
from jfktg_info_month from jfktg_info_month
where 1=1 where 1=1
<if test="type == 4"> <if test="type == 4">
......
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
</select> </select>
<select id="queryListByParam" resultType="java.util.Map"> <select id="queryListByParam" resultType="java.util.Map">
select create_time,sum(cast(electric_energy as decimal(10, 5))) select create_time,sum(cast(electric_energy as decimal(10, 5))) as electric_energy
from jfktp_info_day from jfktp_info_day
where 1=1 where 1=1
<if test="type == 2"> <if test="type == 2">
......
...@@ -61,10 +61,10 @@ ...@@ -61,10 +61,10 @@
</select> </select>
<select id="queryListByParam" resultType="java.util.Map"> <select id="queryListByParam" resultType="java.util.Map">
select create_time,sum(cast(electric_energy as decimal(10, 5))) select create_time,sum(cast(electric_energy as decimal(10, 5))) as electric_energy
from jfktp_info_hour from jfktp_info_hour
where 1=1 where 1=1
<if test="params.type == 1"> <if test="type == 1">
and TO_DAYS(create_time) = TO_DAYS(NOW()) and TO_DAYS(create_time) = TO_DAYS(NOW())
</if> </if>
group by create_time group by create_time
......
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
</select> </select>
<select id="queryListByParam" resultType="java.util.Map"> <select id="queryListByParam" resultType="java.util.Map">
select create_time,sum(cast(electric_energy as decimal(10, 5))) select create_time,sum(cast(electric_energy as decimal(10, 5))) as electric_energy
from jfktp_info_month from jfktp_info_month
where 1=1 where 1=1
<if test="type == 4"> <if test="type == 4">
......
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
</select> </select>
<select id="queryListByParam" resultType="java.util.Map"> <select id="queryListByParam" resultType="java.util.Map">
select create_time,sum(cast(electric_energy as decimal(10, 5))) select create_time,sum(cast(electric_energy as decimal(10, 5))) as electric_energy
from pfj_info_day from pfj_info_day
where 1=1 where 1=1
<if test="type == 2"> <if test="type == 2">
......
...@@ -60,10 +60,10 @@ ...@@ -60,10 +60,10 @@
</select> </select>
<select id="queryListByParam" resultType="java.util.Map"> <select id="queryListByParam" resultType="java.util.Map">
select create_time,sum(cast(electric_energy as decimal(10, 5))) select create_time,sum(cast(electric_energy as decimal(10, 5))) as electric_energy
from pfj_info_hour from pfj_info_hour
where 1=1 where 1=1
<if test="params.type == 1"> <if test="type == 1">
and TO_DAYS(create_time) = TO_DAYS(NOW()) and TO_DAYS(create_time) = TO_DAYS(NOW())
</if> </if>
group by create_time group by create_time
......
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
</select> </select>
<select id="queryListByParam" resultType="java.util.Map"> <select id="queryListByParam" resultType="java.util.Map">
select create_time,sum(cast(electric_energy as decimal(10, 5))) select create_time,sum(cast(electric_energy as decimal(10, 5))) as electric_energy
from pfj_info_month from pfj_info_month
where 1=1 where 1=1
<if test="type == 4"> <if test="type == 4">
......
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
and TO_DAYS(t.create_time) = TO_DAYS(NOW()) and TO_DAYS(t.create_time) = TO_DAYS(NOW())
</if> </if>
<if test="params.type == 2"> <if test="params.type == 2">
and YEARWEEK(date_format(t.create_time,'%Y-%m-%d'),1) = YEARWEEK(now(),1); and YEARWEEK(date_format(t.create_time,'%Y-%m-%d'),1) = YEARWEEK(now(),1)
</if> </if>
<if test="params.type == 3"> <if test="params.type == 3">
and DATE_FORMAT(t.create_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' ) and DATE_FORMAT(t.create_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ) , '%Y%m' )
...@@ -115,7 +115,10 @@ ...@@ -115,7 +115,10 @@
<if test="type == 4"> <if test="type == 4">
and DATE_FORMAT( create_time, '%Y' ) = DATE_FORMAT( CURDATE() , '%Y' ) and DATE_FORMAT( create_time, '%Y' ) = DATE_FORMAT( CURDATE() , '%Y' )
</if> </if>
group by region,create_time <if test="region!=null">
and region = #{region}
</if>
group by create_time
order by create_time order by create_time
</select> </select>
......
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