diff --git a/src/main/java/com/telpo/dipperposition/service/impl/ProvinceInfoServiceImpl.java b/src/main/java/com/telpo/dipperposition/service/impl/ProvinceInfoServiceImpl.java index 9ca927e..b124ac9 100644 --- a/src/main/java/com/telpo/dipperposition/service/impl/ProvinceInfoServiceImpl.java +++ b/src/main/java/com/telpo/dipperposition/service/impl/ProvinceInfoServiceImpl.java @@ -15,6 +15,7 @@ import org.springframework.stereotype.Service; import tools.BeanTools; import java.util.List; +import java.util.Optional; /** * @program: DataPushServer @@ -56,14 +57,13 @@ public class ProvinceInfoServiceImpl implements IProvinceInfoService { ProvinceInfoEntity query = new ProvinceInfoEntity(); query.setProvince(provicne); Example example = Example.of(query); - PageRequest pageable = PageRequest.of(0, 1); - Page data = provinceInfoMapper.findAll(example, pageable); - if (CollectionUtil.isNotEmpty(data.getContent())) { - List provinceInfos = BeanTools.copyList(data.getContent(), ProvinceInfoEntity.class); - return provinceInfos.get(0); - } else { - return null; - } +// PageRequest pageable = PageRequest.of(0, 1); + Optional data = provinceInfoMapper.findOne(example); +// if (CollectionUtil.isNotEmpty(data.getContent())) { +// +// List provinceInfos = BeanTools.copyList(data.getContent(), ProvinceInfoEntity.class); +// return provinceInfos.get(0); + return data.get(); } catch (Exception e) { log.error("获取省份异常:", e); return null;