package com.fgkj.actions;
|
|
import java.util.List;
|
|
import com.fgkj.dto.BattInf;
|
import com.fgkj.dto.Batt_electricity;
|
import com.fgkj.dto.ServiceModel;
|
import com.fgkj.services.Batt_electricityService;
|
|
public class Batt_electricityAction extends ActionUtil{
|
private Batt_electricityService service = new Batt_electricityService();
|
private String result; //返回数据
|
private String json; //接收数据
|
|
public String add(){
|
Batt_electricity be = getGson().fromJson(json, Batt_electricity.class);
|
ServiceModel model = service.add(be);
|
result = tojson(model);
|
return SUCCESS;
|
}
|
public String update(){
|
Batt_electricity be = getGson().fromJson(json, Batt_electricity.class);
|
ServiceModel model = service.update(be);
|
result = tojson(model);
|
return SUCCESS;
|
}
|
public String del(){
|
Batt_electricity be = getGson().fromJson(json, Batt_electricity.class);
|
ServiceModel model = service.del(be);
|
result = tojson(model);
|
return SUCCESS;
|
}
|
public String searchAll(){
|
ServiceModel model = service.searchAll();
|
result = tojson(model);
|
return SUCCESS;
|
}
|
|
|
//10.1根据设备id连battinf和batt_devdischarge表 查询电度
|
/*
|
* 记录时间放在battinf的battproducer
|
* 统计方式放在battinf 的signalname 中 1 - 月 2-季度 3-年份
|
* */
|
public String serchByCondition(){
|
BattInf binf = getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, BattInf.class);
|
List list = service.serchByCondition(binf);
|
result = tojson(list);
|
//System.out.println(result);
|
return SUCCESS;
|
}
|
|
//9.1机房主控中用电量的统计的折线图
|
public String serchByInfo(){
|
System.out.println(json);
|
BattInf binf = getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, BattInf.class);
|
//System.out.println(binf);
|
ServiceModel model = service.serchByInfo(binf);
|
result = tojson(model);
|
return SUCCESS;
|
}
|
|
public String getResult() {
|
return result;
|
}
|
|
public void setJson(String json) {
|
this.json = json;
|
}
|
|
|
}
|