From b19f1ccabd1565a140129b94d26eef0cfc337efe Mon Sep 17 00:00:00 2001 From: "hukekuan@163.com" Date: Fri, 30 Mar 2018 18:05:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/gis3c/ol/dao/SourceDao.java | 2 +- src/main/java/com/gis3c/ol/service/SourceService.java | 2 +- .../com/gis3c/ol/service/impl/SourceServiceImpl.java | 5 +++++ src/test/resources/mappings/ol/SourceDao.xml | 10 +++++++++- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/gis3c/ol/dao/SourceDao.java b/src/main/java/com/gis3c/ol/dao/SourceDao.java index e5c3f64..19581bb 100644 --- a/src/main/java/com/gis3c/ol/dao/SourceDao.java +++ b/src/main/java/com/gis3c/ol/dao/SourceDao.java @@ -24,6 +24,6 @@ public interface SourceDao { @Param("projection") String projection); public Integer findSourceCount(); public Integer insertSource(Source source); - + public Integer updateSource(Source source); public Integer deleteSourcesById(Set sourceIds); } diff --git a/src/main/java/com/gis3c/ol/service/SourceService.java b/src/main/java/com/gis3c/ol/service/SourceService.java index 62c654a..ae49f57 100644 --- a/src/main/java/com/gis3c/ol/service/SourceService.java +++ b/src/main/java/com/gis3c/ol/service/SourceService.java @@ -18,6 +18,6 @@ public interface SourceService { public Integer findSourceCount(); public Integer insertSource(Source source); - + public Integer updateSource(Source source); public Integer deleteSourcesById(Set sourceIds); } diff --git a/src/main/java/com/gis3c/ol/service/impl/SourceServiceImpl.java b/src/main/java/com/gis3c/ol/service/impl/SourceServiceImpl.java index 525ff33..6df34b7 100644 --- a/src/main/java/com/gis3c/ol/service/impl/SourceServiceImpl.java +++ b/src/main/java/com/gis3c/ol/service/impl/SourceServiceImpl.java @@ -63,6 +63,11 @@ public class SourceServiceImpl implements SourceService { return sourceDao.insertSource(source); } + @Override + public Integer updateSource(Source source) { + return sourceDao.updateSource(source); + } + @Override public Integer deleteSourcesById(Set sourceIds) { return sourceDao.deleteSourcesById(sourceIds); diff --git a/src/test/resources/mappings/ol/SourceDao.xml b/src/test/resources/mappings/ol/SourceDao.xml index 0a9c26d..14a380a 100644 --- a/src/test/resources/mappings/ol/SourceDao.xml +++ b/src/test/resources/mappings/ol/SourceDao.xml @@ -74,7 +74,15 @@ , #{description} ); - + + UPDATE c3gis_ol_source SET + sourceName = #{sourceName}, + type = #{type}, + projection = #{projection}, + options = #{options, javaType=ObjectJSON}::jsonb, + description = #{description} + WHERE sourceId = #{sourceId}; + delete from c3gis_ol_source WHERE sourceId in