| | |
| | | package com.whyc.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.whyc.mapper.StationPowerRelationMapper; |
| | | import com.whyc.pojo.db_batt.StationPowerRelation; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | relation.setStationId(stationId); |
| | | relation.setPowerId(powerId); |
| | | //获取最大num |
| | | int num = mapper.getMaxNum(); |
| | | relation.setNum(num+1); |
| | | //int num = mapper.getMaxNum(); |
| | | //relation.setNum(num+1); |
| | | mapper.insert(relation); |
| | | } |
| | | |
| | | public void deleteByPowerId(int powerId) { |
| | | UpdateWrapper<StationPowerRelation> update = Wrappers.update(); |
| | | update.eq("pinf_id",powerId); |
| | | mapper.delete(update); |
| | | } |
| | | } |