燕山石化溯源三维电子沙盘-【后端】-服务
13693261870
2024-03-13 f6e0b62b719eeb948125c98cf6ceb249f70645f6
变更观测数据源
已修改5个文件
49 ■■■■ 文件已修改
src/main/java/com/yssh/mapper/QxshMapper.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/mapper/SuYuanMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/service/SuYuanService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/QxshMapper.xml 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/SuYuanMapper.xml 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/yssh/mapper/QxshMapper.java
@@ -1,6 +1,7 @@
package com.yssh.mapper;
import com.yssh.entity.Qxsh;
import com.yssh.entity.SuYuanMonitorData;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@@ -14,6 +15,8 @@
 */
@Mapper
public interface QxshMapper {
    List<SuYuanMonitorData> getNewMonitorData(String name, String start, String end);
    public List<Qxsh> selectByTime(String time);
    public List<Qxsh> selectMonthTop10(String time);
src/main/java/com/yssh/mapper/SuYuanMapper.java
@@ -35,8 +35,6 @@
    List<SuYuanMonitorData> getMonitorData(@Param("tableNames") List<String> tableNames, @Param("id") String id);
    List<SuYuanMonitorData> getNewMonitorData(String name, String start, String end);
    //获取本月指定监测站点监测值对大的数据
    Map<String, Object> getMonthValueDataMax(@Param("tableNames") List<String> tableNames, @Param("id") String id);
src/main/java/com/yssh/service/SuYuanService.java
@@ -272,7 +272,7 @@
        calendar.add(Calendar.DATE, -7);
        String start = DateUtils.getYyyyMmDdHh(calendar.getTime());
        return suYuanMapper.getNewMonitorData(checkPoint.getName(), start, end);
        return qxshMapper.getNewMonitorData(checkPoint.getName(), start, end);
    }
    public int updateVocsName(Date date, String id, String vocsName) {
src/main/resources/mapper/QxshMapper.xml
@@ -1,9 +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.yssh.mapper.QxshMapper">
    <select id="getNewMonitorData" resultType="com.yssh.entity.SuYuanMonitorData">
        select id, format(value, 2) "value", time
        from yssh_qxsh
        where name = #{name} and Cast(time as signed) between ${start} and ${end}
        order by time desc;
    </select>
    <select id="selectByTime" resultType="com.yssh.entity.Qxsh">
        select id, name, lon, lat, format(value, 2) "value", time
        from yssh_qxsh
        from yssh_gcsj
        where time = #{time}
        order by name;
    </select>
@@ -11,7 +18,7 @@
    <select id="selectMonthTop10" resultType="com.yssh.entity.Qxsh">
        with rs as (
            select id, name, lon, lat, format(value, 2) "value", time
            from yssh_qxsh
            from yssh_gcsj
            where time like #{time} and name like 'AI-%'
        )
        select id, name, lon, lat, value, time from rs
@@ -22,7 +29,7 @@
    <select id="selectWeekTop10" resultType="com.yssh.entity.Qxsh">
        with rs as (
            select id, name, lon, lat, format(value, 2) "value", time
            from yssh_qxsh
            from yssh_gcsj
            where time between #{start} and #{end} and name like 'AI-%'
        )
        select id, name, lon, lat, value, time from rs
@@ -33,7 +40,7 @@
    <select id="selectDayTop10" resultType="com.yssh.entity.Qxsh">
        with rs as (
            select id, name, lon, lat, format(value, 2) "value", time
            from yssh_qxsh
            from yssh_gcsj
            where time like #{time} and name like 'AI-%'
        )
        select id, name, lon, lat, value, time from rs
@@ -43,7 +50,7 @@
    <select id="selectWarnByBeginAndEnd" resultType="com.yssh.entity.Qxsh">
        select id, name, lon, lat, format(value, 2) "value", time
        from yssh_qxsh
        from yssh_gcsj
        where time between #{start} and #{end} and name like 'AI-%'
            and value > (select jcyj from alert_config limit 1) and value &lt;= (select jcbj from alert_config limit 1)
        order by time desc, name;
@@ -51,7 +58,7 @@
    <select id="selectAlarmByBeginAndEnd" resultType="com.yssh.entity.Qxsh">
        select id, name, lon, lat, format(value, 2) "value", time
        from yssh_qxsh
        from yssh_gcsj
        where time between #{start} and #{end} and name like 'AI-%'
            and value > (select jcbj from alert_config limit 1)
        order by time desc, name;
@@ -59,14 +66,14 @@
    <select id="countMonthForWarn" resultType="java.lang.Integer">
        select count(*)
        from yssh_qxsh
        from yssh_gcsj
        where time between #{start} and #{end} and name like 'AI-%'
            and value > (select jcyj from alert_config limit 1) and value &lt;= (select jcbj from alert_config limit 1);
    </select>
    <select id="countMonthForAlarm" resultType="java.lang.Integer">
        select count(*)
        from yssh_qxsh
        from yssh_gcsj
        where time between #{start} and #{end} and name like 'AI-%'
            and value > (select jcbj from alert_config limit 1);
    </select>
@@ -74,7 +81,7 @@
    <select id="count7DayForWarn" resultType="java.util.Map">
        with rs as (
            select left(time, 8) "createTime"
            from yssh_qxsh
            from yssh_gcsj
            where time between #{start} and #{end} and name like 'AI-%'
                and value > (select jcyj from alert_config limit 1) and value &lt;= (select jcbj from alert_config limit 1)
        )
@@ -84,7 +91,7 @@
    <select id="count7DayForAlarm" resultType="java.util.Map">
        with rs as (
            select left(time, 8) "createTime"
            from yssh_qxsh
            from yssh_gcsj
            where time between #{start} and #{end} and name like 'AI-%'
                and value > (select jcbj from alert_config limit 1)
        )
@@ -102,7 +109,7 @@
    <select id="select3Hours" resultType="com.yssh.entity.Qxsh">
        select id, name, lon, lat, format(value, 2) "value", time
        from yssh_qxsh
        from yssh_gcsj
        where time between #{start} and #{end}
            and value > (select jcyj from alert_config limit 1) and name like 'AI-%'
        order by time, name;
@@ -110,7 +117,7 @@
    <select id="selectForReport" resultType="com.yssh.entity.Qxsh">
        select id, name, format(value, 2) "value", time
        from yssh_qxsh
        from yssh_gcsj
        where time between #{start} and #{end}
            and value > (select jcbj from alert_config limit 1) and name like 'AI-%'
        order by time, name;
@@ -118,14 +125,14 @@
    <select id="selectLastYearVal" resultType="java.lang.Double">
         select format(value, 2) "value"
         from yssh_qxsh
         from yssh_gcsj
         where time = #{time} and name = #{name}
         limit 1;
    </select>
    <select id="selectByTimeAndName" resultType="com.yssh.entity.Qxsh">
        select id, name, lon, lat, format(value, 2) "value", time
        from yssh_qxsh
        from yssh_gcsj
        where time = #{time} and name = #{name}
        limit 1;
    </select>
src/main/resources/mapper/SuYuanMapper.xml
@@ -154,13 +154,6 @@
            WHERE id = #{id}
        </foreach>
    </select>
    <select id="getNewMonitorData" resultType="com.yssh.entity.SuYuanMonitorData">
        select id, format(value, 2) "value", time
        from yssh_qxsh
        where name = #{name} and Cast(time as signed) between ${start} and ${end}
        order by time desc;
    </select>
    
    <select id="getMonthValueDataMax" resultType="java.util.Map">
        <foreach collection="tableNames" item="tableName" separator=" UNION ">