From 90c96317a59c26e810502661ddcae406aa49be57 Mon Sep 17 00:00:00 2001 From: linwl <304115325@qq.com> Date: Mon, 18 Jan 2021 19:30:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=88=B0docker=E5=A4=96?= =?UTF-8?q?=E8=BF=90=E8=A1=8C=E7=8E=AF=E5=A2=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/IPProvinceServiceImpl.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/java/com/telpo/dipperposition/service/impl/IPProvinceServiceImpl.java b/src/main/java/com/telpo/dipperposition/service/impl/IPProvinceServiceImpl.java index ca2de93..61282e7 100644 --- a/src/main/java/com/telpo/dipperposition/service/impl/IPProvinceServiceImpl.java +++ b/src/main/java/com/telpo/dipperposition/service/impl/IPProvinceServiceImpl.java @@ -26,6 +26,9 @@ public class IPProvinceServiceImpl implements IPProvinceService { @Override public boolean saveIPProvince(IPProvinceEntity entity) { + if (iPProvinceMapper == null) { + iPProvinceMapper = new IPProvinceMapper(); + } iPProvinceMapper.save(entity); return true; } @@ -33,12 +36,18 @@ public class IPProvinceServiceImpl implements IPProvinceService { @Override public boolean updateIPProvince( IPProvinceEntity query, IPProvinceEntity update) { + if (iPProvinceMapper == null) { + iPProvinceMapper = new IPProvinceMapper(); + } iPProvinceMapper.updateFirst(query, update); return true; } @Override public boolean romveById(String id) { + if (iPProvinceMapper == null) { + iPProvinceMapper = new IPProvinceMapper(); + } iPProvinceMapper.deleteById(id); return false; } @@ -48,6 +57,9 @@ public class IPProvinceServiceImpl implements IPProvinceService { try { IPProvinceEntity query = new IPProvinceEntity(); query.setIp(ipAddress); + if (iPProvinceMapper == null) { + iPProvinceMapper = new IPProvinceMapper(); + } List pushRecords = iPProvinceMapper.queryList(query); if (ObjectUtils.isNotEmpty(pushRecords)) { return pushRecords.get(0);