浏览代码

任务提交 成果完成两个接口

qinguocai 1 年之前
父节点
当前提交
43acd5e1e7
共有 18 个文件被更改,包括 1090 次插入21 次删除
  1. 49 0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/MeasureUpload.java
  2. 99 0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/TaskResult.java
  3. 31 0
      ruoyi-system/src/main/java/com/ruoyi/system/dto/WaterLevelDTO.java
  4. 96 0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/MeasureUploadMapper.java
  5. 93 0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/TaskResultMapper.java
  6. 18 3
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/WaterLevelMapper.java
  7. 35 0
      ruoyi-system/src/main/java/com/ruoyi/system/paramet/AchievementQuery.java
  8. 1 0
      ruoyi-system/src/main/java/com/ruoyi/system/paramet/BerthingPointQuery.java
  9. 58 0
      ruoyi-system/src/main/java/com/ruoyi/system/paramet/WaterLevelQuery.java
  10. 22 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/AchievementService.java
  11. 5 5
      ruoyi-system/src/main/java/com/ruoyi/system/service/ReportDataService.java
  12. 65 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/AchievementServiceImpl.java
  13. 21 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ReportDataServiceImpl.java
  14. 152 0
      ruoyi-system/src/main/resources/mapper/MeasureUploadMapper.xml
  15. 233 0
      ruoyi-system/src/main/resources/mapper/TaskResultMapper.xml
  16. 44 1
      ruoyi-system/src/main/resources/mapper/WaterLevelMapper.xml
  17. 60 0
      waterAffairs-admin/src/main/java/com/ruoyi/web/controller/tool/AchievementController.java
  18. 8 12
      waterAffairs-admin/src/main/java/com/ruoyi/web/controller/tool/ReportDataController.java

+ 49 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/MeasureUpload.java

@@ -0,0 +1,49 @@
+package com.ruoyi.system.domain;
+
+import java.util.Date;
+import java.io.Serializable;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+/**
+ * 停泊点上报测流数据(MeasureUpload)实体类
+ *
+ * @author makejava
+ * @since 2024-04-23 10:52:14
+ */
+@Data
+public class MeasureUpload implements Serializable {
+    private static final long serialVersionUID = 625660336078725364L;
+/**
+     * 停泊点测速ID
+     */
+    private Long measureId;
+/**
+     * 停泊点策略编号
+     */
+    private Long planid;
+/**
+     * 停泊点索引号
+     */
+    private Long pn;
+/**
+     * 流速,单位:m/s
+     */
+    private Double wspeed;
+/**
+     * 创建时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date createTime;
+/**
+     * 站点ID
+     */
+    private Long siteId;
+/**
+     * 状态 0:流速度上报 1.开始测流
+     */
+    private Integer status;
+
+}
+

+ 99 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/TaskResult.java

@@ -0,0 +1,99 @@
+package com.ruoyi.system.domain;
+
+import java.util.Date;
+import java.io.Serializable;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+/**
+ * 测流成果上报(TaskResult)实体类
+ *
+ * @author makejava
+ * @since 2024-04-23 11:16:49
+ */
+@Data
+public class TaskResult implements Serializable {
+    private static final long serialVersionUID = -23831515507100721L;
+/**
+     * 成果ID
+     */
+    private Integer resultId;
+/**
+     * 站码
+     */
+    private String id;
+/**
+     * 设备类型,0:移动测流;1:固定测流
+     */
+    private Integer type;
+/**
+     * 任务编号
+     */
+    private String taskid;
+/**
+     * 开始时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date starttime;
+/**
+     * 结束时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date endtime;
+/**
+     * 水面宽
+     */
+    private Double width;
+/**
+     * 停泊点策略编号
+     */
+    private Long planid;
+/**
+     * 过水总面积
+     */
+    private String acreagesum;
+/**
+     * 总瞬时流量
+     */
+    private Double flowsum;
+/**
+     * 垂线起点距数组
+     */
+    private String positions;
+/**
+     * 垂线河底高程数组
+     */
+    private String elevations;
+/**
+     * 过水面积数组
+     */
+    private String acreages;
+/**
+     * 水深数组
+     */
+    private String waterlevels;
+/**
+     * 流速数组
+     */
+    private Double wspeeds;
+/**
+     * 部分瞬时流量数组
+     */
+    private String flows;
+/**
+     * 站点ID
+     */
+    private Long siteId;
+/**
+     * 创建时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date createTime;
+/**
+     * 测流状态 0.测流中 1.已终止 2.已完成
+     */
+    private Integer status;
+
+}
+

+ 31 - 0
ruoyi-system/src/main/java/com/ruoyi/system/dto/WaterLevelDTO.java

