| | |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.sun.javafx.collections.MappingChange; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.mapper.BattInfMapper; |
| | | import com.whyc.mapper.BattRtdataMapper; |
| | | import com.whyc.pojo.BattRtdata; |
| | | import com.whyc.pojo.BattRtstate; |
| | | import com.whyc.pojo.Battinf; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | |
| | | @Resource |
| | | private BattRtdataMapper mapper; |
| | | |
| | | @Resource |
| | | private BattInfMapper binfMapper; |
| | | //根据电池组id查询该电池组中所有电池信息(图表数据) |
| | | @Transactional |
| | | public Response serchByCondition(int battGroupId) { |
| | |
| | | } |
| | | //查询电池组单体实时信息 |
| | | public Response serchPowerHr6159(int devId) { |
| | | List<BattRtdata> list= mapper.serchPowerHr6159(devId); |
| | | return new Response().setII(1,list!=null,list,"查询电池组单体实时信息"); |
| | | //1.取电池组id按顺序组1组2 |
| | | QueryWrapper<Battinf> query = Wrappers.query(); |
| | | query.select("distinct BattGroupId,GroupIndexInFBSDevice ").orderByAsc("GroupIndexInFBSDevice"); |
| | | List<Battinf> infList= binfMapper.selectList(query); |
| | | Map<Integer,List> map=new HashMap<>(); |
| | | for (Battinf binf:infList) { |
| | | int battGroupId=binf.getBattGroupId(); |
| | | int groupIndex=binf.getGroupIndexInFBSDevice(); |
| | | QueryWrapper wrapper = new QueryWrapper(); |
| | | wrapper.eq("BattGroupId",battGroupId); |
| | | List<BattRtdata> rtdataList = mapper.selectList(wrapper); |
| | | map.put(groupIndex,rtdataList); |
| | | } |
| | | return new Response().setII(1,map.size()>0,map,"查询电池组单体实时信息"); |
| | | } |
| | | } |