| | |
| | | package com.fgkj.controller.Ld9; |
| | | |
| | | import com.fgkj.dto.LD9_state; |
| | | import com.fgkj.dto.PageBean; |
| | | import com.fgkj.dto.ServiceModel; |
| | | import com.fgkj.dto.User_inf; |
| | | import com.fgkj.services.Ld9.LD9_stateService; |
| | |
| | | |
| | | //11.1LD9设备通信状态查询 |
| | | @PostMapping("byCondition") |
| | | @ApiOperation(notes = "",value="设备通信状态查询") |
| | | public ServiceModel serchByCondition(@RequestBody LD9_state ld9){ |
| | | // LD9_state ld9= getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, LD9_state.class); |
| | | @ApiOperation(notes = "TODO 待测试",value="设备通信状态查询") |
| | | public ServiceModel serchByCondition(@RequestParam Integer dev_errcommcount, @RequestParam Integer pageSize, @RequestParam Integer pageNum){ |
| | | LD9_state ld9 = new LD9_state(); |
| | | ld9.setDev_errcommcount(dev_errcommcount); |
| | | User_inf uinf=(User_inf) ActionUtil.getUser(); |
| | | ld9.setNum(uinf.getuId());//将用户id存放在LD9_state的num中用于处理用户管理的机房问题 |
| | | PageBean<Object> pageBean = new PageBean<>(); |
| | | pageBean.setPageNum(pageNum); |
| | | pageBean.setPageSize(pageSize); |
| | | ld9.setPageBean(pageBean); |
| | | ServiceModel model = service.serchByCondition(ld9); |
| | | return model; |
| | | } |
| | |
| | | import com.fgkj.services.Ld9.Ld9testdataService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | |
| | | private Ld9testdataService service; |
| | | |
| | | //历史数据查询 |
| | | @GetMapping("byCondition") |
| | | @ApiOperation(notes = "Table 'db_ld9_testdata.tb_ld9testdata_0' doesn't exist",value="历史数据查询") |
| | | public ServiceModel serchByCondition(@RequestBody Ld9testdata ld9) { |
| | | // Ld9testdata ld9=ActionUtil.getGson().fromJson(json, Ld9testdata.class); |
| | | @PostMapping("byCondition") |
| | | @ApiOperation(notes = "",value="历史数据查询") |
| | | public ServiceModel serchByCondition(@RequestParam Integer battGroupId,@RequestParam Integer test_record_count, |
| | | @RequestParam Integer record_num,@RequestParam Integer test_monnum) { |
| | | Ld9testdata ld9 = new Ld9testdata(); |
| | | ld9.setBattGroupId(battGroupId); //1000002 |
| | | ld9.setTest_record_count(test_record_count);//2 |
| | | ld9.setRecord_num(record_num); //2 |
| | | ld9.setTest_monnum(test_monnum); //1 |
| | | ServiceModel model=service.serchByCondition(ld9); |
| | | |
| | | return model; |
| | | } |
| | | //查询某次测试下电池组节数放电情况 |
| | | @GetMapping("byInfo") |
| | | @PostMapping("byInfo") |
| | | @ApiOperation(notes = "",value="查询某次测试下电池组节数放电情况") |
| | | public ServiceModel serchByInfo(@RequestBody Ld9testdata ld9) { |
| | | // Ld9testdata ld9=ActionUtil.getGson().fromJson(json, Ld9testdata.class); |
| | | public ServiceModel serchByInfo(@RequestParam Integer battGroupId,@RequestParam Integer test_record_count) { |
| | | Ld9testdata ld9 = new Ld9testdata(); |
| | | ld9.setBattGroupId(battGroupId); |
| | | ld9.setTest_record_count(test_record_count); |
| | | ServiceModel model=service.serchByInfo(ld9); |
| | | |
| | | return model; |
| | |
| | | //历史数据查询 |
| | | @PostMapping("byCondition") |
| | | @ApiOperation(notes = "",value="历史数据查询") |
| | | public ServiceModel serchByCondition(@RequestBody Ld9testdata_inf ld9_inf) { |
| | | // Ld9testdata_inf ld9_inf=ActionUtil.getGson().fromJson(json, Ld9testdata_inf.class); |
| | | public ServiceModel serchByCondition(@RequestParam Integer battGroupId) { |
| | | Ld9testdata_inf ld9_inf = new Ld9testdata_inf(); |
| | | ld9_inf.setBattGroupId(battGroupId); |
| | | ServiceModel model=service.serchByCondition(ld9_inf); |
| | | return model; |
| | | } |
| | | //历史数据查询(根据电池组id查询所有的放电单体) |
| | | @PostMapping("byInfo") |
| | | @ApiOperation(notes = "",value="历史数据查询(根据电池组id查询所有的放电单体)") |
| | | public ServiceModel serchByInfo(@RequestBody Ld9testdata_inf ld9_inf) { |
| | | // Ld9testdata_inf ld9_inf=ActionUtil.getGson().fromJson(json, Ld9testdata_inf.class); |
| | | public ServiceModel serchByInfo(@RequestParam Integer battGroupId) { |
| | | Ld9testdata_inf ld9_inf = new Ld9testdata_inf(); |
| | | ld9_inf.setBattGroupId(battGroupId); |
| | | ServiceModel model=service.serchByInfo(ld9_inf); |
| | | return model; |
| | | } |
| | |
| | | //历史监测容量的柱状图 |
| | | @PostMapping("byCondition") |
| | | @ApiOperation(notes = "",value="历史监测容量的柱状图") |
| | | public ServiceModel serchByCondition(@RequestBody Ld9testdatastop ld9){ |
| | | public ServiceModel serchByCondition(@RequestParam Integer battGroupId,@RequestParam Integer test_record_count) { |
| | | Ld9testdatastop ld9 = new Ld9testdatastop(); |
| | | ld9.setBattGroupId(battGroupId); //1000002 |
| | | ld9.setTest_record_count(test_record_count); //2 |
| | | ServiceModel model=service.serchByCondition(ld9); |
| | | return model; |
| | | } |
| | |
| | | //根据电池组id;单体编号,test_record_count查询测试结束的信息 |
| | | @PostMapping("byInfo") |
| | | @ApiOperation(notes = "",value="电池组id;单体编号,test_record_count查询测试结束的信息") |
| | | public ServiceModel serchByInfo(@RequestBody Ld9testdatastop ld9){ |
| | | ServiceModel model=service.serchByInfo(ld9); |
| | | public ServiceModel serchByInfo(@RequestParam Integer battGroupId,@RequestParam Integer test_record_count,@RequestParam Integer test_monnum) { |
| | | Ld9testdatastop ld9 = new Ld9testdatastop(); |
| | | ld9.setBattGroupId(battGroupId); //1000002 |
| | | ld9.setTest_record_count(test_record_count);//2 |
| | | ld9.setTest_monnum(test_monnum); //1 |
| | | ServiceModel model=service.serchByInfo(ld9);//2 |
| | | return model; |
| | | } |
| | | |
| | |
| | | * Ld9:op_cmd:0:全部;1:fbs9100,2:fbs9600,3:ld9 |
| | | * dev_errcommcount;0:通讯正常,1:通讯中断,100:全部 |
| | | * */ |
| | | public List serchByCondition(Object obj); |
| | | public List serchByCondition(LD9_state obj); |
| | | |
| | | } |
| | |
| | | return model; |
| | | } |
| | | //11.1LD9设备通信状态查询 |
| | | public ServiceModel serchByCondition(LD9_state ld9){ |
| | | public ServiceModel serchByCondition(LD9_state ld9) { |
| | | ServiceModel model = new ServiceModel(); |
| | | //LD9数据 |
| | | PageBean pageBean = ld9.getPageBean(); |
| | | PageHelper.startPage(pageBean.getPageNum(),pageBean.getPageSize()); |
| | | List list = mapper.serchByCondition(ld9); |
| | | PageInfo<Fbs9100_state> pageInfo = new PageInfo<Fbs9100_state>(list); |
| | | if(list!=null && list.size()>0){ |
| | | PageHelper.startPage(pageBean.getPageNum(), pageBean.getPageSize()); |
| | | List list = mapper.serchByCondition(ld9); |
| | | if (list != null && list.size() > 0) { |
| | | PageInfo<Fbs9100_state> pageInfo = new PageInfo<Fbs9100_state>(list); |
| | | model.setCode(1); |
| | | model.setData(pageInfo); |
| | | }else{ |
| | | } else { |
| | | model.setCode(0); |
| | | } |
| | | return model; |
| | |
| | | COUNT(DISTINCT db_battinf.tb_battinf.BattGroupId) as cnt, |
| | | group_CONCAT(db_ram_db.tb_batt_rtstate.online_vol ORDER BY db_ram_db.tb_batt_rtstate.BattGroupId separator '/') as online_vols, |
| | | group_CONCAT(db_ram_db.tb_batt_rtstate.group_vol ORDER BY db_ram_db.tb_batt_rtstate.BattGroupId separator '/') as group_vols, |
| | | group_CONCAT(db_ram_db.tb_batt_rtstate.group_curr ORDER BY db_ram_db.tb_batt_rtstate.BattGroupId separator '/') as group_currs , |
| | | from db_ram_db.tb_ld9_state, |
| | | left outer join db_battinf.tb_battinf ON db_ram_db.tb_ld9_state.dev_id=db_battinf.tb_battinf.FBSDeviceId , |
| | | LEFT OUTER JOIN db_ram_db.tb_batt_rtstate ON db_battinf.tb_battinf.battgroupid=db_ram_db.tb_batt_rtstate.battgroup, |
| | | group_CONCAT(db_ram_db.tb_batt_rtstate.group_curr ORDER BY db_ram_db.tb_batt_rtstate.BattGroupId separator '/') as group_currs |
| | | from db_ram_db.tb_ld9_state |
| | | left outer join db_battinf.tb_battinf ON db_ram_db.tb_ld9_state.dev_id=db_battinf.tb_battinf.FBSDeviceId |
| | | LEFT OUTER JOIN db_ram_db.tb_batt_rtstate ON db_battinf.tb_battinf.battgroupid=db_ram_db.tb_batt_rtstate.battgroupid |
| | | <choose> |
| | | <when test="dev_errcommcount==0"> |
| | | where dev_errcommcount=0 |
| | |
| | | where dev_errcommcount>-1 |
| | | </otherwise> |
| | | </choose> |
| | | and db_battinf.tb_battinf.StationId in (select distinct db_battinf.tb_battinf.StationId, |
| | | from db_battinf.tb_battinf,db_user.tb_user_battgroup_baojigroup_battgroup,db_user.tb_user_battgroup_baojigroup_usr,db_user.tb_user_inf , |
| | | where db_user.tb_user_battgroup_baojigroup_battgroup.BattGroupId=db_battinf.tb_battinf.BattGroupId , |
| | | and db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id=db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id , |
| | | and db_user.tb_user_inf.uid=db_user.tb_user_battgroup_baojigroup_usr.uid , |
| | | and db_user.tb_user_inf.uid=? ) , |
| | | and db_battinf.tb_battinf.StationId in (select distinct db_battinf.tb_battinf.StationId |
| | | from db_battinf.tb_battinf,db_user.tb_user_battgroup_baojigroup_battgroup,db_user.tb_user_battgroup_baojigroup_usr,db_user.tb_user_inf |
| | | where db_user.tb_user_battgroup_baojigroup_battgroup.BattGroupId=db_battinf.tb_battinf.BattGroupId |
| | | and db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id=db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id |
| | | and db_user.tb_user_inf.uid=db_user.tb_user_battgroup_baojigroup_usr.uid |
| | | and db_user.tb_user_inf.uid=#{num}) |
| | | GROUP BY db_ram_db.tb_ld9_state.dev_id |
| | | </select> |
| | | </mapper> |