Browse Source

整合mybatis-plus查询

zhouyuexiang 1 year ago
parent
commit
d87aa6a78e
26 changed files with 661 additions and 35 deletions
  1. 25 0
      pom.xml
  2. 12 0
      tile-service/pom.xml
  3. 10 0
      tile-service/src/main/java/cn/com/taiji/tile/mapper/LgsqyMapper.java
  4. 10 0
      tile-service/src/main/java/cn/com/taiji/tile/mapper/ShapeStyleMapper.java
  5. 10 0
      tile-service/src/main/java/cn/com/taiji/tile/mapper/StgViewDeviceinfoDfMapper.java
  6. 50 0
      tile-service/src/main/java/cn/com/taiji/tile/model/Lgsqy.java
  7. 86 0
      tile-service/src/main/java/cn/com/taiji/tile/model/ShapeStyle.java
  8. 116 0
      tile-service/src/main/java/cn/com/taiji/tile/model/StgViewDeviceinfoDf.java
  9. 11 0
      tile-service/src/main/java/cn/com/taiji/tile/service/LgsqyService.java
  10. 11 0
      tile-service/src/main/java/cn/com/taiji/tile/service/ShapeStyleService.java
  11. 11 0
      tile-service/src/main/java/cn/com/taiji/tile/service/StgViewDeviceinfoDfService.java
  12. 16 0
      tile-service/src/main/java/cn/com/taiji/tile/service/impl/LgsqyServiceImpl.java
  13. 16 0
      tile-service/src/main/java/cn/com/taiji/tile/service/impl/ShapeStyleServiceImpl.java
  14. 16 0
      tile-service/src/main/java/cn/com/taiji/tile/service/impl/StgViewDeviceinfoDfServiceImpl.java
  15. 12 9
      tile-service/src/main/java/cn/com/taiji/tile/service/impl/TileServiceImpl.java
  16. 0 2
      tile-service/src/main/java/cn/com/taiji/tile/util/ShapeUtils.java
  17. 21 0
      tile-service/src/main/resources/mapper/LgsqyMapper.xml
  18. 36 0
      tile-service/src/main/resources/mapper/ShapeStyleMapper.xml
  19. 46 0
      tile-service/src/main/resources/mapper/StgViewDeviceinfoDfMapper.xml
  20. 0 1
      tile-web/pom.xml
  21. 2 0
      tile-web/src/main/java/cn/com/taiji/web/TileWebApplication.java
  22. 40 5
      tile-web/src/main/java/cn/com/taiji/web/controller/TileWebController.java
  23. 87 0
      tile-web/src/main/resources/application-dev.yml
  24. 16 0
      tile-web/src/main/resources/application-prod.properties
  25. 0 17
      tile-web/src/main/resources/application-test.properties
  26. 1 1
      tile-web/src/main/resources/application.yml

+ 25 - 0
pom.xml

@@ -24,11 +24,19 @@
         <maven.compiler.source>11</maven.compiler.source>
         <maven.compiler.target>11</maven.compiler.target>
         <swagger.version>3.0.0</swagger.version>
+        <mysql.version>5.1.47</mysql.version>
+        <mybatis-plus.version>3.5.3.1</mybatis-plus.version>
+        <druid.version>1.1.20</druid.version>
     </properties>
 
     <dependencyManagement>
 
         <dependencies>
+            <dependency>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-dependencies</artifactId>
+                <version>${spring-boot-dependencies.version}</version>
+            </dependency>
 
             <dependency>
                 <groupId>org.springframework.boot</groupId>
@@ -64,6 +72,23 @@
                 </exclusions>
             </dependency>
 
