初始化

This commit is contained in:
hukekuan@163.com 2018-01-27 18:02:37 +08:00
parent 3801f03f37
commit ac0dfedd2c
3 changed files with 39 additions and 248 deletions

View File

@ -9,8 +9,8 @@ import java.util.Map;
public class Source { public class Source {
private String sourceId; private String sourceId;
private String sourceName; private String sourceName;
private String url; private String type;
private java.util.Map<String,Object> params; private java.util.Map<String,Object> options;
private String description; private String description;
public String getSourceId() { public String getSourceId() {
@ -29,14 +29,6 @@ public class Source {
this.sourceName = sourceName; this.sourceName = sourceName;
} }
public java.util.Map<String, Object> getParams() {
return params;
}
public void setParams(Map<String, Object> params) {
this.params = params;
}
public String getDescription() { public String getDescription() {
return description; return description;
} }
@ -45,11 +37,19 @@ public class Source {
this.description = description; this.description = description;
} }
public String getUrl() { public String getType() {
return url; return type;
} }
public void setUrl(String url) { public void setType(String type) {
this.url = url; this.type = type;
}
public Map<String, Object> getOptions() {
return options;
}
public void setOptions(Map<String, Object> options) {
this.options = options;
} }
} }

View File

@ -130,10 +130,10 @@ create table c3gis_ol_source_wmts(
); );
create table c3gis_ol_source( create table c3gis_ol_source(
sourceid varchar(50) not null PRIMARY KEY, sourceId varchar(50) not null PRIMARY KEY,
sourcename varchar(50) not null, sourceName varchar(50) not null,
url varchar(50) not null, type varchar(50) not null,
params jsonb, options jsonb,
description varchar(50) description varchar(50)
); );

View File

