| | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.whyc.mapper.CKPowerDevBattRtStateMapper; |
| | | 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; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | @Resource |
| | | private CKPowerDevBattRtStateMapper mapper; |
| | | |
| | | @Autowired |
| | | private CKPwrDevInfService ckPwrDevInfService; |
| | | |
| | | public List<CKPowerDevBattRtState> getList() { |
| | | //查询有单体数量 |
| | | CKPwrDevInf ckPwrDevInf = ckPwrDevInfService.get(); |
| | | |
| | | public CKPowerDevBattRtState get(Integer battIndex) { |
| | | QueryWrapper<CKPowerDevBattRtState> query = Wrappers.query(); |
| | | query.eq("batt_index",0); |
| | | query.le("mon_num",ckPwrDevInf.getBattMonCount()); |
| | | return mapper.selectList(query); |
| | | if(battIndex!=null) { |
| | | if(battIndex == -1) { //首页上使用,默认只查组1 |
| | | query.eq("batt_index", 0); |
| | | }else{ |
| | | query.eq("batt_index", battIndex); |
| | | } |
| | | } |
| | | query.last(" limit 1"); |
| | | return mapper.selectOne(query); |
| | | } |
| | | //获取rtState默认第一组0表数据更新到set表中 |
| | | public CKPowerDevBattRtState getStateLsit_index0(int i) { |
| | | QueryWrapper<CKPowerDevBattRtState> query = Wrappers.query(); |
| | | query.eq("batt_index", 0); |
| | | query.last(" limit 1"); |
| | | return mapper.selectOne(query); |
| | | } |
| | | } |