+            <!-- 数据库相关  -->
+            <dependency>
+                <groupId>mysql</groupId>
+                <artifactId>mysql-connector-java</artifactId>
+                <version>${mysql.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>com.baomidou</groupId>
+                <artifactId>mybatis-plus-boot-starter</artifactId>
+                <version>${mybatis-plus.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>com.alibaba</groupId>
+                <artifactId>druid-spring-boot-starter</artifactId>
+                <version>${druid.version}</version>
+            </dependency>
+
         </dependencies>
 
     </dependencyManagement>

+ 12 - 0
tile-service/pom.xml

@@ -70,6 +70,18 @@
             <artifactId>spring-boot-starter-web</artifactId>
         </dependency>
         <!-- 数据库相关  -->
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-boot-starter</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid-spring-boot-starter</artifactId>
+        </dependency>
 
         <dependency>
             <groupId>org.slf4j</groupId>

+ 10 - 0
tile-service/src/main/java/cn/com/taiji/tile/mapper/LgsqyMapper.java

@@ -0,0 +1,10 @@
+package cn.com.taiji.tile.mapper;
+
+import cn.com.taiji.tile.model.Lgsqy;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @author zzyx 2024/1/11
+ */
+public interface LgsqyMapper extends BaseMapper<Lgsqy> {
+}

+ 10 - 0
tile-service/src/main/java/cn/com/taiji/tile/mapper/ShapeStyleMapper.java

@@ -0,0 +1,10 @@
+package cn.com.taiji.tile.mapper;
+
+import cn.com.taiji.tile.model.ShapeStyle;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @author zzyx 2024/1/11
+ */
+public interface ShapeStyleMapper extends BaseMapper<ShapeStyle> {
+}

+ 10 - 0
tile-service/src/main/java/cn/com/taiji/tile/mapper/StgViewDeviceinfoDfMapper.java

@@ -0,0 +1,10 @@
+package cn.com.taiji.tile.mapper;
+
+import cn.com.taiji.tile.model.StgViewDeviceinfoDf;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @author zzyx 2024/1/11
+ */
+public interface StgViewDeviceinfoDfMapper extends BaseMapper<StgViewDeviceinfoDf> {
+}

+ 50 - 0
tile-service/src/main/java/cn/com/taiji/tile/model/Lgsqy.java

@@ -0,0 +1,50 @@
+package cn.com.taiji.tile.model;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+/**
+ * @author zzyx 2024/1/11
+ */
+/**
+    * 企业信息表
+    */
+@Data
+@TableName(value = "lgsqy")
+public class Lgsqy {
+    @TableId(value = "id", type = IdType.INPUT)
+    private String id;
+
+    @TableField(value = "qymc")
+    private String qymc;
+
+    @TableField(value = "qykx")
+    private String qykx;
+
+    @TableField(value = "type_value")
+    private String typeValue;
+
+    @TableField(value = "uniscid")
+    private String uniscid;
+
+    @TableField(value = "dom")
+    private String dom;
+
+    @TableField(value = "lerep")
+    private String lerep;
+
+    @TableField(value = "longitude")
+    private String longitude;
+
+    @TableField(value = "latitude")
+    private String latitude;
+
+    @TableField(value = "dt")
+    private String dt;
+
+    @TableField(value = "sort")
+    private Integer sort;
+}

+ 86 - 0
tile-service/src/main/java/cn/com/taiji/tile/model/ShapeStyle.java

@@ -0,0 +1,86 @@
+package cn.com.taiji.tile.model;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+/**
+ * @author zzyx 2024/1/11
+ */
+/**
+    * 点线面样式表
+    */
+@Data
+@TableName(value = "shape_style")
+public class ShapeStyle {
+    @TableId(value = "id", type = IdType.INPUT)
+    private Long id;
+
+    @TableField(value = "layer_code")
+    private String layerCode;
+
+    @TableField(value = "layer_name")
+    private String layerName;
+
+    @TableField(value = "`type`")
+    private Boolean type;
+
+    @TableField(value = "width")
+    private Integer width;
+
+    @TableField(value = "height")
+    private Integer height;
+
+    @TableField(value = "color")
+    private String color;
+
+    @TableField(value = "is_fill")
+    private Boolean isFill;
+
+    @TableField(value = "border_color")
+    private String borderColor;
+
+    @TableField(value = "border_size")
+    private Integer borderSize;
+
+    @TableField(value = "is_dashed")
+    private Integer isDashed;
+
+    @TableField(value = "dash_pattern")
+    private String dashPattern;
+
+    @TableField(value = "bg_imge")
+    private String bgImge;
+
+    @TableField(value = "is_show_name")
+    private Boolean isShowName;
+
+    @TableField(value = "font_color")
+    private String fontColor;
+
+    @TableField(value = "font_size")
+    private Integer fontSize;
+
+    @TableField(value = "center_point_img")
+    private String centerPointImg;
+
+    @TableField(value = "point_size")
+    private Integer pointSize;
+
+    @TableField(value = "point_type")
+    private Integer pointType;
+
+    @TableField(value = "point_marker_image")
+    private String pointMarkerImage;
+
+    @TableField(value = "point_marker_image_width")
+    private Integer pointMarkerImageWidth;
+
+    @TableField(value = "point_marker_image_height")
+    private Integer pointMarkerImageHeight;
+
+    @TableField(value = "center_point_image")
+    private String centerPointImage;
+}

+ 116 - 0
tile-service/src/main/java/cn/com/taiji/tile/model/StgViewDeviceinfoDf.java

@@ -0,0 +1,116 @@
+package cn.com.taiji.tile.model;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+/**
+ * @author zzyx 2024/1/11
+ */
+/**
+    * 设备信息表
+    */
+@Data
+@TableName(value = "stg_view_deviceinfo_df")
+public class StgViewDeviceinfoDf {
+    @TableId(value = "id", type = IdType.INPUT)
+    private Integer id;
+
+    @TableField(value = "pn")
+    private String pn;
+
+    @TableField(value = "groupid")
+    private String groupid;
+
+    @TableField(value = "monitorid")
+    private String monitorid;
+
+    @TableField(value = "`name`")
+    private String name;
+
+    @TableField(value = "`online`")
+    private String online;
+
+    @TableField(value = "savestatus")
+    private String savestatus;
+
+    @TableField(value = "ptztype")
+    private String ptztype;
+
+    @TableField(value = "deviceid")
+    private String deviceid;
+
+    @TableField(value = "areacode")
+    private String areacode;
+
+    @TableField(value = "longitude")
+    private String longitude;
+
+    @TableField(value = "latitude")
+    private String latitude;
+
+    @TableField(value = "faultedflag")
+    private String faultedflag;
+
+    @TableField(value = "`status`")
+    private String status;
+
+    @TableField(value = "isfront")
+    private String isfront;
+
+    @TableField(value = "civilcode")
+    private String civilcode;
+
+    @TableField(value = "address")
+    private String address;
+
+    @TableField(value = "parental")
+    private String parental;
+
+    @TableField(value = "parentid")
+    private String parentid;
+
+    @TableField(value = "certnum")
+    private String certnum;
+
+    @TableField(value = "certifiable")
+    private String certifiable;
+
+    @TableField(value = "ipaddress")
+    private String ipaddress;
+
+    @TableField(value = "port")
+    private String port;
+
+    @TableField(value = "positiontype")
+    private String positiontype;
+
+    @TableField(value = "roomtype")
+    private String roomtype;
+
+    @TableField(value = "usetype")
+    private String usetype;
+
+    @TableField(value = "directiontype")
+    private String directiontype;
+
+    @TableField(value = "mediacode")
+    private String mediacode;
+
+    @TableField(value = "mediadpi")
+    private String mediadpi;
+
+    @TableField(value = "`type`")
+    private String type;
+
+    @TableField(value = "`location`")
+    private Object location;
+
+    @TableField(value = "type_value")
+    private String typeValue;
+
+    @TableField(value = "sort")
+    private Integer sort;
+}

+ 11 - 0
tile-service/src/main/java/cn/com/taiji/tile/service/LgsqyService.java

@@ -0,0 +1,11 @@
+package cn.com.taiji.tile.service;
+
+import cn.com.taiji.tile.model.Lgsqy;
+import com.baomidou.mybatisplus.extension.service.IService;
+    /**
+ * @author zzyx 2024/1/11
+ */
+public interface LgsqyService extends IService<Lgsqy>{
+
+
+}

+ 11 - 0
tile-service/src/main/java/cn/com/taiji/tile/service/ShapeStyleService.java

@@ -0,0 +1,11 @@
+package cn.com.taiji.tile.service;
+
+import cn.com.taiji.tile.model.ShapeStyle;
+import com.baomidou.mybatisplus.extension.service.IService;
+    /**
+ * @author zzyx 2024/1/11
+ */
+public interface ShapeStyleService extends IService<ShapeStyle>{
+
+
+}

+ 11 - 0
tile-service/src/main/java/cn/com/taiji/tile/service/StgViewDeviceinfoDfService.java

@@ -0,0 +1,11 @@
+package cn.com.taiji.tile.service;
+
+import cn.com.taiji.tile.model.StgViewDeviceinfoDf;
+import com.baomidou.mybatisplus.extension.service.IService;
+    /**
+ * @author zzyx 2024/1/11
+ */
+public interface StgViewDeviceinfoDfService extends IService<StgViewDeviceinfoDf>{
+
+
+}

+ 16 - 0
tile-service/src/main/java/cn/com/taiji/tile/service/impl/LgsqyServiceImpl.java

@@ -0,0 +1,16 @@
+package cn.com.taiji.tile.service.impl;
+
+import org.springframework.stereotype.Service;
+import javax.annotation.Resource;
+import java.util.List;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import cn.com.taiji.tile.model.Lgsqy;
+import cn.com.taiji.tile.mapper.LgsqyMapper;
+import cn.com.taiji.tile.service.LgsqyService;
+/**
+ * @author zzyx 2024/1/11
+ */
+@Service
+public class LgsqyServiceImpl extends ServiceImpl<LgsqyMapper, Lgsqy> implements LgsqyService{
+
+}

+ 16 - 0
tile-service/src/main/java/cn/com/taiji/tile/service/impl/ShapeStyleServiceImpl.java

@@ -0,0 +1,16 @@
+package cn.com.taiji.tile.service.impl;
+
+import org.springframework.stereotype.Service;
+import javax.annotation.Resource;
+import java.util.List;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import cn.com.taiji.tile.model.ShapeStyle;
+import cn.com.taiji.tile.mapper.ShapeStyleMapper;
+import cn.com.taiji.tile.service.ShapeStyleService;
+/**
+ * @author zzyx 2024/1/11
+ */
+@Service
+public class ShapeStyleServiceImpl extends ServiceImpl<ShapeStyleMapper, ShapeStyle> implements ShapeStyleService{
+
+}

+ 16 - 0
tile-service/src/main/java/cn/com/taiji/tile/service/impl/StgViewDeviceinfoDfServiceImpl.java

@@ -0,0 +1,16 @@
+package cn.com.taiji.tile.service.impl;
+
+import org.springframework.stereotype.Service;
+import javax.annotation.Resource;
+import java.util.List;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import cn.com.taiji.tile.model.StgViewDeviceinfoDf;
+import cn.com.taiji.tile.mapper.StgViewDeviceinfoDfMapper;
+import cn.com.taiji.tile.service.StgViewDeviceinfoDfService;
+/**
+ * @author zzyx 2024/1/11
+ */
+@Service
+public class StgViewDeviceinfoDfServiceImpl extends ServiceImpl<StgViewDeviceinfoDfMapper, StgViewDeviceinfoDf> implements StgViewDeviceinfoDfService{
+
+}

+ 12 - 9
tile-service/src/main/java/cn/com/taiji/tile/service/impl/TileServiceImpl.java

@@ -14,10 +14,12 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import javax.imageio.ImageIO;
+import java.awt.*;
 import java.awt.image.BufferedImage;
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.*;
+import java.util.List;
 
 @Slf4j
 @Service
@@ -75,15 +77,16 @@ public class TileServiceImpl implements ITileService {
             long start = System.currentTimeMillis();
             //根据图层名称在mysql表中查询样式
             ShapeStyle shapeStyle = new ShapeStyle();
-            InputStream in = ClassLoader.getSystemResourceAsStream("images/gis-layout-tools_example-axcbypyj.png");
-            try {
-                BufferedImage image = ImageIO.read(in);
-                shapeStyle.setHeight(12);
-                shapeStyle.setWidth(12);
-                shapeStyle.setPointMarkerImage(image);
-            } catch (IOException e) {
-                throw new RuntimeException(e);
-            }
+            shapeStyle.setColor(Color.RED);
+//            InputStream in = ClassLoader.getSystemResourceAsStream("images/gis-layout-tools_example-axcbypyj.png");
+//            try {
+//                BufferedImage image = ImageIO.read(in);
+//                shapeStyle.setHeight(12);
+//                shapeStyle.setWidth(12);
+//                shapeStyle.setPointMarkerImage(image);
+//            } catch (IOException e) {
+//                throw new RuntimeException(e);
+//            }
             byte[] tileByte = ShapeUtils.getTileByte(requestParam.getBbox(), convert(cqlDataList), shapeStyle);
             long end = System.currentTimeMillis();
             System.out.println("根据数据生成瓦片耗时"+(end-start));

+ 0 - 2
tile-service/src/main/java/cn/com/taiji/tile/util/ShapeUtils.java

@@ -261,9 +261,7 @@ public class ShapeUtils {
             }
             //如果选中
             int rgb = image.getRGB(x, y);
-            System.out.println("rgb---->" + image.getRGB(x, y));
             int alpha = (rgb >> 24) & 0xff; // 提取alpha值
-//                System.out.println("RGB->"+alpha);
             if (alpha > 0) {
                 // 像素被填充
                 clickSelectedDataList.add(poi);

+ 21 - 0
tile-service/src/main/resources/mapper/LgsqyMapper.xml

@@ -0,0 +1,21 @@
+<?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">
+<mapper namespace="cn.com.taiji.tile.mapper.LgsqyMapper">
+  <resultMap id="BaseResultMap" type="cn.com.taiji.tile.model.Lgsqy">
+    <!--@Table lgsqy-->
+    <id column="id" jdbcType="VARCHAR" property="id" />
+    <result column="qymc" jdbcType="VARCHAR" property="qymc" />
+    <result column="qykx" jdbcType="VARCHAR" property="qykx" />
+    <result column="type_value" jdbcType="VARCHAR" property="typeValue" />
+    <result column="uniscid" jdbcType="VARCHAR" property="uniscid" />
+    <result column="dom" jdbcType="VARCHAR" property="dom" />
+    <result column="lerep" jdbcType="VARCHAR" property="lerep" />
+    <result column="longitude" jdbcType="VARCHAR" property="longitude" />
+    <result column="latitude" jdbcType="VARCHAR" property="latitude" />
+    <result column="dt" jdbcType="VARCHAR" property="dt" />
+    <result column="sort" jdbcType="INTEGER" property="sort" />
+  </resultMap>
+  <sql id="Base_Column_List">
+    id, qymc, qykx, type_value, uniscid, dom, lerep, longitude, latitude, dt, sort
+  </sql>
+</mapper>

+ 36 - 0
tile-service/src/main/resources/mapper/ShapeStyleMapper.xml

@@ -0,0 +1,36 @@
+<?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">
+<mapper namespace="cn.com.taiji.tile.mapper.ShapeStyleMapper">
+  <resultMap id="BaseResultMap" type="cn.com.taiji.tile.model.ShapeStyle">
+    <!--@Table shape_style-->
+    <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="layer_code" jdbcType="VARCHAR" property="layerCode" />
+    <result column="layer_name" jdbcType="VARCHAR" property="layerName" />
+    <result column="type" jdbcType="BOOLEAN" property="type" />
+    <result column="width" jdbcType="INTEGER" property="width" />
+    <result column="height" jdbcType="INTEGER" property="height" />
+    <result column="color" jdbcType="VARCHAR" property="color" />
+    <result column="is_fill" jdbcType="BOOLEAN" property="isFill" />
+    <result column="border_color" jdbcType="VARCHAR" property="borderColor" />
+    <result column="border_size" jdbcType="INTEGER" property="borderSize" />
+    <result column="is_dashed" jdbcType="INTEGER" property="isDashed" />
+    <result column="dash_pattern" jdbcType="VARCHAR" property="dashPattern" />
+    <result column="bg_imge" jdbcType="VARCHAR" property="bgImge" />
+    <result column="is_show_name" jdbcType="BOOLEAN" property="isShowName" />
+    <result column="font_color" jdbcType="VARCHAR" property="fontColor" />
+    <result column="font_size" jdbcType="INTEGER" property="fontSize" />
+    <result column="center_point_img" jdbcType="VARCHAR" property="centerPointImg" />
+    <result column="point_size" jdbcType="INTEGER" property="pointSize" />
+    <result column="point_type" jdbcType="INTEGER" property="pointType" />
+    <result column="point_marker_image" jdbcType="VARCHAR" property="pointMarkerImage" />
+    <result column="point_marker_image_width" jdbcType="INTEGER" property="pointMarkerImageWidth" />
+    <result column="point_marker_image_height" jdbcType="INTEGER" property="pointMarkerImageHeight" />
+    <result column="center_point_image" jdbcType="VARCHAR" property="centerPointImage" />
+  </resultMap>
+  <sql id="Base_Column_List">
+    id, layer_code, layer_name, `type`, width, height, color, is_fill, border_color, 
+    border_size, is_dashed, dash_pattern, bg_imge, is_show_name, font_color, font_size, 
+    center_point_img, point_size, point_type, point_marker_image, point_marker_image_width, 
+    point_marker_image_height, center_point_image
+  </sql>
+</mapper>

+ 46 - 0
tile-service/src/main/resources/mapper/StgViewDeviceinfoDfMapper.xml

@@ -0,0 +1,46 @@
+<?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">
+<mapper namespace="cn.com.taiji.tile.mapper.StgViewDeviceinfoDfMapper">
+  <resultMap id="BaseResultMap" type="cn.com.taiji.tile.model.StgViewDeviceinfoDf">
+    <!--@Table stg_view_deviceinfo_df-->
+    <id column="id" jdbcType="INTEGER" property="id" />
+    <result column="pn" jdbcType="VARCHAR" property="pn" />
+    <result column="groupid" jdbcType="VARCHAR" property="groupid" />
+    <result column="monitorid" jdbcType="VARCHAR" property="monitorid" />
+    <result column="name" jdbcType="VARCHAR" property="name" />
+    <result column="online" jdbcType="VARCHAR" property="online" />
+    <result column="savestatus" jdbcType="VARCHAR" property="savestatus" />
+    <result column="ptztype" jdbcType="VARCHAR" property="ptztype" />
+    <result column="deviceid" jdbcType="VARCHAR" property="deviceid" />
+    <result column="areacode" jdbcType="VARCHAR" property="areacode" />
+    <result column="longitude" jdbcType="VARCHAR" property="longitude" />
+    <result column="latitude" jdbcType="VARCHAR" property="latitude" />
+    <result column="faultedflag" jdbcType="VARCHAR" property="faultedflag" />
+    <result column="status" jdbcType="VARCHAR" property="status" />
+    <result column="isfront" jdbcType="VARCHAR" property="isfront" />
+    <result column="civilcode" jdbcType="VARCHAR" property="civilcode" />
+    <result column="address" jdbcType="VARCHAR" property="address" />
+    <result column="parental" jdbcType="VARCHAR" property="parental" />
+    <result column="parentid" jdbcType="VARCHAR" property="parentid" />
+    <result column="certnum" jdbcType="VARCHAR" property="certnum" />
+    <result column="certifiable" jdbcType="VARCHAR" property="certifiable" />
+    <result column="ipaddress" jdbcType="VARCHAR" property="ipaddress" />
+    <result column="port" jdbcType="VARCHAR" property="port" />
+    <result column="positiontype" jdbcType="VARCHAR" property="positiontype" />
+    <result column="roomtype" jdbcType="VARCHAR" property="roomtype" />
+    <result column="usetype" jdbcType="VARCHAR" property="usetype" />
+    <result column="directiontype" jdbcType="VARCHAR" property="directiontype" />
+    <result column="mediacode" jdbcType="VARCHAR" property="mediacode" />
+    <result column="mediadpi" jdbcType="VARCHAR" property="mediadpi" />
+    <result column="type" jdbcType="VARCHAR" property="type" />
+    <result column="location" jdbcType="OTHER" property="location" />
+    <result column="type_value" jdbcType="VARCHAR" property="typeValue" />
+    <result column="sort" jdbcType="INTEGER" property="sort" />
+  </resultMap>
+  <sql id="Base_Column_List">
+    id, pn, groupid, monitorid, `name`, `online`, savestatus, ptztype, deviceid, areacode, 
+    longitude, latitude, faultedflag, `status`, isfront, civilcode, address, parental, 
+    parentid, certnum, certifiable, ipaddress, port, positiontype, roomtype, usetype, 
+    directiontype, mediacode, mediadpi, `type`, `location`, type_value, sort
+  </sql>
+</mapper>

+ 0 - 1
tile-web/pom.xml

@@ -39,7 +39,6 @@
             <artifactId>spring-boot-starter-web</artifactId>
         </dependency>
 
-
         <dependency>
             <groupId>org.geotools</groupId>
             <artifactId>gt-main</artifactId>

+ 2 - 0
tile-web/src/main/java/cn/com/taiji/web/TileWebApplication.java

@@ -1,8 +1,10 @@
 package cn.com.taiji.web;
 
+import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 
+@MapperScan("cn.com.taiji.**.mapper")
 @SpringBootApplication(scanBasePackages = {"cn.com.taiji"})
 public class TileWebApplication {
 

+ 40 - 5
tile-web/src/main/java/cn/com/taiji/web/controller/TileWebController.java

@@ -5,18 +5,24 @@ package cn.com.taiji.web.controller;
 import cn.com.taiji.common.domain.Result;
 import cn.com.taiji.cql.model.GeoDataSource;
 import cn.com.taiji.cql.model.GeoRequestParam;
+import cn.com.taiji.tile.model.Lgsqy;
+import cn.com.taiji.tile.model.StgViewDeviceinfoDf;
 import cn.com.taiji.tile.service.ITileService;
+import cn.com.taiji.tile.service.LgsqyService;
+import cn.com.taiji.tile.service.StgViewDeviceinfoDfService;
 import cn.com.taiji.web.service.IGeoDataSourceService;
 import com.alibaba.fastjson.JSONObject;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 
+import javax.annotation.Resource;
 import javax.servlet.ServletOutputStream;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -43,6 +49,23 @@ public class TileWebController {
     private IGeoDataSourceService geoDataSourceService;
 
 
+    @Resource
+    private LgsqyService lgsqyService;
+
+    @Resource
+    private StgViewDeviceinfoDfService stgViewDeviceinfoDfService;
+
+    @GetMapping("/getDevices")
+    public List<StgViewDeviceinfoDf> getDevices(){
+        return stgViewDeviceinfoDfService.list();
+    }
+
+    @GetMapping("/getLgsqy")
+    public List<Lgsqy> getLgsqy(){
+        return lgsqyService.list();
+    }
+
+
     @ApiOperation("面向瓦片的点击查询")
     @GetMapping("/queryElements")
     public Result queryElements(String bbox,Integer type,String layerName){
@@ -51,6 +74,11 @@ public class TileWebController {
         return Result.of(list, 0, "操作成功");
     }
 
+    @GetMapping("/queryTile2")
+    public void queryTile2(){
+
+    }
+
 
     @RequestMapping(value = {"/queryTile"}, method = {RequestMethod.GET, RequestMethod.POST})
     public void queryTile(HttpServletRequest request, HttpServletResponse response) {
@@ -64,18 +92,25 @@ public class TileWebController {
 
                 GeoDataSource geoDs = geoDataSourceService.layerCodeGeoDataSource(geoRequestParam.getLayers());
 
-                if(geoDs !=null){
+                //判断请求类型
+                if(StringUtils.equals(geoRequestParam.getRequest(),"GetFeatureInfo")){
+                    //根据用户点击查询详情
 
-                    byte[] ret = tileService.tileData(geoRequestParam,geoDs);
+                }else{
+                    if(geoDs !=null){
 
-                    responseWrite(response, "image/png", ret);
+                        byte[] ret = tileService.tileData(geoRequestParam,geoDs);
 
+                        responseWrite(response, "image/png", ret);
 
-                }else{
 
-                    log.info("根据图层代码:" + geoRequestParam.getLayers() + "获取图层对应的数据源为空或者为null");
+                    }else{
+
+                        log.info("根据图层代码:" + geoRequestParam.getLayers() + "获取图层对应的数据源为空或者为null");
+                    }
                 }
 
+
             }catch (Exception exception){
 
                 exception.printStackTrace();

+ 87 - 0
tile-web/src/main/resources/application-dev.yml

@@ -0,0 +1,87 @@
+spring:
+  redis:
+    # 地址
+    host: 8.140.240.182
+    #host: 192.168.1.107
+    # 端口,默认为6379
+    port: 18084
+    # 数据库索引
+    database: 0
+    # 密码
+    password:
+    # 连接超时时间
+    timeout: 10s
+    lettuce:
+      pool:
+        # 连接池中的最小空闲连接
+        min-idle: 0
+        # 连接池中的最大空闲连接
+        max-idle: 8
+        # 连接池的最大数据库连接数
+        max-active: 8
+        # #连接池最大阻塞等待时间(使用负值表示没有限制)
+        max-wait: -1ms
+  datasource:
+    driver-class-name: com.mysql.jdbc.Driver
+    url: jdbc:mysql://8.140.240.182:18080/geo?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai
+    username: root
+    password: Taiji@2023#data
+    druid:
+      initial-size: 5
+      max-active: 10
+      min-idle: 5
+      max-wait: 60000
+      pool-prepared-statements: true
+      max-pool-prepared-statement-per-connection-size: 20
+      validation-query: select 1
+      validation-query-timeout: 60000
+      test-on-borrow: false
+      test-on-return: false
+      test-while-idle: true
+      time-between-eviction-runs-millis: 60000
+      filter:
+        stat:
+          log-slow-sql: false
+          db-type: mysql
+          slow-sql-millis: 2000
+mybatis-plus:
+  mapper-locations: classpath*:**/mapper/*Mapper.xml
+  #实体扫描,多个package用逗号或者分号分隔
+  typeAliasesPackage: com.cetc.poiIndex
+  global-config:
+    # 数据库相关配置
+    db-config:
+      #主键类型  AUTO:"数据库ID自增", INPUT:"用户输入ID",ID_WORKER:"全局唯一ID (数字类型唯一ID)", UUID:"全局唯一ID UUID";
+      id-type: AUTO
+      #字段策略 IGNORED:"忽略判断",NOT_NULL:"非 NULL 判断"),NOT_EMPTY:"非空判断"
+      field-strategy: NOT_EMPTY
+      #驼峰下划线转换
+      column-underline: true
+    #刷新mapper 调试神器
+    refresh: true
+  # 原生配置
+  configuration:
+    map-underscore-to-camel-case: true
+    cache-enabled: false
+    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+
+geo:
+  ds:
+    ip: 8.140.240.182
+    port: 18080
+    username: root
+    password: Taiji@2023#data
+    base: geo
+    dbtype: mysql
+
+ent:
+  ds:
+    ip: 8.140.240.182
+    port: 18080
+    username: root
+    password: Taiji@2023#data
+    basename: geo
+    enterprise: lgsqy
+    device: stg_view_deviceinfo_df
+    dbtype: mysql
+

+ 16 - 0
tile-web/src/main/resources/application-prod.properties

@@ -0,0 +1,16 @@
+geo.ds.ip=10.110.30.14
+geo.ds.port=3306
+geo.ds.username=sgyzt
+geo.ds.password=Cloud@sheguan456
+geo.ds.base=sgyzt
+geo.ds.dbtype = mysql
+
+ent.ds.ip=10.110.30.14
+ent.ds.port=3306
+ent.ds.username=sgyzt
+ent.ds.password=Cloud@sheguan456
+ent.ds.basename=sgyzt
+ent.ds.enterprise=lgsqy
+ent.ds.device=stg_view_deviceinfo_df
+ent.ds.dbtype = mysql
+

+ 0 - 17
tile-web/src/main/resources/application-test.properties

@@ -1,17 +0,0 @@
-geo.ds.ip=8.140.240.182
-geo.ds.port=18080
-geo.ds.username=root
-geo.ds.password=Taiji@2023#data
-geo.ds.base=geo
-geo.ds.dbtype = mysql
-
-
-ent.ds.ip=8.140.240.182
-ent.ds.port=18080
-ent.ds.username=root
-ent.ds.password=Taiji@2023#data
-ent.ds.basename=geo
-ent.ds.enterprise=lgsqy
-ent.ds.device=stg_view_deviceinfo_df
-ent.ds.dbtype = mysql
-

+ 1 - 1
tile-web/src/main/resources/application.yml

@@ -6,4 +6,4 @@ server:
       charset: UTF-8
 spring:
   profiles:
-    active: test
+    active: dev