初始化
This commit is contained in:
parent
470274def3
commit
346500c687
@ -28,6 +28,22 @@ public class App {
|
||||
MapService mapService = context.getBean(MapService.class);
|
||||
|
||||
|
||||
//地图接口
|
||||
Map map = mapService.findMapById("fc813a1f-6a31-4202-9419-8d125ba203c9");
|
||||
System.out.println(map.getLayers()[0][1]);
|
||||
// Map map = new Map();
|
||||
// map.setMapId(UUID.randomUUID().toString());
|
||||
// map.setMapName("综合GIS系统");
|
||||
// map.setView("ee2f96a0-097a-4f0a-9767-f52b8dae28e0");
|
||||
// map.setLogo(false);
|
||||
// map.setLayers(new String[][]{
|
||||
// {"TileLayer","182a8b18-d26f-43da-9b3a-6f90af4825ed"},
|
||||
// {"TileLayer","8c396460-9995-4387-8aa1-bb16c2595bba"},
|
||||
// {"TileLayer","ad433664-3b2c-4b1b-b271-519b7f647a11"}
|
||||
// });
|
||||
// mapService.insertMap(map);
|
||||
//
|
||||
// System.out.println("插入成功");
|
||||
|
||||
//图层接口
|
||||
// TileLayer wmtsLayer = new TileLayer();
|
||||
|
||||
@ -2,7 +2,6 @@ package com.gis3c.ol.dao;
|
||||
|
||||
import com.gis3c.common.persistence.annotation.C3BatisDao;
|
||||
import com.gis3c.ol.entity.Map;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -11,4 +10,8 @@ import java.util.List;
|
||||
@C3BatisDao
|
||||
public interface MapDao {
|
||||
public List<Map> findAllList();
|
||||
|
||||
public Map findMapById(String mapId);
|
||||
public Map findMapByName(String mapName);
|
||||
public Integer insertMap(Map map);
|
||||
}
|
||||
|
||||
@ -31,6 +31,22 @@ public class Map {
|
||||
this.mapName = mapName;
|
||||
}
|
||||
|
||||
public String getView() {
|
||||
return view;
|
||||
}
|
||||
|
||||
public void setView(String view) {
|
||||
this.view = view;
|
||||
}
|
||||
|
||||
public String[][] getControls() {
|
||||
return controls;
|
||||
}
|
||||
|
||||
public void setControls(String[][] controls) {
|
||||
this.controls = controls;
|
||||
}
|
||||
|
||||
public Integer getPixelRatio() {
|
||||
return pixelRatio;
|
||||
}
|
||||
@ -47,14 +63,6 @@ public class Map {
|
||||
this.interactions = interactions;
|
||||
}
|
||||
|
||||
public String getView() {
|
||||
return view;
|
||||
}
|
||||
|
||||
public void setView(String view) {
|
||||
this.view = view;
|
||||
}
|
||||
|
||||
public String[][] getLayers() {
|
||||
return layers;
|
||||
}
|
||||
@ -71,22 +79,6 @@ public class Map {
|
||||
this.logo = logo;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String[][] getControls() {
|
||||
return controls;
|
||||
}
|
||||
|
||||
public void setControls(String[][] controls) {
|
||||
this.controls = controls;
|
||||
}
|
||||
|
||||
public String[][] getOverlays() {
|
||||
return overlays;
|
||||
}
|
||||
@ -94,4 +86,12 @@ public class Map {
|
||||
public void setOverlays(String[][] overlays) {
|
||||
this.overlays = overlays;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,4 +9,8 @@ import java.util.List;
|
||||
*/
|
||||
public interface MapService {
|
||||
public List<Map> findAllList();
|
||||
|
||||
public Map findMapById(String mapId);
|
||||
public Map findMapByName(String mapName);
|
||||
public Integer insertMap(Map map);
|
||||
}
|
||||
|
||||
@ -20,4 +20,19 @@ public class MapServiceImpl implements MapService {
|
||||
public List<Map> findAllList() {
|
||||
return mapDao.findAllList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map findMapById(String mapId) {
|
||||
return mapDao.findMapById(mapId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map findMapByName(String mapName) {
|
||||
return mapDao.findMapByName(mapName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer insertMap(Map map) {
|
||||
return mapDao.insertMap(map);
|
||||
}
|
||||
}
|
||||
|
||||
@ -21,13 +21,13 @@ public class ArrayTypeHandler extends BaseTypeHandler<Object[]> {
|
||||
@Override
|
||||
public void setNonNullParameter(PreparedStatement ps, int i, Object[] parameter, JdbcType jdbcType) throws SQLException {
|
||||
String typeName = null;
|
||||
if (parameter instanceof Integer[]) {
|
||||
if (parameter instanceof Integer[] || parameter instanceof Integer[][]) {
|
||||
typeName = TYPE_NAME_INTEGER;
|
||||
} else if (parameter instanceof String[]) {
|
||||
} else if (parameter instanceof String[] || parameter instanceof String[][]) {
|
||||
typeName = TYPE_NAME_VARCHAR;
|
||||
} else if (parameter instanceof Boolean[]) {
|
||||
} else if (parameter instanceof Boolean[] || parameter instanceof Boolean[][]) {
|
||||
typeName = TYPE_NAME_BOOLEAN;
|
||||
} else if (parameter instanceof Double[]) {
|
||||
} else if (parameter instanceof Double[] || parameter instanceof Boolean[][]) {
|
||||
typeName = TYPE_NAME_NUMERIC;
|
||||
}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.gis3c.ol.dao.MapDao">
|
||||
<resultMap id="mapResult" type="com.gis3c.ol.entity.Map">
|
||||
<id property="mapId" column="mapid" />
|
||||
<result property="mapId" column="mapid" />
|
||||
<result property="mapName" column="mapname" />
|
||||
<result property="view" column="view" />
|
||||
<result property="controls" column="controls" javaType="ObjectArray"/>
|
||||
@ -32,4 +32,41 @@
|
||||
<include refid="mapColumns"/>
|
||||
FROM c3gis_ol_map;
|
||||
</select>
|
||||
|
||||
<select id="findMapById" resultMap="mapResult">
|
||||
SELECT
|
||||
<include refid="mapColumns" />
|
||||
FROM c3gis_ol_map
|
||||
WHERE mapid = #{mapId, javaType=java.lang.String};
|
||||
</select>
|
||||
<select id="findMapByName" resultMap="mapResult">
|
||||
SELECT
|
||||
<include refid="mapColumns" />
|
||||
FROM c3gis_ol_map
|
||||
WHERE mapname = #{mapName, javaType=java.lang.String};
|
||||
</select>
|
||||
<insert id="insertMap" parameterType="com.gis3c.ol.entity.Map">
|
||||
INSERT INTO c3gis_ol_map(
|
||||
mapid
|
||||
, mapname
|
||||
, view
|
||||
, controls
|
||||
, pixelRatio
|
||||
, interactions
|
||||
, layers
|
||||
, logo
|
||||
, overlays
|
||||
, description) VALUES (
|
||||
#{mapId}
|
||||
, #{mapName}
|
||||
, #{view}
|
||||
, #{controls, javaType=ObjectArray}
|
||||
, #{pixelRatio}
|
||||
, #{interactions, javaType=ObjectArray}
|
||||
, #{layers, javaType=ObjectArray}
|
||||
, #{logo}
|
||||
, #{overlays, javaType=ObjectArray}
|
||||
, #{description}
|
||||
);
|
||||
</insert>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue
Block a user