| | |
| | | @Override |
| | | @Transactional |
| | | public int insertArdAlarmpointsWell(ArdAlarmpointsWell ardAlarmpointsWell) { |
| | | boolean wellIdExists = ardAlarmpointsWellMapper.checkWellIdExists(ardAlarmpointsWell.getWellId()); |
| | | boolean wellIdExists = checkWellIdExists(ardAlarmpointsWell); |
| | | if(wellIdExists) |
| | | { |
| | | throw new RuntimeException("井号已存在"); |
| | |
| | | @Override |
| | | @Transactional |
| | | public int updateArdAlarmpointsWell(ArdAlarmpointsWell ardAlarmpointsWell) { |
| | | boolean wellIdExists = ardAlarmpointsWellMapper.checkWellIdExists(ardAlarmpointsWell.getWellId()); |
| | | boolean wellIdExists = checkWellIdExists(ardAlarmpointsWell); |
| | | if(wellIdExists) |
| | | { |
| | | throw new RuntimeException("井号已存在"); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 核对井号是否唯一 |
| | | * |
| | | * @param wellId 需要核对的井号 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public Boolean checkWellIdExists(ArdAlarmpointsWell well) { |
| | | // 校验:wellId |
| | | String id = (well.getId() == null) ? "" : well.getId(); |
| | | String wellId = well.getWellId(); |
| | | ArdAlarmpointsWell ardAlarmpointsWell = ardAlarmpointsWellMapper.checkWellIdExists(wellId); |
| | | String infoId = (ardAlarmpointsWell == null) ? "" : (ardAlarmpointsWell.getId()); |
| | | if ((ardAlarmpointsWell != null) && !((infoId).equals(id))) { |
| | | //已存在 |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | @Override |
| | | public List<ArdAlarmpointsWell> wellByDeptList(List<Long> deptList) { |