初始化

This commit is contained in:
hukekuan@163.com 2018-02-06 18:17:48 +08:00
parent 9ba507cb45
commit 968f8c4d98
10 changed files with 49 additions and 22 deletions

View File

@ -19,7 +19,9 @@ public interface SourceDao {
@Param("currentPage") Integer currentPage);
public Source findSourceById(String sourceId);
public Source findSourceByName(String sourceName);
public List<Source> findSourceByType(String[] sourceTypes);
public List<Source> findSourceByType(
@Param("sourceTypes") String[] sourceTypes,
@Param("projection") String projection);
public Integer insertSource(Source source);
public Integer deleteSourcesById(Set<String> sourceIds);

View File

@ -18,6 +18,7 @@ public class Layer {
private Integer zIndex = 0;
private BigDecimal maxResolution;
private BigDecimal minResolution;
private String projection;
private String type;
private java.util.Map<String,Object> options;
private String description;
@ -149,4 +150,12 @@ public class Layer {
return sourceTypeArray;
}
public String getProjection() {
return projection;
}
public void setProjection(String projection) {
this.projection = projection;
}
}

View File

@ -10,6 +10,7 @@ public class Source {
private String sourceId;
private String sourceName;
private String type;
private String projection;
private java.util.Map<String,Object> options;
private String description;
@ -45,6 +46,14 @@ public class Source {
this.type = type;
}
public String getProjection() {
return projection;
}
public void setProjection(String projection) {
this.projection = projection;
}
public Map<String, Object> getOptions() {
return options;
}

View File

@ -14,7 +14,7 @@ public interface SourceService {
public List<java.util.Map<String,Object>> findSourcesByPage(Integer pageSize,Integer currentPage);
public Source findSourceById(String sourceId);
public Source findSourceByName(String sourceName);
public List<Source> findSourceByType(String[] sourceTypes);
public List<Source> findSourceByType(String[] sourceTypes,String projection);
public Integer insertSource(Source source);

View File

@ -1,10 +1,8 @@
package com.gis3c.ol.service.impl;
import com.gis3c.common.bean.BeanUtil;
import com.gis3c.common.exception.BusinessException;
import com.gis3c.ol.dao.LayerDao;
import com.gis3c.ol.entity.Layer;
import com.gis3c.ol.entity.Source;
import com.gis3c.ol.service.LayerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

View File

@ -3,7 +3,6 @@ package com.gis3c.ol.service.impl;
import com.gis3c.common.bean.BeanUtil;
import com.gis3c.common.exception.BusinessException;
import com.gis3c.ol.dao.SourceDao;
import com.gis3c.ol.entity.Map;
import com.gis3c.ol.entity.Source;
import com.gis3c.ol.service.SourceService;
import org.springframework.beans.factory.annotation.Autowired;
@ -49,8 +48,8 @@ public class SourceServiceImpl implements SourceService {
}
@Override
public List<Source> findSourceByType(String[] sourceTypes) {
return sourceDao.findSourceByType(sourceTypes);
public List<Source> findSourceByType(String[] sourceTypes,String projection) {
return sourceDao.findSourceByType(sourceTypes,projection);
}
@Override

View File

@ -135,6 +135,7 @@ create table c3gis_ol_source(
sourceId varchar(50) not null PRIMARY KEY,
sourceName varchar(50) not null,
type varchar(50) not null,
projection varchar(50) not null,
options jsonb,
description varchar(50)
);

View File

@ -29,11 +29,14 @@ public class App {
MapService mapService = context.getBean(MapService.class);
TestService testService = context.getBean(TestService.class);
Integer result = layerService.bindSource("aabb842e-239e-491d-9c70-a2cec1f65886","d67de989-d351-4ba2-b3ac-021130ae19d4");
System.out.println(result);
// Integer result = layerService.bindSource("aabb842e-239e-491d-9c70-a2cec1f65886","d67de989-d351-4ba2-b3ac-021130ae19d4");
// System.out.println(result);
// List<Source> sourceList = sourceService.findSourceByType(new String[]{"a","b","c"});
// Layer queryLayer = layerService.findeLayerById("123");
// System.out.println(queryLayer);
// List<Source> sourceList = sourceService.findSourceByType(new String[]{"ol.source.WMTS"},"EPSG:4326");
//
// System.out.println(sourceList);
// sourceList.forEach(u -> System.out.println(u));
@ -110,16 +113,13 @@ public class App {
// System.out.println("插入成功");
//图层接口
// Layer layer = new Layer();
// layer.setLayerName("streetmap");
// layer.setAliasName("超图行政区图");
// layer.setSource("d7cb5f6f-ee31-4a6e-b8fd-72603a066c2b");
// layer.setType("ol.layer.Tile");
// java.util.Map<String,Object> options = new HashMap<>();
// options.put("projection","EPSG:4326");
// layer.setOptions(options);
// layerService.insertLayer(layer);
// System.out.println("插入成功");
Layer layer = new Layer();
layer.setLayerName("sdkqbigdata");
layer.setAliasName("大屏行政区");
layer.setType("ol.layer.Tile");
layer.setProjection("EPSG:3857");
layerService.insertLayer(layer);
System.out.println("插入成功");
//资源接口

View File

@ -12,6 +12,7 @@
<result property="zIndex" column="zIndex" />
<result property="maxResolution" column="maxResolution" />
<result property="minResolution" column="minResolution" />
<result property="projection" column="projection" />
<result property="type" column="type" />
<result property="options" column="options" javaType="ObjectJSON"/>
<result property="description" column="description" />
@ -28,6 +29,7 @@
, zIndex
, minResolution
, maxResolution
, projection
, type
, options
, description
@ -71,6 +73,7 @@
, zIndex
, minResolution
, maxResolution
, projection
, type
, options
, description
@ -85,6 +88,7 @@
, #{zIndex}
, #{maxResolution}
, #{minResolution}
, #{projection}
, #{type}
, #{options, javaType=ObjectJSON}::jsonb
, #{description}

View File

@ -5,6 +5,7 @@
<result property="sourceId" column="sourceId" />
<result property="sourceName" column="sourceName" />
<result property="type" column="type" />
<result property="projection" column="projection" />
<result property="options" column="options" javaType="ObjectJSON"/>
<result property="description" column="description" />
</resultMap>
@ -13,6 +14,7 @@
sourceId
, sourceName
, type
, projection
, options
, description
</sql>
@ -47,22 +49,25 @@
<include refid="sourceColumns"/>
FROM c3gis_ol_source
WHERE type in
<foreach collection ="array" item="item" index="index" open="(" separator="," close=")">
<foreach collection ="sourceTypes" item="item" index="index" open="(" separator="," close=")">
#{item, javaType=java.lang.String}
</foreach>
ORDER BY type;
and projection = #{projection, javaType=java.lang.String}
ORDER BY sourceName;
</select>
<insert id="insertSource" parameterType="com.gis3c.ol.entity.Source">
INSERT INTO c3gis_ol_source(sourceId
, sourceName
, type
, projection
, options
, description
)
VALUES(#{sourceId}
, #{sourceName}
, #{type}
, #{projection}
, #{options, javaType=ObjectJSON}::jsonb
, #{description}
);