@ -1,247 +1,38 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.gis3c.ol.dao.SourceDao"> <mapper namespace="com.gis3c.ol.dao.SourceDao">
<resultMap id="wmtsResult" type="com.gis3c.ol.entity.source.Wmts">
<result property="sourceId" column="sourceid" />
<result property="sourceName" column="sourcename" />
<result property="url" column="url" />
<result property="layer" column="layer" />
<result property="style" column="style" />
<result property="format" column="format" />
<result property="matrixSet" column="matrixSet" />
<result property="description" column="description" />
</resultMap>
<resultMap id="vectorResult" type="com.gis3c.ol.entity.source.Vector">
<result property="sourceId" column="sourceid" />
<result property="sourceName" column="sourcename" />
<result property="url" column="url" />
<result property="logo" column="logo" />
<result property="useSpatialIndex" column="useSpatialIndex" />
<result property="wrapX" column="wrapX" />
<result property="description" column="description" />
</resultMap>
<resultMap id="arcgisResult" type="com.gis3c.ol.entity.source.TileArcGISRest">
<result property="sourceId" column="sourceid" />
<result property="sourceName" column="sourcename" />
<result property="url" column="url" />
<result property="crossOrigin" column="crossOrigin" />
<result property="projection" column="projection" />
<result property="wrapX" column="wrapX" />
<result property="description" column="description" />
</resultMap>
<resultMap id="supermapResult" type="com.gis3c.ol.entity.source.TileSuperMapRest">
<result property="sourceId" column="sourceid" />
<result property="sourceName" column="sourcename" />
<result property="url" column="url" />
<result property="wrapX" column="wrapX" />
<result property="opaque" column="opaque" />
<result property="description" column="description" />
</resultMap>
<resultMap id="sourceResult" type="com.gis3c.ol.entity.Source"> <resultMap id="sourceResult" type="com.gis3c.ol.entity.Source">
<result property="sourceId" column="sourceid" /> <result property="sourceId" column="sourceId" />
<result property="sourceName" column="sourcename" /> <result property="sourceName" column="sourceName" />
<result property="url" column="url" /> <result property="type" column="type" />
<result property="params" column="params" javaType="ObjectJSON"/> <result property="options" column="options" javaType="ObjectJSON"/>
<result property="description" column="description" /> <result property="description" column="description" />
</resultMap> </resultMap>
<sql id="wmtsColumns"> <sql id="sourceColumns">
sourceid sourceId
, sourcename , sourceName
, url , type
, layer , options
, style
, format
, matrixSet
, description , description
</sql> </sql>
<sql id="vectorColumns">
sourceid
, sourcename
, url
, logo
, useSpatialIndex
, wrapX
, description
</sql>
<sql id="arcgisColumns">
sourceid
, sourcename
, url
, crossOrigin
, projection
, wrapX
, description
</sql>
<sql id="supermapColumns">
sourceid
, sourcename
, url
, wrapX
, opaque
, description
</sql>
<select id="findTileArcGISRestById" resultMap="arcgisResult">
SELECT
<include refid="arcgisColumns"/>
FROM c3gis_ol_source_tilearcgisrest
WHERE sourceid = #{sourceId, javaType=java.lang.String};
</select>
<select id="findTileArcGISRestByName" resultMap="arcgisResult">
SELECT
<include refid="arcgisColumns"/>
FROM c3gis_ol_source_tilearcgisrest
WHERE sourcename = #{sourceName, javaType=java.lang.String};
</select>
<insert id="insertTileArcGISRest" parameterType="com.gis3c.ol.entity.source.TileArcGISRest">
INSERT INTO c3gis_ol_source_tilearcgisrest(
sourceid
, sourcename
, url
, crossOrigin
, projection
, wrapX
, description
)
VALUES(
#{sourceId}
, #{sourceName}
, #{url}
, #{crossOrigin}
, #{projection}
, #{wrapX}
, #{description});
</insert>
<select id="findTileTileSuperMapRestById" resultMap="supermapResult">
SELECT
<include refid="supermapColumns"/>
FROM c3gis_ol_source_tilesupermaprest
WHERE sourceid = #{sourceId, javaType=java.lang.String};
</select>
<select id="findTileTileSuperMapRestByName" resultMap="supermapResult">
SELECT
<include refid="supermapColumns"/>
FROM c3gis_ol_source_tilesupermaprest
WHERE sourcename = #{sourceName, javaType=java.lang.String};
</select>
<insert id="insertTileSuperMapRest" parameterType="com.gis3c.ol.entity.source.TileSuperMapRest">
INSERT INTO c3gis_ol_source_tilesupermaprest(
sourceid
, sourcename
, url
, wrapX
, opaque
, description
)
VALUES(
#{sourceId}
, #{sourceName}
, #{url}
, #{wrapX}
, #{opaque}
, #{description});
</insert>
<select id="findVectorById" resultMap="vectorResult">
SELECT
<include refid="vectorColumns"/>
FROM c3gis_ol_source_vector
WHERE sourceid = #{sourceId, javaType=java.lang.String};
</select>
<select id="findVectorByName" resultMap="vectorResult">
SELECT
<include refid="vectorColumns"/>
FROM c3gis_ol_source_vector
WHERE sourcename = #{sourceName, javaType=java.lang.String};
</select>
<insert id="insertVector" parameterType="com.gis3c.ol.entity.source.Vector">
INSERT INTO c3gis_ol_source_vector(
sourceid
, sourcename
, url
, logo
, useSpatialIndex
, wrapX
, description
)
VALUES(
#{sourceId}
, #{sourceName}
, #{url}
, #{logo}
, #{useSpatialIndex}
, #{wrapX}
, #{description});
</insert>
<select id="findWmtsById" resultMap="wmtsResult">
SELECT
<include refid="wmtsColumns"/>
FROM c3gis_ol_source_wmts
WHERE sourceid = #{sourceId, javaType=java.lang.String};
</select>
<select id="findWmtsByName" resultMap="wmtsResult">
SELECT
<include refid="wmtsColumns"/>
FROM c3gis_ol_source_wmts
WHERE sourcename = #{sourceName, javaType=java.lang.String};
</select>
<insert id="insertWmts" parameterType="com.gis3c.ol.entity.source.Wmts">
INSERT INTO c3gis_ol_source_wmts(
sourceid
, sourcename
, url
, layer
, style
, format
, matrixSet
, description
)
VALUES(
#{sourceId}
, #{sourceName}
, #{url}
, #{layer}
, #{style}
, #{format}
, #{matrixSet}
, #{description}
);
</insert>
<select id="findAllSources" resultMap="sourceResult"> <select id="findAllSources" resultMap="sourceResult">
SELECT sourceid,sourcename,url,params,description SELECT
<include refid="sourceColumns"/>
FROM c3gis_ol_source; FROM c3gis_ol_source;
</select> </select>
<insert id="insertSource" parameterType="com.gis3c.ol.entity.Source"> <insert id="insertSource" parameterType="com.gis3c.ol.entity.Source">
INSERT INTO c3gis_ol_source( INSERT INTO c3gis_ol_source(sourceId
sourceid , sourceName
, sourcename , type
, url , options
, params
, description , description
) )
VALUES( VALUES(#{sourceId}
#{sourceId}
, #{sourceName} , #{sourceName}
, #{url} , #{type}
, #{params, javaType=ObjectJSON}::jsonb , #{options, javaType=ObjectJSON}::jsonb
, #{description} , #{description}
); );
</insert> </insert>