From 3371ed856d8712732b3f46e30e41e652ff5d7781 Mon Sep 17 00:00:00 2001 From: feiyu02 <risaku@163.com> Date: 星期五, 20 十月 2023 18:14:25 +0800 Subject: [PATCH] 新增数据分析模块 --- src/main/java/com/flightfeather/monitor/analysis/dust/ExceptionDataMissing.kt | 31 +++ src/main/java/com/flightfeather/monitor/analysis/dust/ExceptionValueMutation.kt | 34 +--- src/test/java/com/flightfeather/monitor/QianduanApplicationTests.java | 26 --- src/main/java/com/flightfeather/monitor/analysis/dust/BaseExceptionContinuous.kt | 59 +++++++ src/main/java/com/flightfeather/monitor/analysis/BaseDataAnalysis.kt | 27 +++ /dev/null | 30 --- src/main/java/com/flightfeather/monitor/analysis/dust/ExceptionExceedingTimes.kt | 47 +++++ src/main/java/com/flightfeather/monitor/analysis/dust/ExceptionNoFluctuation.kt | 22 ++ src/main/java/com/flightfeather/monitor/domain/ds1/entity/DustExceptionSetting.java | 16 ++ src/main/resources/mapper/ds1/DustExceptionSettingMapper.xml | 3 src/main/java/com/flightfeather/monitor/enumration/dust/ExceptionType.kt | 9 + src/main/java/com/flightfeather/monitor/analysis/dust/BaseDustExceptionAnalysis.kt | 46 +++++ src/main/resources/generator/generatorConfig4ds1.xml | 70 ++++---- src/main/java/com/flightfeather/monitor/analysis/dust/ExceptionApproachExceeding.kt | 23 ++ 14 files changed, 328 insertions(+), 115 deletions(-) diff --git a/src/main/java/com/flightfeather/monitor/analysis/BaseDataAnalysis.kt b/src/main/java/com/flightfeather/monitor/analysis/BaseDataAnalysis.kt new file mode 100644 index 0000000..ac32aab --- /dev/null +++ b/src/main/java/com/flightfeather/monitor/analysis/BaseDataAnalysis.kt @@ -0,0 +1,27 @@ +package com.flightfeather.monitor.analysis + +/** + * 鏁版嵁鍒嗘瀽鍩虹被 + */ +abstract class BaseDataAnalysis<T, V, Y>(val config: V) { + + //鍒嗘瀽缁撴灉 + val resultList = mutableListOf<Y>() + + /** + * 閰嶇疆鍒濆鍖� + */ + open fun init(){ + resultList.clear() + } + + /** + * 鎺ユ敹涓嬩竴涓椂闂寸偣鐨勬暟鎹� + */ + abstract fun onNextData(data: T) + + /** + * 鏁版嵁寰幆缁撴潫 + */ + abstract fun onDone() +} \ No newline at end of file diff --git a/src/main/java/com/flightfeather/monitor/analysis/DataAnalysisInterface.kt b/src/main/java/com/flightfeather/monitor/analysis/DataAnalysisInterface.kt deleted file mode 100644 index ae94c20..0000000 --- a/src/main/java/com/flightfeather/monitor/analysis/DataAnalysisInterface.kt +++ /dev/null @@ -1,30 +0,0 @@ -package com.flightfeather.monitor.analysis - -/** - * 鏁版嵁鍒嗘瀽鎺ュ彛 - */ -abstract class DataAnalysisInterface<T, V>(config: V) { - - init { - initConfig(config) - } - - abstract fun initConfig(config: V) - - /** - * 鎺ユ敹涓嬩竴涓椂闂寸偣鐨勬暟鎹� - */ - abstract fun onNextData(data: T) - - /** - * 灏嗗垎鏋愮粨鏋滃叆搴� - */ - abstract fun toDb() - - /** - * 鍒ゆ柇鐩搁偦鏁版嵁鏄惁杩炵画 - */ - fun isContinuous(d1:T, d2:T) { - - } -} \ No newline at end of file diff --git a/src/main/java/com/flightfeather/monitor/analysis/dust/BaseDustExceptionAnalysis.kt b/src/main/java/com/flightfeather/monitor/analysis/dust/BaseDustExceptionAnalysis.kt new file mode 100644 index 0000000..35cb387 --- /dev/null +++ b/src/main/java/com/flightfeather/monitor/analysis/dust/BaseDustExceptionAnalysis.kt @@ -0,0 +1,46 @@ +package com.flightfeather.monitor.analysis.dust + +import com.flightfeather.monitor.analysis.BaseDataAnalysis +import com.flightfeather.monitor.domain.ds1.entity.DustExceptionData +import com.flightfeather.monitor.domain.ds1.entity.DustExceptionSetting +import com.flightfeather.monitor.domain.ds1.entity.DustSiteData +import com.flightfeather.monitor.enumration.dust.ExceptionType +import java.time.Duration + +/** + * 鎵皹鐩戞祴鏁版嵁寮傚父鍒嗘瀽鍩虹被 + */ +abstract class BaseDustExceptionAnalysis(config: DustExceptionSetting) : + BaseDataAnalysis<DustSiteData, DustExceptionSetting, DustExceptionData>(config) { + + /** + * 纭畾寮傚父绫诲瀷 + */ + abstract fun getExceptionType(): ExceptionType + + /** + * 鍒ゆ柇鐩搁偦鏁版嵁鏄惁杩炵画 + */ + open fun isContinuous(d1: DustSiteData?, d2: DustSiteData): Boolean { + if (d1 == null) return true + + val t1 = d1.lst + val t2 = d2.lst + return Duration.between(t1?.toInstant(), t2.toInstant()).toMinutes() <= 30 + } + + /** + * 鐢熸垚涓�鏉″紓甯稿垎鏋愮粨鏋� + */ + protected fun newResult(p: DustSiteData?, n: DustSiteData): DustExceptionData { + val eType = getExceptionType() + return DustExceptionData().apply { + mnCode = n.mnCode + exception = eType.des + exceptionType = eType.value + region = config.region + beginTime = if (p == null) n.lst else p.lst + endTime = n.lst + } + } +} \ No newline at end of file diff --git a/src/main/java/com/flightfeather/monitor/analysis/dust/BaseExceptionContinuous.kt b/src/main/java/com/flightfeather/monitor/analysis/dust/BaseExceptionContinuous.kt new file mode 100644 index 0000000..73d1a0c --- /dev/null +++ b/src/main/java/com/flightfeather/monitor/analysis/dust/BaseExceptionContinuous.kt @@ -0,0 +1,59 @@ +package com.flightfeather.monitor.analysis.dust + +import com.flightfeather.monitor.domain.ds1.entity.DustExceptionSetting +import com.flightfeather.monitor.domain.ds1.entity.DustSiteData + +/** + * 杩炵画绫诲瀷鐨勫紓甯稿垎鏋愬熀绫� + */ +abstract class BaseExceptionContinuous(config: DustExceptionSetting) : BaseDustExceptionAnalysis(config) { + + private var sIndex = 0 + private var startData: DustSiteData? = null + private var eIndex = -1 + private var lastData: DustSiteData? = null + + /** + * 鍒ゆ柇鏄惁婊¤冻寮傚父鏉′欢 + */ + abstract fun judgeException(p: DustSiteData?, n: DustSiteData): Boolean + + /** + * 鍒ゆ柇寮傚父鍑虹幇鐨勮繛缁椂闀挎槸鍚︽弧瓒虫潯浠� + */ + abstract fun judgeDuration(sIndex: Int, eIndex: Int): Boolean + + override fun init() { + startData = null + lastData = null + sIndex = 0 + eIndex = -1 + } + + override fun onNextData(data: DustSiteData) { + eIndex++ + if (lastData == null) { + startData = data + } + // 鍒ゆ柇鐩搁偦鏁版嵁鏄惁杩炵画骞朵笖鏄惁婊¤冻寮傚父鍒ゆ柇 + if (!(isContinuous(lastData, data) && judgeException(lastData, data))) { + checkResult() + sIndex = eIndex + startData = data + } + lastData = data + } + + override fun onDone() { + checkResult() + } + + /** + * 妫�鏌ヨ繛缁紓甯哥粨鏉熸椂锛屾槸鍚︾鍚堝紓甯稿瓨鍌ㄦ潯浠� + */ + private fun checkResult() { + if (judgeDuration(sIndex, eIndex)) { + resultList.add(newResult(lastData, startData!!)) + } + } +} \ No newline at end of file diff --git a/src/main/java/com/flightfeather/monitor/analysis/dust/ExceptionApproachExceeding.kt b/src/main/java/com/flightfeather/monitor/analysis/dust/ExceptionApproachExceeding.kt new file mode 100644 index 0000000..131e81c --- /dev/null +++ b/src/main/java/com/flightfeather/monitor/analysis/dust/ExceptionApproachExceeding.kt @@ -0,0 +1,23 @@ +package com.flightfeather.monitor.analysis.dust + +import com.flightfeather.monitor.domain.ds1.entity.DustExceptionSetting +import com.flightfeather.monitor.domain.ds1.entity.DustSiteData +import com.flightfeather.monitor.enumration.dust.ExceptionType + +/** + * 鏁版嵁涓磋繎瓒呮爣寮傚父鍒嗘瀽 + */ +class ExceptionApproachExceeding(config: DustExceptionSetting) : BaseExceptionContinuous(config) { + + override fun getExceptionType(): ExceptionType = ExceptionType.TYPE5 + + override fun judgeException(p: DustSiteData?, n: DustSiteData): Boolean { + // 鍒ゆ柇鏁版嵁鏄惁鍦ㄨ瀹氱殑涓磋繎瓒呮爣鑼冨洿鍐� + return n.dustValue >= config.nearExceedLowValue && n.dustValue <= config.nearExceedHighValue + } + + override fun judgeDuration(sIndex: Int, eIndex: Int): Boolean { + // 鍒ゆ柇鏁版嵁涓磋繎瓒呮爣鏁伴噺鏄惁杩炵画瓒呰繃闄愬畾涓暟 + return (eIndex - sIndex) >= config.nearExceedNum + } +} \ No newline at end of file diff --git a/src/main/java/com/flightfeather/monitor/analysis/dust/ExceptionDataMissing.kt b/src/main/java/com/flightfeather/monitor/analysis/dust/ExceptionDataMissing.kt new file mode 100644 index 0000000..bc526a0 --- /dev/null +++ b/src/main/java/com/flightfeather/monitor/analysis/dust/ExceptionDataMissing.kt @@ -0,0 +1,31 @@ +package com.flightfeather.monitor.analysis.dust + +import com.flightfeather.monitor.domain.ds1.entity.DustExceptionSetting +import com.flightfeather.monitor.domain.ds1.entity.DustSiteData +import com.flightfeather.monitor.enumration.dust.ExceptionType +import java.time.Duration + +/** + * 鏁版嵁缂哄け寮傚父鍒嗘瀽 + */ +class ExceptionDataMissing(config: DustExceptionSetting) : BaseDustExceptionAnalysis(config) { + + private var lastData: DustSiteData? = null + + override fun getExceptionType(): ExceptionType = ExceptionType.TYPE0 + + override fun onNextData(data: DustSiteData) { + lastData?.let { + val t1 = it.lst + val t2 = data.lst + if (Duration.between(t1?.toInstant(), t2.toInstant()).toMinutes() > config.missDataMinutes) { + resultList.add(newResult(it, data)) + } + } + lastData = data + } + + override fun onDone() { + //do noting + } +} \ No newline at end of file diff --git a/src/main/java/com/flightfeather/monitor/analysis/dust/ExceptionExceedingTimes.kt b/src/main/java/com/flightfeather/monitor/analysis/dust/ExceptionExceedingTimes.kt new file mode 100644 index 0000000..a1b2496 --- /dev/null +++ b/src/main/java/com/flightfeather/monitor/analysis/dust/ExceptionExceedingTimes.kt @@ -0,0 +1,47 @@ +package com.flightfeather.monitor.analysis.dust + +import com.flightfeather.monitor.domain.ds1.entity.DustExceptionData +import com.flightfeather.monitor.domain.ds1.entity.DustExceptionSetting +import com.flightfeather.monitor.domain.ds1.entity.DustSiteData +import com.flightfeather.monitor.enumration.dust.ExceptionType +import java.time.LocalDateTime +import java.time.ZoneId +import java.util.* + +/** + * 鍗曟棩瓒呮爣娆℃暟涓磋繎澶勭綒鏍囧噯寮傚父鍒嗘瀽 + */ +class ExceptionExceedingTimes(config: DustExceptionSetting) : BaseDustExceptionAnalysis(config) { + + private var exceedingCount = 0 + private var startData: DustSiteData? = null + + override fun getExceptionType(): ExceptionType = ExceptionType.TYPE6 + + override fun onNextData(data: DustSiteData) { + if (startData == null) startData = data + + if (data.dustValue >= config.exceedingStandard) { + exceedingCount++ + } + } + + override fun onDone() { + if (exceedingCount >= config.dayExceedBorderlineLowNum && exceedingCount < config.dayExceedBorderlineHighNum) { + startData?.let { + val eType = getExceptionType() + val t = LocalDateTime.ofInstant(it.lst.toInstant(), ZoneId.systemDefault()) + t.withHour(0) + val sT = + resultList.add(DustExceptionData().apply { + mnCode = it.mnCode + exception = eType.des + exceptionType = eType.value + region = config.region +// beginTime = if (p == null) n.lst else p.lst +// endTime = n.lst + }) + } + } + } +} \ No newline at end of file diff --git a/src/main/java/com/flightfeather/monitor/analysis/dust/ExceptionNoFluctuation.kt b/src/main/java/com/flightfeather/monitor/analysis/dust/ExceptionNoFluctuation.kt new file mode 100644 index 0000000..f89fdef --- /dev/null +++ b/src/main/java/com/flightfeather/monitor/analysis/dust/ExceptionNoFluctuation.kt @@ -0,0 +1,22 @@ +package com.flightfeather.monitor.analysis.dust + +import com.flightfeather.monitor.domain.ds1.entity.DustExceptionSetting +import com.flightfeather.monitor.domain.ds1.entity.DustSiteData +import com.flightfeather.monitor.enumration.dust.ExceptionType + +/** + * 鏁版嵁闀挎椂闂存棤娉㈠姩寮傚父鍒嗘瀽 + */ +class ExceptionNoFluctuation(config: DustExceptionSetting) : BaseExceptionContinuous(config) { + + override fun getExceptionType(): ExceptionType = ExceptionType.TYPE3 + + override fun judgeException(p: DustSiteData?, n: DustSiteData): Boolean { + if (p == null) return false + return p.dustValue == n.dustValue + } + + override fun judgeDuration(sIndex: Int, eIndex: Int): Boolean { + return (eIndex - sIndex) >= config.longTimeNoChange + } +} \ No newline at end of file diff --git a/src/main/java/com/flightfeather/monitor/analysis/dust/ExceptionValueMutation.kt b/src/main/java/com/flightfeather/monitor/analysis/dust/ExceptionValueMutation.kt index 2a0387e..c28e59e 100644 --- a/src/main/java/com/flightfeather/monitor/analysis/dust/ExceptionValueMutation.kt +++ b/src/main/java/com/flightfeather/monitor/analysis/dust/ExceptionValueMutation.kt @@ -1,39 +1,23 @@ package com.flightfeather.monitor.analysis.dust -import com.flightfeather.monitor.analysis.DataAnalysisInterface import com.flightfeather.monitor.domain.ds1.entity.DustExceptionSetting import com.flightfeather.monitor.domain.ds1.entity.DustSiteData -import java.util.* -import kotlin.properties.Delegates +import com.flightfeather.monitor.enumration.dust.ExceptionType +import kotlin.math.abs /** * 閲忕骇绐佸彉寮傚父鍒嗘瀽 */ -class ExceptionValueMutation(config: DustExceptionSetting) : DataAnalysisInterface<DustSiteData, - DustExceptionSetting>(config) { +class ExceptionValueMutation(config: DustExceptionSetting) : BaseExceptionContinuous(config) { - private var mutationNum by Delegates.notNull<Int>() + override fun getExceptionType(): ExceptionType = ExceptionType.TYPE4 - private var mutationRate by Delegates.notNull<Double>() - - private var lastDataTime: Date? = null - - override fun initConfig(config: DustExceptionSetting) { - mutationNum = config.mutationNum - mutationRate = config.mutationRate + override fun judgeException(p: DustSiteData?, n: DustSiteData): Boolean { + if (p == null) return false + return abs((p.dustValue - n.dustValue) / p.dustValue) >= config.mutationRate } - override fun onNextData(data: DustSiteData) { - if (lastDataTime != null) { - // 鐩搁偦鏁版嵁鏃堕棿灏忎簬鎴栫瓑浜�30鍒嗛挓鍒嗕负涓�缁� - } - - lastDataTime = data.lst + override fun judgeDuration(sIndex: Int, eIndex: Int): Boolean { + return (eIndex - sIndex) >= config.mutationNum } - - override fun toDb() { - TODO("Not yet implemented") - } - - } \ No newline at end of file diff --git a/src/main/java/com/flightfeather/monitor/domain/ds1/entity/DustExceptionSetting.java b/src/main/java/com/flightfeather/monitor/domain/ds1/entity/DustExceptionSetting.java index 68aac02..5b1f507 100644 --- a/src/main/java/com/flightfeather/monitor/domain/ds1/entity/DustExceptionSetting.java +++ b/src/main/java/com/flightfeather/monitor/domain/ds1/entity/DustExceptionSetting.java @@ -13,6 +13,8 @@ @Column(name = "update_time") private Date updateTime; + private String region; + private String version; @Column(name = "miss_data_minutes") @@ -100,6 +102,20 @@ } /** + * @return region + */ + public String getRegion() { + return region; + } + + /** + * @param region + */ + public void setRegion(String region) { + this.region = region == null ? null : region.trim(); + } + + /** * @return version */ public String getVersion() { diff --git a/src/main/java/com/flightfeather/monitor/enumration/dust/ExceptionType.kt b/src/main/java/com/flightfeather/monitor/enumration/dust/ExceptionType.kt new file mode 100644 index 0000000..ab9e931 --- /dev/null +++ b/src/main/java/com/flightfeather/monitor/enumration/dust/ExceptionType.kt @@ -0,0 +1,9 @@ +package com.flightfeather.monitor.enumration.dust + +enum class ExceptionType(val value:Int, val des:String) { + TYPE0(0, "鏂綉鎴栨帀绾�"), + TYPE3(3, "鏁版嵁闀挎椂娈垫棤娉㈠姩"), + TYPE4(4, "閲忕骇绐佸彉寮傚父"), + TYPE5(5, "涓磋繎瓒呮爣寮傚父"), + TYPE6(6, "鍗曟棩瓒呮爣娆℃暟涓磋繎澶勭綒寮傚父"), +} \ No newline at end of file diff --git a/src/main/resources/generator/generatorConfig4ds1.xml b/src/main/resources/generator/generatorConfig4ds1.xml index 883d6d5..e338511 100644 --- a/src/main/resources/generator/generatorConfig4ds1.xml +++ b/src/main/resources/generator/generatorConfig4ds1.xml @@ -43,44 +43,44 @@ <property name="enableSubPackages" value="true"/> </javaClientGenerator> <!-- 瑕佺敓鎴愮殑琛� tableName鏄暟鎹簱涓殑琛ㄥ悕鎴栬鍥惧悕 domainObjectName鏄疄浣撶被鍚�--> - <table tableName="du_js_t_login_info" domainObjectName="LoginInfo" enableCountByExample="false" - enableUpdateByExample="false" enableDeleteByExample="false" - enableSelectByExample="false" selectByExampleQueryId="false"/> - <table tableName="du_js_t_request_task_setting" domainObjectName="RequestTaskSetting" - enableCountByExample="false" - enableUpdateByExample="false" enableDeleteByExample="false" - enableSelectByExample="false" selectByExampleQueryId="false"/> - <table tableName="du_js_t_site_latest_time" domainObjectName="DustSiteLatestTime" - enableCountByExample="false" - enableUpdateByExample="false" enableDeleteByExample="false" - enableSelectByExample="false" selectByExampleQueryId="false"/> - <table tableName="du_js_t_site_map" domainObjectName="DustSiteMap" - enableCountByExample="false" - enableUpdateByExample="false" enableDeleteByExample="false" - enableSelectByExample="false" selectByExampleQueryId="false"/> - <table tableName="dust_exception_data" domainObjectName="DustExceptionData" - enableCountByExample="false" - enableUpdateByExample="false" enableDeleteByExample="false" - enableSelectByExample="false" selectByExampleQueryId="false"/> +<!-- <table tableName="du_js_t_login_info" domainObjectName="LoginInfo" enableCountByExample="false"--> +<!-- enableUpdateByExample="false" enableDeleteByExample="false"--> +<!-- enableSelectByExample="false" selectByExampleQueryId="false"/>--> +<!-- <table tableName="du_js_t_request_task_setting" domainObjectName="RequestTaskSetting"--> +<!-- enableCountByExample="false"--> +<!-- enableUpdateByExample="false" enableDeleteByExample="false"--> +<!-- enableSelectByExample="false" selectByExampleQueryId="false"/>--> +<!-- <table tableName="du_js_t_site_latest_time" domainObjectName="DustSiteLatestTime"--> +<!-- enableCountByExample="false"--> +<!-- enableUpdateByExample="false" enableDeleteByExample="false"--> +<!-- enableSelectByExample="false" selectByExampleQueryId="false"/>--> +<!-- <table tableName="du_js_t_site_map" domainObjectName="DustSiteMap"--> +<!-- enableCountByExample="false"--> +<!-- enableUpdateByExample="false" enableDeleteByExample="false"--> +<!-- enableSelectByExample="false" selectByExampleQueryId="false"/>--> +<!-- <table tableName="dust_exception_data" domainObjectName="DustExceptionData"--> +<!-- enableCountByExample="false"--> +<!-- enableUpdateByExample="false" enableDeleteByExample="false"--> +<!-- enableSelectByExample="false" selectByExampleQueryId="false"/>--> <table tableName="dust_exception_setting" domainObjectName="DustExceptionSetting" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/> - <table tableName="dust_global_setting" domainObjectName="DustGlobalSetting" - enableCountByExample="false" - enableUpdateByExample="false" enableDeleteByExample="false" - enableSelectByExample="false" selectByExampleQueryId="false"/> - <table tableName="dust_statistics_value" domainObjectName="DustStatisticsValue" - enableCountByExample="false" - enableUpdateByExample="false" enableDeleteByExample="false" - enableSelectByExample="false" selectByExampleQueryId="false"/> - <table tableName="ja_t_dust_site_data_info" domainObjectName="DustSiteData" - enableCountByExample="false" - enableUpdateByExample="false" enableDeleteByExample="false" - enableSelectByExample="false" selectByExampleQueryId="false"/> - <table tableName="ja_t_dust_site_info" domainObjectName="DustSiteInfo" - enableCountByExample="false" - enableUpdateByExample="false" enableDeleteByExample="false" - enableSelectByExample="false" selectByExampleQueryId="false"/> +<!-- <table tableName="dust_global_setting" domainObjectName="DustGlobalSetting"--> +<!-- enableCountByExample="false"--> +<!-- enableUpdateByExample="false" enableDeleteByExample="false"--> +<!-- enableSelectByExample="false" selectByExampleQueryId="false"/>--> +<!-- <table tableName="dust_statistics_value" domainObjectName="DustStatisticsValue"--> +<!-- enableCountByExample="false"--> +<!-- enableUpdateByExample="false" enableDeleteByExample="false"--> +<!-- enableSelectByExample="false" selectByExampleQueryId="false"/>--> +<!-- <table tableName="ja_t_dust_site_data_info" domainObjectName="DustSiteData"--> +<!-- enableCountByExample="false"--> +<!-- enableUpdateByExample="false" enableDeleteByExample="false"--> +<!-- enableSelectByExample="false" selectByExampleQueryId="false"/>--> +<!-- <table tableName="ja_t_dust_site_info" domainObjectName="DustSiteInfo"--> +<!-- enableCountByExample="false"--> +<!-- enableUpdateByExample="false" enableDeleteByExample="false"--> +<!-- enableSelectByExample="false" selectByExampleQueryId="false"/>--> </context> </generatorConfiguration> \ No newline at end of file diff --git a/src/main/resources/mapper/ds1/DustExceptionSettingMapper.xml b/src/main/resources/mapper/ds1/DustExceptionSettingMapper.xml index 2729ad1..26168f7 100644 --- a/src/main/resources/mapper/ds1/DustExceptionSettingMapper.xml +++ b/src/main/resources/mapper/ds1/DustExceptionSettingMapper.xml @@ -8,6 +8,7 @@ <id column="id" jdbcType="INTEGER" property="id" /> <result column="user" jdbcType="VARCHAR" property="user" /> <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> + <result column="region" jdbcType="VARCHAR" property="region" /> <result column="version" jdbcType="VARCHAR" property="version" /> <result column="miss_data_minutes" jdbcType="INTEGER" property="missDataMinutes" /> <result column="data_low" jdbcType="DOUBLE" property="dataLow" /> @@ -28,7 +29,7 @@ <!-- WARNING - @mbg.generated --> - id, user, update_time, version, miss_data_minutes, data_low, long_time_no_change, + id, user, update_time, region, version, miss_data_minutes, data_low, long_time_no_change, mutation_num, mutation_rate, near_exceed_low_value, near_exceed_high_value, near_exceed_num, day_exceed_borderline_low_num, day_exceed_borderline_high_num, change_trend_group, change_trend_interval, change_trend_rate, exceeding_standard diff --git a/src/test/java/com/flightfeather/monitor/QianduanApplicationTests.java b/src/test/java/com/flightfeather/monitor/QianduanApplicationTests.java index f4b3a8e..b9f1150 100644 --- a/src/test/java/com/flightfeather/monitor/QianduanApplicationTests.java +++ b/src/test/java/com/flightfeather/monitor/QianduanApplicationTests.java @@ -1,14 +1,12 @@ package com.flightfeather.monitor; -import com.flightfeather.monitor.analysis.database.DustRepository; -import com.flightfeather.monitor.pojo.DustExceptionSetting; import org.junit.jupiter.api.Test; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import java.text.ParseException; import java.text.SimpleDateFormat; -import java.util.*; +import java.util.Date; +import java.util.Locale; @SpringBootTest class QianduanApplicationTests { @@ -29,26 +27,6 @@ System.out.print(date1); //return df2.format(date1); - - } - @Autowired - private DustRepository dustRepository; - @Test - void readSiteData(){ -// DustExceptionSetting dustExceptionSetting = DustExceptionSetting.getInstance(); -// 璇诲彇寮傚父鍒嗘瀽鍒ゅ畾鐨勯厤缃� - List<DustExceptionSetting> list= dustRepository.readExceptionSetting(); - System.out.println("11111"); - - System.out.println(list.size()); - System.out.println(list.get(0)); - - -// List<DustSiteData> dustData = dustRepository.getDustData("2023-10-01 00:00:00","2023-10-01 01:00:00"); -//// System.out.println(dustData.get(0).getMnCode()); -// int a = Exceeding.main(dustData); -// System.out.println(a); - } -- Gitblit v1.9.3