From 842148f960e3d5dc995c49ef42a6ce2b8f1d4e34 Mon Sep 17 00:00:00 2001
From: lizijie <lzjiiie@163.com>
Date: Wed, 02 Dec 2020 16:05:46 +0800
Subject: [PATCH] pollution_sourc_point表相关代码

---
 src/main/java/com/moral/service/impl/PollutioSourcePointServiceImpl.java |   21 ++++++++++
 src/main/resources/mapper/PollutionSourcePointMapper.xml                 |   16 ++++++++
 src/main/java/com/moral/entity/PollutionSourcePoint.java                 |   17 ++++++++
 src/main/java/com/moral/service/PollutioSourcePointService.java          |    7 +++
 src/main/java/com/moral/mapper/PollutionSourcPointMapper.java            |   13 ++++++
 5 files changed, 74 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/moral/entity/PollutionSourcePoint.java b/src/main/java/com/moral/entity/PollutionSourcePoint.java
new file mode 100644
index 0000000..8a47d73
--- /dev/null
+++ b/src/main/java/com/moral/entity/PollutionSourcePoint.java
@@ -0,0 +1,17 @@
+package com.moral.entity;
+
+import lombok.Data;
+
+import javax.persistence.Id;
+
+@Data
+public class PollutionSourcePoint {
+    @Id
+    Integer id;
+
+    Integer monitorPointId;
+
+    Double longitude;
+
+    Double latitude;
+}
diff --git a/src/main/java/com/moral/mapper/PollutionSourcPointMapper.java b/src/main/java/com/moral/mapper/PollutionSourcPointMapper.java
new file mode 100644
index 0000000..ba0851b
--- /dev/null
+++ b/src/main/java/com/moral/mapper/PollutionSourcPointMapper.java
@@ -0,0 +1,13 @@
+package com.moral.mapper;
+
+
+import com.moral.entity.DeviceAdjustValueTiming;
+import com.moral.entity.PollutionSourcePoint;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Map;
+
+public interface PollutionSourcPointMapper {
+	PollutionSourcePoint selectByMonitorPointId(@Param("monitorPointId") Integer monitorPointId);
+}
\ No newline at end of file
diff --git a/src/main/java/com/moral/service/PollutioSourcePointService.java b/src/main/java/com/moral/service/PollutioSourcePointService.java
new file mode 100644
index 0000000..5ee0ab1
--- /dev/null
+++ b/src/main/java/com/moral/service/PollutioSourcePointService.java
@@ -0,0 +1,7 @@
+package com.moral.service;
+
+import com.moral.entity.PollutionSourcePoint;
+
+public interface PollutioSourcePointService {
+    PollutionSourcePoint selectByMonitorPointId(Integer monitorPointId);
+}
diff --git a/src/main/java/com/moral/service/impl/PollutioSourcePointServiceImpl.java b/src/main/java/com/moral/service/impl/PollutioSourcePointServiceImpl.java
new file mode 100644
index 0000000..80121f2
--- /dev/null
+++ b/src/main/java/com/moral/service/impl/PollutioSourcePointServiceImpl.java
@@ -0,0 +1,21 @@
+package com.moral.service.impl;
+
+import com.moral.entity.PollutionSourcePoint;
+import com.moral.mapper.PollutionSourcPointMapper;
+import com.moral.service.PollutioSourcePointService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+
+@Service
+public class PollutioSourcePointServiceImpl implements PollutioSourcePointService {
+
+    @Resource
+    private PollutionSourcPointMapper pollutionSourcPointMapper;
+
+    @Override
+    public PollutionSourcePoint selectByMonitorPointId(Integer monitorPointId) {
+        PollutionSourcePoint result = pollutionSourcPointMapper.selectByMonitorPointId(monitorPointId);
+        return result;
+    }
+}
diff --git a/src/main/resources/mapper/PollutionSourcePointMapper.xml b/src/main/resources/mapper/PollutionSourcePointMapper.xml
new file mode 100644
index 0000000..66a8bd7
--- /dev/null
+++ b/src/main/resources/mapper/PollutionSourcePointMapper.xml
@@ -0,0 +1,16 @@
+<?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="com.moral.mapper.PollutionSourcPointMapper">
+    <resultMap id="BaseResultMap" type="com.moral.entity.PollutionSourcePoint" >
+        <id column="id" property="id" jdbcType="INTEGER" />
+        <result column="monitor_point_id" property="monitorPointId" jdbcType="INTEGER" />
+        <result column="longitude" property="longitude" jdbcType="NUMERIC" />
+        <result column="latitude" property="latitude" jdbcType="NUMERIC" />
+    </resultMap>
+
+    <select id="selectByMonitorPointId" resultType="com.moral.entity.PollutionSourcePoint" resultMap="BaseResultMap">
+        select * from pollution_source_point
+        where monitor_point_id = #{monitorPointId}
+    </select>
+
+</mapper>
\ No newline at end of file

--
Gitblit v1.8.0