@@ -0,0 +1,31 @@
+package com.ruoyi.system.dto;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 水位信息(WaterLevel)实体类
+ *
+ * @author makejava
+ * @since 2024-04-19 16:45:33
+ */
+@Data
+public class WaterLevelDTO implements Serializable {
+
+
+    /**
+     * 水位平均值
+     */
+    private Double avgWaterlevel;
+
+    /**
+     * 创建时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date time;
+
+}
+

+ 96 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/MeasureUploadMapper.java

@@ -0,0 +1,96 @@
+package com.ruoyi.system.mapper;
+
+import com.ruoyi.system.domain.MeasureUpload;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.data.domain.Pageable;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 停泊点上报测流数据(MeasureUpload)表数据库访问层
+ *
+ * @author makejava
+ * @since 2024-04-23 10:52:14
+ */
+public interface MeasureUploadMapper {
+
+    /**
+     * 通过ID查询单条数据
+     *
+     * @param measureId 主键
+     * @return 实例对象
+     */
+    MeasureUpload queryById(Long measureId);
+
+
+
+    /**
+     * 通过ID查询单条数据
+     *
+     * @param siteId 主键
+     * @return 实例对象
+     */
+    List<MeasureUpload> queryBySiteIdTime(Long siteId, Date createTime);
+
+
+    /**
+     * 查询指定行数据
+     *
+     * @param measureUpload 查询条件
+     * @param pageable         分页对象
+     * @return 对象列表
+     */
+    List<MeasureUpload> queryAllByLimit(MeasureUpload measureUpload, @Param("pageable") Pageable pageable);
+
+    /**
+     * 统计总行数
+     *
+     * @param measureUpload 查询条件
+     * @return 总行数
+     */
+    long count(MeasureUpload measureUpload);
+
+    /**
+     * 新增数据
+     *
+     * @param measureUpload 实例对象
+     * @return 影响行数
+     */
+    int insert(MeasureUpload measureUpload);
+
+    /**
+     * 批量新增数据(MyBatis原生foreach方法)
+     *
+     * @param entities List<MeasureUpload> 实例对象列表
+     * @return 影响行数
+     */
+    int insertBatch(@Param("entities") List<MeasureUpload> entities);
+
+    /**
+     * 批量新增或按主键更新数据(MyBatis原生foreach方法)
+     *
+     * @param entities List<MeasureUpload> 实例对象列表
+     * @return 影响行数
+     * @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参
+     */
+    int insertOrUpdateBatch(@Param("entities") List<MeasureUpload> entities);
+
+    /**
+     * 修改数据
+     *
+     * @param measureUpload 实例对象
+     * @return 影响行数
+     */
+    int update(MeasureUpload measureUpload);
+
+    /**
+     * 通过主键删除数据
+     *
+     * @param measureId 主键
+     * @return 影响行数
+     */
+    int deleteById(Long measureId);
+
+}
+

+ 93 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/TaskResultMapper.java

@@ -0,0 +1,93 @@
+package com.ruoyi.system.mapper;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.system.domain.TaskResult;
+import com.ruoyi.system.paramet.AchievementQuery;
+import org.apache.ibatis.annotations.Param;
+import java.util.List;
+
+/**
+ * 测流成果上报(TaskResult)表数据库访问层
+ *
+ * @author makejava
+ * @since 2024-04-23 11:16:49
+ */
+public interface TaskResultMapper {
+
+    /**
+     * 通过ID查询单条数据
+     *
+     * @param resultId 主键
+     * @return 实例对象
+     */
+    TaskResult queryById(Integer resultId);
+
+
+    /**
+     * 通过ID查询单条数据
+     *
+     * @param siteId 主键
+     * @return 实例对象
+     */
+    TaskResult queryBySiteIdOne(Long siteId);
+
+    /**
+     * 查询指定行数据
+     *
+     * @param achievementQuery 查询条件
+     * @param page        分页对象
+     * @return 对象列表
+     */
+    Page<TaskResult> queryAllByLimit(@Param("achievementQuery") AchievementQuery achievementQuery, Page page);
+
+    /**
+     * 统计总行数
+     *
+     * @param taskResult 查询条件
+     * @return 总行数
+     */
+    long count(TaskResult taskResult);
+
+    /**
+     * 新增数据
+     *
+     * @param taskResult 实例对象
+     * @return 影响行数
+     */
+    int insert(TaskResult taskResult);
+
+    /**
+     * 批量新增数据(MyBatis原生foreach方法)
+     *
+     * @param entities List<TaskResult> 实例对象列表
+     * @return 影响行数
+     */
+    int insertBatch(@Param("entities") List<TaskResult> entities);
+
+    /**
+     * 批量新增或按主键更新数据(MyBatis原生foreach方法)
+     *
+     * @param entities List<TaskResult> 实例对象列表
+     * @return 影响行数
+     * @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参
+     */
+    int insertOrUpdateBatch(@Param("entities") List<TaskResult> entities);
+
+    /**
+     * 修改数据
+     *
+     * @param taskResult 实例对象
+     * @return 影响行数
+     */
+    int update(TaskResult taskResult);
+
+    /**
+     * 通过主键删除数据
+     *
+     * @param resultId 主键
+     * @return 影响行数
+     */
+    int deleteById(Integer resultId);
+
+}
+

+ 18 - 3
ruoyi-system/src/main/java/com/ruoyi/system/mapper/WaterLevelMapper.java

@@ -1,6 +1,8 @@
 package com.ruoyi.system.mapper;
 
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ruoyi.system.domain.WaterLevel;
+import com.ruoyi.system.paramet.WaterLevelQuery;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.data.domain.Pageable;
 import java.util.List;
@@ -34,11 +36,24 @@ public interface WaterLevelMapper {
     /**
      * 查询指定行数据
      *
-     * @param waterLevel 查询条件
-     * @param pageable         分页对象
+     * @param waterLevelQuery 查询条件
+     * @param page         分页对象
      * @return 对象列表
      */
-    List<WaterLevel> queryAllByLimit(WaterLevel waterLevel, @Param("pageable") Pageable pageable);
+    Page<WaterLevel> queryAllByLimit(@Param("waterLevelQuery") WaterLevelQuery waterLevelQuery, Page page);
+
+
+
+
+    /**
+     * 查询指定行数据
+     *
+     * @param waterLevelQuery 查询条件
+     * @param page         分页对象
+     * @return 对象列表
+     */
+    Page<WaterLevel> queryAllByTime(@Param("waterLevelQuery") WaterLevelQuery waterLevelQuery, Page page);
+
 
     /**
      * 统计总行数

+ 35 - 0
ruoyi-system/src/main/java/com/ruoyi/system/paramet/AchievementQuery.java

@@ -0,0 +1,35 @@
+package com.ruoyi.system.paramet;
+
+import lombok.Data;
+
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+
+/**
+ * 停泊点配置(BerthingPoint)实体类
+ *
+ * @author makejava
+ * @since 2024-04-10 15:29:55
+ */
+@Data
+public class AchievementQuery implements Serializable {
+
+
+    /**
+     * 站点ID
+     */
+    @NotNull(message = "站点ID不能为空")
+    private Long siteId;
+
+    /**
+     * 分页
+     */
+    private Long page;
+
+    /**
+     * 分页长度
+     */
+    private Long size;
+
+}
+

+ 1 - 0
ruoyi-system/src/main/java/com/ruoyi/system/paramet/BerthingPointQuery.java

@@ -23,6 +23,7 @@ public class BerthingPointQuery implements Serializable {
     /**
      * 站点ID
      */
+    @NotNull(message = "站点ID不能为空")
     private Long siteId;
 
     /**

+ 58 - 0
ruoyi-system/src/main/java/com/ruoyi/system/paramet/WaterLevelQuery.java

@@ -0,0 +1,58 @@
+package com.ruoyi.system.paramet;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 停泊点配置(BerthingPoint)实体类
+ *
+ * @author makejava
+ * @since 2024-04-10 15:29:55
+ */
+@Data
+public class WaterLevelQuery implements Serializable {
+
+
+
+    /**
+     * 站点ID
+     */
+    @NotNull(message = "站点ID不能为空")
+    private Long siteId;
+
+
+    /**
+     * 统计类型 1.5分钟 2.10分钟 3.30分钟 4.小时 5.天 6.周 7.月
+     */
+    private Long type;
+
+
+    /**
+     * 开始时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date startTime;
+
+    /**
+     * 结束时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date endTime;
+
+
+    /**
+     * 分页
+     */
+    private Long page;
+
+    /**
+     * 分页长度
+     */
+    private Long size;
+
+}
+

+ 22 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/AchievementService.java

@@ -0,0 +1,22 @@
+package com.ruoyi.system.service;
+
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.system.domain.*;
+import com.ruoyi.system.dto.*;
+import com.ruoyi.system.paramet.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
+
+
+public interface AchievementService {
+
+
+    Page<TaskResult> queryAchievement(AchievementQuery achievementQuery);
+
+    Page<WaterLevel> getWaterLevelList(WaterLevelQuery waterLevelQuery);
+
+
+}

+ 5 - 5
ruoyi-system/src/main/java/com/ruoyi/system/service/ReportDataService.java

@@ -2,13 +2,11 @@ package com.ruoyi.system.service;
 
 
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.ruoyi.system.domain.CarPosition;
-import com.ruoyi.system.domain.HeartBeat;
-import com.ruoyi.system.domain.TaskNotice;
-import com.ruoyi.system.domain.WaterLevel;
-import com.ruoyi.system.dto.ManualMeasureDTO;
+import com.ruoyi.system.domain.*;
 import com.ruoyi.system.dto.SiteRealTimeDTO;
 
+import java.util.List;
+
 
 public interface ReportDataService {
 
@@ -21,4 +19,6 @@ public interface ReportDataService {
     Page<TaskNotice> taskNotice(Long siteId, Long page, Long size);
 
     WaterLevel getWaterLevel(Long siteId);
+
+    List<MeasureUpload> getMeasureLine (Long siteId);
 }

+ 65 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/AchievementServiceImpl.java

@@ -0,0 +1,65 @@
+package com.ruoyi.system.service.impl;
+
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.common.exception.base.BaseException;
+import com.ruoyi.system.domain.SiteInfo;
+import com.ruoyi.system.domain.TaskResult;
+import com.ruoyi.system.domain.WaterLevel;
+import com.ruoyi.system.dto.ManualMeasureDTO;
+import com.ruoyi.system.mapper.SiteInfoMapper;
+import com.ruoyi.system.mapper.TaskResultMapper;
+import com.ruoyi.system.mapper.WaterLevelMapper;
+import com.ruoyi.system.paramet.AchievementQuery;
+import com.ruoyi.system.paramet.WaterLevelQuery;
+import com.ruoyi.system.service.AchievementService;
+import com.ruoyi.system.service.DirectiveService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+
+
+/**
+ * classname: 站点信息
+ * description  服务实现类
+ */
+@Service
+@Slf4j
+public class AchievementServiceImpl implements AchievementService {
+
+    @Resource
+    private TaskResultMapper taskResultMapper;
+
+    @Resource
+    private WaterLevelMapper waterLevelMapper;
+
+    @Override
+    public Page<TaskResult> queryAchievement(AchievementQuery achievementQuery){
+        if (achievementQuery.getPage() == null || achievementQuery.getSize() == null) {
+            achievementQuery.setPage(1L);
+            achievementQuery.setSize(10L);
+        }
+        return taskResultMapper.queryAllByLimit(achievementQuery ,new Page(achievementQuery.getPage(),achievementQuery.getSize()));
+    }
+
+
+
+    @Override
+    public Page<WaterLevel> getWaterLevelList(WaterLevelQuery waterLevelQuery){
+
+        if (waterLevelQuery.getType() == null){
+            waterLevelQuery.setType(1L);
+        }
+        if (waterLevelQuery.getPage() == null || waterLevelQuery.getSize() == null) {
+            waterLevelQuery.setPage(1L);
+            waterLevelQuery.setSize(10L);
+        }
+        return waterLevelMapper.queryAllByTime(waterLevelQuery,new Page(waterLevelQuery.getPage(),waterLevelQuery.getSize()));
+
+    }
+
+
+
+
+}

+ 21 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ReportDataServiceImpl.java

@@ -11,6 +11,8 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
+import java.util.Date;
+import java.util.List;
 
 
 /**
@@ -39,6 +41,12 @@ public class ReportDataServiceImpl implements ReportDataService {
     @Resource
     private WaterLevelMapper waterLevelMapper;
 
+    @Resource
+    private MeasureUploadMapper measureUploadMapper;
+
+    @Resource
+    private TaskResultMapper taskResultMapper;
+
     @Override
     public CarPosition carLocation(Long siteId){
         return carPositionMapper.queryBysiteId(siteId);
@@ -87,4 +95,17 @@ public class ReportDataServiceImpl implements ReportDataService {
     }
 
 
+    @Override
+    public List<MeasureUpload> getMeasureLine (Long siteId){
+        //先查询最后一次开测时间
+        TaskResult taskResult = taskResultMapper.queryBySiteIdOne(siteId);
+        if (taskResult == null){
+            return null;
+        }
+        //再按时间查询垂线信息
+        Date createTime = taskResult.getCreateTime();
+        return measureUploadMapper.queryBySiteIdTime(siteId,createTime);
+    }
+
+
 }

+ 152 - 0
ruoyi-system/src/main/resources/mapper/MeasureUploadMapper.xml

@@ -0,0 +1,152 @@
+<?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.ruoyi.system.mapper.MeasureUploadMapper">
+
+    <resultMap type="com.ruoyi.system.domain.MeasureUpload" id="MeasureUploadMap">
+        <result property="measureId" column="measure_id" jdbcType="INTEGER"/>
+        <result property="planid" column="planid" jdbcType="INTEGER"/>
+        <result property="pn" column="pn" jdbcType="INTEGER"/>
+        <result property="wspeed" column="wspeed" jdbcType="NUMERIC"/>
+        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+        <result property="siteId" column="site_id" jdbcType="INTEGER"/>
+        <result property="status" column="status" jdbcType="INTEGER"/>
+    </resultMap>
+
+    <!--查询单个-->
+    <select id="queryById" resultMap="MeasureUploadMap">
+        select
+measure_id, planid, pn, wspeed, create_time, site_id, status
+        from measure_upload
+        where measure_id = #{measureId}
+    </select>
+
+    <!--查询多个-->
+    <select id="queryBySiteIdTime" resultMap="MeasureUploadMap">
+        select
+            measure_id, planid, pn, wspeed, create_time, site_id, status
+        from measure_upload
+        where site_id = #{siteId} and create_time >= #{createTime}
+    </select>
+
+    <!--查询指定行数据-->
+    <select id="queryAllByLimit" resultMap="MeasureUploadMap">
+        select
+measure_id, planid, pn, wspeed, create_time, site_id, status
+        from measure_upload
+        <where>
+            <if test="measureId != null">
+                and measure_id = #{measureId}
+            </if>
+            <if test="planid != null">
+                and planid = #{planid}
+            </if>
+            <if test="pn != null">
+                and pn = #{pn}
+            </if>
+            <if test="wspeed != null">
+                and wspeed = #{wspeed}
+            </if>
+            <if test="createTime != null">
+                and create_time = #{createTime}
+            </if>
+            <if test="siteId != null">
+                and site_id = #{siteId}
+            </if>
+            <if test="status != null">
+                and status = #{status}
+            </if>
+        </where>
+        limit #{pageable.offset}, #{pageable.pageSize}
+    </select>
+
+    <!--统计总行数-->
+    <select id="count" resultType="java.lang.Long">
+        select count(1)
+        from measure_upload
+        <where>
+            <if test="measureId != null">
+                and measure_id = #{measureId}
+            </if>
+            <if test="planid != null">
+                and planid = #{planid}
+            </if>
+            <if test="pn != null">
+                and pn = #{pn}
+            </if>
+            <if test="wspeed != null">
+                and wspeed = #{wspeed}
+            </if>
+            <if test="createTime != null">
+                and create_time = #{createTime}
+            </if>
+            <if test="siteId != null">
+                and site_id = #{siteId}
+            </if>
+            <if test="status != null">
+                and status = #{status}
+            </if>
+        </where>
+    </select>
+
+    <!--新增所有列-->
+    <insert id="insert" keyProperty="measureId" useGeneratedKeys="true">
+        insert into measure_upload(planid, pn, wspeed, create_time, site_id, status)
+        values (#{planid}, #{pn}, #{wspeed}, #{createTime}, #{siteId}, #{status})
+    </insert>
+
+    <insert id="insertBatch" keyProperty="measureId" useGeneratedKeys="true">
+        insert into measure_upload(planid, pn, wspeed, create_time, site_id, status)
+        values
+        <foreach collection="entities" item="entity" separator=",">
+        (#{entity.planid}, #{entity.pn}, #{entity.wspeed}, #{entity.createTime}, #{entity.siteId}, #{entity.status})
+        </foreach>
+    </insert>
+
+    <insert id="insertOrUpdateBatch" keyProperty="measureId" useGeneratedKeys="true">
+        insert into measure_upload(planid, pn, wspeed, create_time, site_id, status)
+        values
+        <foreach collection="entities" item="entity" separator=",">
+            (#{entity.planid}, #{entity.pn}, #{entity.wspeed}, #{entity.createTime}, #{entity.siteId}, #{entity.status})
+        </foreach>
+        on duplicate key update
+planid = values(planid),
+pn = values(pn),
+wspeed = values(wspeed),
+create_time = values(create_time),
+site_id = values(site_id),
+status = values(status)
+    </insert>
+
+    <!--通过主键修改数据-->
+    <update id="update">
+        update measure_upload
+        <set>
+            <if test="planid != null">
+                planid = #{planid},
+            </if>
+            <if test="pn != null">
+                pn = #{pn},
+            </if>
+            <if test="wspeed != null">
+                wspeed = #{wspeed},
+            </if>
+            <if test="createTime != null">
+                create_time = #{createTime},
+            </if>
+            <if test="siteId != null">
+                site_id = #{siteId},
+            </if>
+            <if test="status != null">
+                status = #{status},
+            </if>
+        </set>
+        where measure_id = #{measureId}
+    </update>
+
+    <!--通过主键删除-->
+    <delete id="deleteById">
+        delete from measure_upload where measure_id = #{measureId}
+    </delete>
+
+</mapper>
+

+ 233 - 0
ruoyi-system/src/main/resources/mapper/TaskResultMapper.xml

@@ -0,0 +1,233 @@
+<?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.ruoyi.system.mapper.TaskResultMapper">
+
+    <resultMap type="com.ruoyi.system.domain.TaskResult" id="TaskResultMap">
+        <result property="resultId" column="result_id" jdbcType="INTEGER"/>
+        <result property="id" column="id" jdbcType="VARCHAR"/>
+        <result property="type" column="type" jdbcType="INTEGER"/>
+        <result property="taskid" column="taskid" jdbcType="VARCHAR"/>
+        <result property="starttime" column="starttime" jdbcType="TIMESTAMP"/>
+        <result property="endtime" column="endtime" jdbcType="TIMESTAMP"/>
+        <result property="width" column="width" jdbcType="NUMERIC"/>
+        <result property="planid" column="planid" jdbcType="INTEGER"/>
+        <result property="acreagesum" column="acreagesum" jdbcType="VARCHAR"/>
+        <result property="flowsum" column="flowsum" jdbcType="NUMERIC"/>
+        <result property="positions" column="positions" jdbcType="VARCHAR"/>
+        <result property="elevations" column="elevations" jdbcType="VARCHAR"/>
+        <result property="acreages" column="acreages" jdbcType="VARCHAR"/>
+        <result property="waterlevels" column="waterlevels" jdbcType="VARCHAR"/>
+        <result property="wspeeds" column="wspeeds" jdbcType="NUMERIC"/>
+        <result property="flows" column="flows" jdbcType="VARCHAR"/>
+        <result property="siteId" column="site_id" jdbcType="INTEGER"/>
+        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+        <result property="status" column="status" jdbcType="INTEGER"/>
+    </resultMap>
+
+    <!--查询单个-->
+    <select id="queryById" resultMap="TaskResultMap">
+        select
+            result_id, id, type, taskid, starttime, endtime, width, planid, acreagesum, flowsum, positions, elevations, acreages, waterlevels, wspeeds, flows, site_id, create_time, status
+        from task_result
+        where result_id = #{resultId}
+    </select>
+
+
+    <!--查询单个-->
+    <select id="queryBySiteIdOne" resultMap="TaskResultMap">
+        select
+            result_id, id, type, taskid, starttime, endtime, width, planid, acreagesum, flowsum, positions, elevations, acreages, waterlevels, wspeeds, flows, site_id, create_time, status
+        from task_result
+        where site_id = #{siteId}
+        order by create_time desc
+        limit 1
+    </select>
+
+    <!--查询指定行数据-->
+    <select id="queryAllByLimit" resultMap="TaskResultMap">
+        select
+            result_id, id, type, taskid, starttime, endtime, width, planid, acreagesum, flowsum, positions, elevations, acreages, waterlevels, wspeeds, flows, site_id, create_time, status
+        from task_result
+        <where>
+            <if test="achievementQuery.siteId != null">
+                and site_id = #{achievementQuery.siteId}
+            </if>
+        </where>
+        order by create_time desc
+    </select>
+
+    <!--统计总行数-->
+    <select id="count" resultType="java.lang.Long">
+        select count(1)
+        from task_result
+        <where>
+            <if test="resultId != null">
+                and result_id = #{resultId}
+            </if>
+            <if test="id != null and id != ''">
+                and id = #{id}
+            </if>
+            <if test="type != null">
+                and type = #{type}
+            </if>
+            <if test="taskid != null and taskid != ''">
+                and taskid = #{taskid}
+            </if>
+            <if test="starttime != null">
+                and starttime = #{starttime}
+            </if>
+            <if test="endtime != null">
+                and endtime = #{endtime}
+            </if>
+            <if test="width != null">
+                and width = #{width}
+            </if>
+            <if test="planid != null">
+                and planid = #{planid}
+            </if>
+            <if test="acreagesum != null and acreagesum != ''">
+                and acreagesum = #{acreagesum}
+            </if>
+            <if test="flowsum != null">
+                and flowsum = #{flowsum}
+            </if>
+            <if test="positions != null and positions != ''">
+                and positions = #{positions}
+            </if>
+            <if test="elevations != null and elevations != ''">
+                and elevations = #{elevations}
+            </if>
+            <if test="acreages != null and acreages != ''">
+                and acreages = #{acreages}
+            </if>
+            <if test="waterlevels != null and waterlevels != ''">
+                and waterlevels = #{waterlevels}
+            </if>
+            <if test="wspeeds != null">
+                and wspeeds = #{wspeeds}
+            </if>
+            <if test="flows != null and flows != ''">
+                and flows = #{flows}
+            </if>
+            <if test="siteId != null">
+                and site_id = #{siteId}
+            </if>
+            <if test="createTime != null">
+                and create_time = #{createTime}
+            </if>
+            <if test="status != null">
+                and status = #{status}
+            </if>
+        </where>
+    </select>
+
+    <!--新增所有列-->
+    <insert id="insert" keyProperty="resultId" useGeneratedKeys="true">
+        insert into task_result(id, type, taskid, starttime, endtime, width, planid, acreagesum, flowsum, positions, elevations, acreages, waterlevels, wspeeds, flows, site_id, create_time, status)
+        values (#{id}, #{type}, #{taskid}, #{starttime}, #{endtime}, #{width}, #{planid}, #{acreagesum}, #{flowsum}, #{positions}, #{elevations}, #{acreages}, #{waterlevels}, #{wspeeds}, #{flows}, #{siteId}, #{createTime}, #{status})
+    </insert>
+
+    <insert id="insertBatch" keyProperty="resultId" useGeneratedKeys="true">
+        insert into task_result(id, type, taskid, starttime, endtime, width, planid, acreagesum, flowsum, positions, elevations, acreages, waterlevels, wspeeds, flows, site_id, create_time, status)
+        values
+        <foreach collection="entities" item="entity" separator=",">
+        (#{entity.id}, #{entity.type}, #{entity.taskid}, #{entity.starttime}, #{entity.endtime}, #{entity.width}, #{entity.planid}, #{entity.acreagesum}, #{entity.flowsum}, #{entity.positions}, #{entity.elevations}, #{entity.acreages}, #{entity.waterlevels}, #{entity.wspeeds}, #{entity.flows}, #{entity.siteId}, #{entity.createTime}, #{entity.status})
+        </foreach>
+    </insert>
+
+    <insert id="insertOrUpdateBatch" keyProperty="resultId" useGeneratedKeys="true">
+        insert into task_result(id, type, taskid, starttime, endtime, width, planid, acreagesum, flowsum, positions, elevations, acreages, waterlevels, wspeeds, flows, site_id, create_time, status)
+        values
+        <foreach collection="entities" item="entity" separator=",">
+            (#{entity.id}, #{entity.type}, #{entity.taskid}, #{entity.starttime}, #{entity.endtime}, #{entity.width}, #{entity.planid}, #{entity.acreagesum}, #{entity.flowsum}, #{entity.positions}, #{entity.elevations}, #{entity.acreages}, #{entity.waterlevels}, #{entity.wspeeds}, #{entity.flows}, #{entity.siteId}, #{entity.createTime}, #{entity.status})
+        </foreach>
+        on duplicate key update
+id = values(id),
+type = values(type),
+taskid = values(taskid),
+starttime = values(starttime),
+endtime = values(endtime),
+width = values(width),
+planid = values(planid),
+acreagesum = values(acreagesum),
+flowsum = values(flowsum),
+positions = values(positions),
+elevations = values(elevations),
+acreages = values(acreages),
+waterlevels = values(waterlevels),
+wspeeds = values(wspeeds),
+flows = values(flows),
+site_id = values(site_id),
+create_time = values(create_time),
+status = values(status)
+    </insert>
+
+    <!--通过主键修改数据-->
+    <update id="update">
+        update task_result
+        <set>
+            <if test="id != null and id != ''">
+                id = #{id},
+            </if>
+            <if test="type != null">
+                type = #{type},
+            </if>
+            <if test="taskid != null and taskid != ''">
+                taskid = #{taskid},
+            </if>
+            <if test="starttime != null">
+                starttime = #{starttime},
+            </if>
+            <if test="endtime != null">
+                endtime = #{endtime},
+            </if>
+            <if test="width != null">
+                width = #{width},
+            </if>
+            <if test="planid != null">
+                planid = #{planid},
+            </if>
+            <if test="acreagesum != null and acreagesum != ''">
+                acreagesum = #{acreagesum},
+            </if>
+            <if test="flowsum != null">
+                flowsum = #{flowsum},
+            </if>
+            <if test="positions != null and positions != ''">
+                positions = #{positions},
+            </if>
+            <if test="elevations != null and elevations != ''">
+                elevations = #{elevations},
+            </if>
+            <if test="acreages != null and acreages != ''">
+                acreages = #{acreages},
+            </if>
+            <if test="waterlevels != null and waterlevels != ''">
+                waterlevels = #{waterlevels},
+            </if>
+            <if test="wspeeds != null">
+                wspeeds = #{wspeeds},
+            </if>
+            <if test="flows != null and flows != ''">
+                flows = #{flows},
+            </if>
+            <if test="siteId != null">
+                site_id = #{siteId},
+            </if>
+            <if test="createTime != null">
+                create_time = #{createTime},
+            </if>
+            <if test="status != null">
+                status = #{status},
+            </if>
+        </set>
+        where result_id = #{resultId}
+    </update>
+
+    <!--通过主键删除-->
+    <delete id="deleteById">
+        delete from task_result where result_id = #{resultId}
+    </delete>
+
+</mapper>
+

+ 44 - 1
ruoyi-system/src/main/resources/mapper/WaterLevelMapper.xml

@@ -10,6 +10,11 @@
         <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
     </resultMap>
 
+    <resultMap  type="com.ruoyi.system.dto.WaterLevelDTO" id="WaterLevelDTO">
+        <result property="avgWaterlevel" column="avg_waterlevel" jdbcType="NUMERIC"/>
+        <result property="time" column="time" jdbcType="TIMESTAMP"/>
+    </resultMap>
+
     <!--查询单个-->
     <select id="queryById" resultMap="WaterLevelMap">
         select
@@ -32,7 +37,7 @@
     <!--查询指定行数据-->
     <select id="queryAllByLimit" resultMap="WaterLevelMap">
         select
-water_id, id, waterlevel, site_id, create_time
+            water_id, id, waterlevel, site_id, create_time
         from water_level
         <where>
             <if test="waterId != null">
@@ -54,6 +59,44 @@ water_id, id, waterlevel, site_id, create_time
         limit #{pageable.offset}, #{pageable.pageSize}
     </select>
 
+
+    <!--查询指定行数据-->
+    <select id="queryAllByTime" resultMap="WaterLevelDTO">
+        select
+            <if test="waterLevelQuery.type == 1 or waterLevelQuery.type == null">
+                FROM_UNIXTIME(
+                UNIX_TIMESTAMP(create_time) - MOD(UNIX_TIMESTAMP(create_time), (5 * 60))
+                ) AS time,
+            </if>
+            <if test="waterLevelQuery.type == 2">
+                FROM_UNIXTIME(
+                UNIX_TIMESTAMP(create_time) - MOD(UNIX_TIMESTAMP(create_time), (10 * 60))
+                ) AS time,
+            </if>
+            <if test="waterLevelQuery.type == 3">
+                FROM_UNIXTIME(
+                UNIX_TIMESTAMP(create_time) - MOD(UNIX_TIMESTAMP(create_time), (30 * 60))
+                ) AS time,
+            </if>
+            <if test="waterLevelQuery.type == 4">
+                DATE_FORMAT(create_time, '%Y-%m-%d %H:00:00') AS time,
+            </if>
+            <if test="waterLevelQuery.type == 5">
+                DATE_FORMAT(create_time, '%Y-%m-%d') AS time,
+            </if>
+            <if test="waterLevelQuery.type == 6">
+                DATE_FORMAT(DATE_SUB(create_time, INTERVAL DAYOFWEEK(create_time) - 2 DAY), '%Y-%m-%d') AS time,
+            </if>
+            <if test="waterLevelQuery.type == 7">
+                DATE_FORMAT(create_time, '%Y-%m-01') AS time,
+            </if>
+        ROUND(AVG(waterlevel),3) AS avg_waterlevel
+        from water_level
+        where site_id = #{waterLevelQuery.siteId} and create_time between #{waterLevelQuery.startTime} and #{waterLevelQuery.endTime}
+        GROUP BY time
+        ORDER BY time desc
+    </select>
+
     <!--统计总行数-->
     <select id="count" resultType="java.lang.Long">
         select count(1)

+ 60 - 0
waterAffairs-admin/src/main/java/com/ruoyi/web/controller/tool/AchievementController.java

@@ -0,0 +1,60 @@
+package com.ruoyi.web.controller.tool;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.common.annotation.Anonymous;
+import com.ruoyi.common.utils.R;
+import com.ruoyi.system.domain.BerthingPoint;
+import com.ruoyi.system.domain.TaskResult;
+import com.ruoyi.system.domain.WaterLevel;
+import com.ruoyi.system.paramet.AchievementQuery;
+import com.ruoyi.system.paramet.BerthingPointQuery;
+import com.ruoyi.system.paramet.WaterLevelQuery;
+import com.ruoyi.system.service.AchievementService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+import javax.validation.Valid;
+
+
+/**
+ * @author ifei
+ */
+@RestController
+@RequestMapping("/achievement")
+@Api(tags = "成果报告")
+@Anonymous
+@Slf4j
+public class AchievementController {
+
+    @Resource
+    private AchievementService achievementService;
+
+
+    @PostMapping(value = "/queryAchievement")
+    @ApiOperation("查询成果报告")
+    public R<Page<TaskResult>> queryAchievement(@Valid @RequestBody AchievementQuery achievementQuery) {
+        return R.ok(achievementService.queryAchievement(achievementQuery));
+    }
+
+//    @GetMapping(value = "/downAchievement")
+//    @ApiOperation(value = "导出成果报告")
+//    public R<Boolean> downAchievement(Long siteId, HttpServletResponse response) {
+//        return R.ok();
+//
+//    }
+
+    //水位趋势
+    @PostMapping(value = "/getWaterLevelList")
+    @ApiOperation("获取水位趋势")
+    public R<Page<WaterLevel>> getWaterLevelList(@Valid @RequestBody WaterLevelQuery waterLevelQuery) {
+        return R.ok(achievementService.getWaterLevelList(waterLevelQuery));
+    }
+
+
+    //散点图
+
+}

+ 8 - 12
waterAffairs-admin/src/main/java/com/ruoyi/web/controller/tool/ReportDataController.java

@@ -4,10 +4,7 @@ package com.ruoyi.web.controller.tool;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ruoyi.common.annotation.Anonymous;
 import com.ruoyi.common.utils.R;
-import com.ruoyi.system.domain.CarPosition;
-import com.ruoyi.system.domain.HeartBeat;
-import com.ruoyi.system.domain.TaskNotice;
-import com.ruoyi.system.domain.WaterLevel;
+import com.ruoyi.system.domain.*;
 import com.ruoyi.system.dto.SiteRealTimeDTO;
 import com.ruoyi.system.service.ReportDataService;
 import io.swagger.annotations.Api;
@@ -18,7 +15,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
 import javax.annotation.Resource;
-
+import java.util.ArrayList;
+import java.util.List;
 
 
 /**
@@ -61,21 +59,19 @@ public class ReportDataController {
         return R.ok(reportDataService.taskNotice(siteId,page,size));
     }
     //当前水位
-
     @PostMapping(value = "/getWaterLevel")
     @ApiOperation("获取实时水位")
     public R<WaterLevel> getWaterLevel(Long siteId)  {
         return R.ok(reportDataService.getWaterLevel(siteId));
     }
 
-    //水位趋势
-
     //垂线点对应流量图
+    @PostMapping(value = "/getMeasureLine")
+    @ApiOperation("获取垂线点对应流量图")
+    public R<List<MeasureUpload>> getMeasureLine(Long siteId)  {
+        return R.ok(reportDataService.getMeasureLine(siteId));
+    }
 
-    //成果列表
-
-    //成果导出
 
-    //散点图
 
 }