初始化

This commit is contained in:
hukekuan@163.com 2018-02-12 17:39:37 +08:00
parent 968f8c4d98
commit 15c0403604
5 changed files with 30 additions and 15 deletions

View File

@ -21,8 +21,11 @@ public interface LayerDao {
public Layer findeLayerByName(String layerName); public Layer findeLayerByName(String layerName);
public Integer insertLayer(Layer layer); public Integer insertLayer(Layer layer);
public Integer bindSource( public Integer bindSource(
@Param("layerId") String layerId, @Param("layerId") String layerId,
@Param("sourceId") String sourceId); @Param("sourceId") String sourceId,
@Param("options") java.util.Map<String,Object> options
);
public Integer deleteLayersById(Set<String> layerIds); public Integer deleteLayersById(Set<String> layerIds);
} }

View File

@ -17,6 +17,6 @@ public interface LayerService {
public Layer findeLayerByName(String layerName); public Layer findeLayerByName(String layerName);
public Integer insertLayer(Layer layer); public Integer insertLayer(Layer layer);
public Integer bindSource(String layerId,String sourceId); public Integer bindSource(String layerId,String sourceId,java.util.Map<String,Object> options);
public Integer deleteLayersById(Set<String> layerIds); public Integer deleteLayersById(Set<String> layerIds);
} }

View File

@ -7,10 +7,7 @@ import com.gis3c.ol.service.LayerService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList; import java.util.*;
import java.util.List;
import java.util.Set;
import java.util.UUID;
/** /**
* Created by hukekuan on 2017/12/15. * Created by hukekuan on 2017/12/15.
@ -56,8 +53,8 @@ public class LayerServiceImpl implements LayerService {
} }
@Override @Override
public Integer bindSource(String layerId, String sourceId) { public Integer bindSource(String layerId, String sourceId, Map<String, Object> options) {
return layerDao.bindSource(layerId,sourceId); return layerDao.bindSource(layerId,sourceId,options);
} }
@Override @Override

View File

@ -29,6 +29,17 @@ public class App {
MapService mapService = context.getBean(MapService.class); MapService mapService = context.getBean(MapService.class);
TestService testService = context.getBean(TestService.class); TestService testService = context.getBean(TestService.class);
// java.util.Map<String,Object> layerOptions = new HashMap<>();
// layerOptions.put("a","aaaaaaaa");
// layerOptions.put("b","bbbbbbbb");
// layerOptions.put("c","cccccccc");
// layerService.bindVectorSource(
// "9e3a9812-5921-45c9-9043-e52d81fff1bb",
// "4f21a864-3e81-4ee1-97b7-6d18a876b5c1",
// layerOptions);
// System.out.println("更新成功");
// Integer result = layerService.bindSource("aabb842e-239e-491d-9c70-a2cec1f65886","d67de989-d351-4ba2-b3ac-021130ae19d4"); // Integer result = layerService.bindSource("aabb842e-239e-491d-9c70-a2cec1f65886","d67de989-d351-4ba2-b3ac-021130ae19d4");
// System.out.println(result); // System.out.println(result);
@ -113,13 +124,13 @@ public class App {
// System.out.println("插入成功"); // System.out.println("插入成功");
//图层接口 //图层接口
Layer layer = new Layer(); // Layer layer = new Layer();
layer.setLayerName("sdkqbigdata"); // layer.setLayerName("sdkqbigdata");
layer.setAliasName("大屏行政区"); // layer.setAliasName("大屏行政区");
layer.setType("ol.layer.Tile"); // layer.setType("ol.layer.Tile");
layer.setProjection("EPSG:3857"); // layer.setProjection("EPSG:3857");
layerService.insertLayer(layer); // layerService.insertLayer(layer);
System.out.println("插入成功"); // System.out.println("插入成功");
//资源接口 //资源接口

View File

@ -94,9 +94,13 @@
, #{description} , #{description}
); );
</insert> </insert>
<update id="bindSource"> <update id="bindSource">
UPDATE c3gis_ol_layer UPDATE c3gis_ol_layer
SET source = #{sourceId, javaType=java.lang.String} SET source = #{sourceId, javaType=java.lang.String}
<if test="options != null">
, options = #{options, javaType=ObjectJSON}::jsonb
</if>
WHERE layerid = #{layerId, javaType=java.lang.String} WHERE layerid = #{layerId, javaType=java.lang.String}
</update> </update>