| | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.whyc.mapper.CKPowerDevBattRtDataMapper; |
| | | import com.whyc.pojo.db_ckpwrdev_data_rt.CKPowerDevBattRtData; |
| | | import com.whyc.pojo.db_ckpwrdev_data_rt.CKPowerDevBattRtState; |
| | | import com.whyc.pojo.db_ckpwrdev_inf.CKPwrDevInf; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | query.le("mon_num",ckPwrDevInf.getBattMonCount()); |
| | | return mapper.selectList(query); |
| | | } |
| | | |
| | | |
| | | /**单体列表查询*/ |
| | | public List<CKPowerDevBattRtData> getMonList(Integer battIndex, List<Integer> monNumList) { |
| | | QueryWrapper<CKPowerDevBattRtData> query = Wrappers.query(); |
| | | if(battIndex!=null) { |
| | | if(battIndex == -1) { //首页上使用,默认只查组1 |
| | | query.eq("batt_index", 0); |
| | | }else{ |
| | | query.eq("batt_index", battIndex); |
| | | } |
| | | } |
| | | query.in("mon_num",monNumList); |
| | | return mapper.selectList(query); |
| | | } |
| | | |
| | | /**组内所有单体列表查询*/ |
| | | public List<CKPowerDevBattRtData> getAllMonList(Integer battIndex) { |
| | | QueryWrapper<CKPowerDevBattRtData> query = Wrappers.query(); |
| | | if(battIndex!=null) { |
| | | if(battIndex == -1) { //首页上使用,默认只查组1 |
| | | query.eq("batt_index", 0); |
| | | }else{ |
| | | query.eq("batt_index", battIndex); |
| | | } |
| | | } |
| | | return mapper.selectList(query); |
| | | } |
| | | |
| | | //获取默认第一组单体数据刷新至第一组0 |
| | | public List<CKPowerDevBattRtData> getDataList_index0() { |
| | | QueryWrapper<CKPowerDevBattRtData> wrapper = Wrappers.query(); |
| | | wrapper.eq("batt_index",0); |
| | | wrapper.orderByAsc("mon_num"); |
| | | return mapper.selectList(wrapper); |
| | | } |
| | | } |