package com.fgkj.services.rt;
|
|
import com.fgkj.dto.ServiceModel;
|
import com.fgkj.dto.rt.Batt_State_rt;
|
import com.fgkj.mapper.impl.rt.Rtstate_rtMapper;
|
import org.springframework.stereotype.Service;
|
|
import javax.annotation.Resource;
|
import java.util.List;
|
@Service
|
public class Rtstate_rtService {
|
|
@Resource
|
private Rtstate_rtMapper mapper;;
|
|
ServiceModel model = new ServiceModel();
|
|
//测试数据——实时查询中左下角的充放电统计
|
public ServiceModel serchDisOrChargr(){
|
List list=mapper.serchDisOrChargr();
|
if(list!=null&&list.size()>0){
|
model.setCode(1);
|
model.setData(list);
|
model.setMsg("查询成功!");
|
}
|
else{
|
model.setCode(0);
|
model.setMsg("查询失败!");
|
}
|
return model;
|
}
|
//电池组实时情况+实时电池续航能力查询
|
public ServiceModel serchBattLife(Object obj){
|
List<Batt_State_rt> list=mapper.serchBattLife(obj);
|
if(list!=null&&list.size()>0){
|
model.setCode(1);
|
model.setData(list);
|
model.setMsg("查询成功!");
|
/*for (Batt_State_rt b : list) {
|
System.out.println(b);
|
}*/
|
}else{
|
model.setCode(0);
|
model.setMsg("查询失败!");
|
}
|
return model;
|
}
|
//首页上饼状图电池状态比例
|
public ServiceModel serchBattStateRate(){
|
List list=mapper.serchBattStateRate();
|
if(list!=null&&list.size()>0){
|
model.setCode(1);
|
model.setData(list);
|
model.setMsg("查询成功!");
|
}
|
else{
|
model.setCode(0);
|
model.setMsg("查询失败!");
|
}
|
return model;
|
}
|
|
/*public static void main(String[] args) {
|
Rtstate_rtService rs=new Rtstate_rtService();
|
Batt_Maint_Dealarm bmd = new Batt_Maint_Dealarm();
|
Rtstate_rt rts=new Rtstate_rt();
|
BattInf binf=new BattInf();
|
binf.setBattGroupId(0);
|
binf.setStationName("");
|
binf.setStationName1("");
|
binf.setNum(100);
|
|
Page page = new Page();
|
page.setPageCurr(1);
|
page.setPageSize(10);
|
|
bmd.setBinf(binf);
|
bmd.setPage(page);
|
rs.serchBattLife(bmd);
|
}*/
|
|
}
|