Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-zx-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
项目统一框架
一体化_户用光伏项目代码
amos-boot-zx-biz
Commits
9736b415
Commit
9736b415
authored
Aug 12, 2024
by
chenzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
风电健康指数查询优化
parent
ac0daddf
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
120 additions
and
77 deletions
+120
-77
DateUtils.java
...ava/com/yeejoin/amos/boot/biz/common/utils/DateUtils.java
+48
-7
TdInfoQueryController.java
...ot/module/jxiop/biz/controller/TdInfoQueryController.java
+52
-60
FanHealthIndexDto.java
...oin/amos/boot/module/jxiop/biz/dto/FanHealthIndexDto.java
+3
-0
PvHealthIndexDto.java
...join/amos/boot/module/jxiop/biz/dto/PvHealthIndexDto.java
+3
-0
PvHealthIndex.xml
...biz/src/main/resources/mapper/tdengine2/PvHealthIndex.xml
+14
-10
No files found.
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/utils/DateUtils.java
View file @
9736b415
...
@@ -8,6 +8,7 @@ import java.text.SimpleDateFormat;
...
@@ -8,6 +8,7 @@ import java.text.SimpleDateFormat;
import
java.time.Duration
;
import
java.time.Duration
;
import
java.time.LocalDate
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.time.ZoneId
;
import
java.time.format.DateTimeFormatter
;
import
java.time.format.DateTimeFormatter
;
import
java.util.*
;
import
java.util.*
;
...
@@ -664,13 +665,6 @@ public class DateUtils {
...
@@ -664,13 +665,6 @@ public class DateUtils {
/*System.out.println(dateFormat(maxDateOfMonth(dateParse("2016-02", "yyyy-MM")), null));
/*System.out.println(dateFormat(maxDateOfMonth(dateParse("2016-02", "yyyy-MM")), null));
System.out.println(dateFormat(minDateOfMonth(dateParse("2016-03-31", null)), null));*/
System.out.println(dateFormat(minDateOfMonth(dateParse("2016-03-31", null)), null));*/
// System.out.println(dateFormat(new Date(), CHN_DATE_PATTERN_YEAR));
// System.out.println(dateFormat(new Date(), CHN_DATE_PATTERN_MONTH));
// System.out.println(getWeekOfYear(new Date()));
// System.out.println(getQuarterStr(getMonth(dateParse("2021-5-11", null))));
// System.out.println(getWeekBeginDate(dateParse("2021-10-11", null)));
// System.out.println(getWeekEndDate(dateParse("2021-10-11", null)));
System
.
out
.
println
(
secondsToTimeStr
(
3600
));
List
<
String
>
beforeCurrentMonth
=
getBeforeCurrentMonth
(
3
,
true
);
List
<
String
>
beforeCurrentMonth
=
getBeforeCurrentMonth
(
3
,
true
);
System
.
out
.
println
(
beforeCurrentMonth
);
System
.
out
.
println
(
beforeCurrentMonth
);
...
@@ -688,6 +682,53 @@ public class DateUtils {
...
@@ -688,6 +682,53 @@ public class DateUtils {
return
name
;
return
name
;
}
}
//获取当前时间下一整时分点 例如 传入17:18 返回 17:20
public
static
String
getNextWholeMinute
(
String
currentTimeString
)
{
// 定义日期时间字符串的格式
DateTimeFormatter
formatter
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
);
// 将字符串转换为 LocalDateTime
LocalDateTime
currentTime
=
LocalDateTime
.
parse
(
currentTimeString
,
formatter
);
int
currentMinute
=
currentTime
.
getMinute
();
int
seconds
=
currentTime
.
getSecond
();
int
nanos
=
currentTime
.
getNano
();
// 如果当前分钟已经是整时分点,则加上 60 分钟
if
(
currentMinute
%
10
==
0
&&
seconds
==
0
&&
nanos
==
0
)
{
return
currentTimeString
;
}
// 否则计算下一个整时分点
LocalDateTime
localDateTime
=
currentTime
.
withSecond
(
0
).
withNano
(
0
).
plusMinutes
(
10
-
currentMinute
%
10
);
return
localDateTime
.
format
(
formatter
);
}
//获取当前时间下一整时分点 例如 传入17:18 返回 17:20
public
static
String
getBeforeWholeMinute
(
String
currentTimeString
)
{
// 定义日期时间字符串的格式
DateTimeFormatter
formatter
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
);
// 将字符串转换为 LocalDateTime
LocalDateTime
currentTime
=
LocalDateTime
.
parse
(
currentTimeString
,
formatter
);
int
currentMinute
=
currentTime
.
getMinute
();
int
seconds
=
currentTime
.
getSecond
();
int
nanos
=
currentTime
.
getNano
();
// 如果当前分钟已经是整时分点,则加上 60 分钟
if
(
currentMinute
%
10
==
0
&&
seconds
==
0
&&
nanos
==
0
)
{
return
currentTimeString
;
}
// 否则计算下一个整时分点
LocalDateTime
localDateTime
=
currentTime
.
withSecond
(
0
).
withNano
(
0
).
minusMinutes
(
currentMinute
%
10
);
return
localDateTime
.
format
(
formatter
);
}
/**
/**
* 获取某月的日期List
* 获取某月的日期List
*
*
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/TdInfoQueryController.java
View file @
9736b415
...
@@ -100,48 +100,46 @@ public class TdInfoQueryController extends BaseController {
...
@@ -100,48 +100,46 @@ public class TdInfoQueryController extends BaseController {
}
}
dto
.
setOrgCode
(
orgCode
);
dto
.
setOrgCode
(
orgCode
);
Date
currentDate
=
new
Date
();
if
(
CharSequenceUtil
.
isNotEmpty
(
dto
.
getStartDate
()))
{
if
(
CharSequenceUtil
.
isNotEmpty
(
dto
.
getStartDate
()))
{
String
startDate
=
dto
.
getStartDate
();
String
startDate
=
dto
.
getStartDate
();
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按天"
)
&&
startDate
.
length
()
==
10
)
{
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按天"
)
&&
startDate
.
length
()
==
10
)
{
Date
date
=
DateUtils
.
dateParse
(
startDate
+
" 00:00:00"
,
DATE_TIME_PATTERN
);
long
startTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"fan_health_index_day"
,
startDate
,
"Asc "
);
dto
.
setStartDate
(
DateUtils
.
dateFormat
(
DateUtils
.
dateAddHours
(
date
,
0
),
DATE_TIME_PATTERN
)
);
dto
.
setStartDate
Ts
(
startTs
);
}
else
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按小时"
)
&&
startDate
.
length
()
==
13
)
{
}
else
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按小时"
)
&&
startDate
.
length
()
==
13
)
{
Date
date
=
DateUtils
.
dateParse
(
startDate
+
":00:00"
,
DATE_TIME_PATTERN
);
long
startTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"fan_health_index_hour"
,
startDate
+
":00:00"
,
"Asc "
);
dto
.
setStartDate
(
DateUtils
.
dateFormat
(
DateUtils
.
dateAddHours
(
date
,
-
9
),
DATE_TIME_PATTERN
)
);
dto
.
setStartDate
Ts
(
startTs
);
}
else
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按10分钟"
)
&&
startDate
.
length
()
==
16
)
{
}
else
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按10分钟"
)
&&
startDate
.
length
()
==
16
)
{
StringBuilder
newStartDate
=
new
StringBuilder
(
startDate
);
String
nextWholeMinute
=
DateUtils
.
getNextWholeMinute
(
dto
.
getStartDate
()+
":00"
);
int
number
=
0
;
long
startTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"fan_health_index_moment"
,
nextWholeMinute
,
"Asc "
);
if
((
newStartDate
.
charAt
(
15
)
-
'0'
)
>
0
)
{
dto
.
setStartDateTs
(
startTs
);
number
=
9
;
}
newStartDate
.
replace
(
15
,
16
,
number
+
""
);
Date
startDateDate
=
DateUtils
.
dateParse
(
newStartDate
+
":00"
,
DATE_TIME_PATTERN
);
dto
.
setStartDate
(
DateUtils
.
dateFormat
(
DateUtils
.
dateAddHours
(
startDateDate
,
-
8
),
DATE_TIME_PATTERN
));
}
else
{
}
else
{
Date
date
=
DateUtils
.
dateParse
(
startDate
,
DATE_TIME_PATTERN
);
long
startTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"fan_health_index_data"
,
startDate
+
" 00:00:00"
,
"Asc "
);
dto
.
setStartDate
(
DateUtils
.
dateFormat
(
DateUtils
.
dateAddHours
(
date
,
-
8
),
DATE_TIME_PATTERN
)
);
dto
.
setStartDate
Ts
(
startTs
);
}
}
}
}
if
(
CharSequenceUtil
.
isNotEmpty
(
dto
.
getEndDate
()))
{
if
(
CharSequenceUtil
.
isNotEmpty
(
dto
.
getEndDate
()))
{
String
endDate
=
dto
.
getEndDate
();
String
endDate
=
dto
.
getEndDate
();
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按天"
)
&&
endDate
.
length
()
==
10
)
{
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按天"
)
&&
endDate
.
length
()
==
10
)
{
Date
endDateDate
=
DateUtils
.
dateParse
(
endDate
+
" 23:59:59"
,
DATE_TIME_PATTERN
);
long
endTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"fan_health_index_day"
,
endDate
,
"desc "
);
dto
.
setEndDate
(
DateUtils
.
dateFormat
(
DateUtils
.
dateAddHours
(
endDateDate
,
0
),
DATE_TIME_PATTERN
)
);
dto
.
setEndDate
Ts
(
endTs
);
}
else
dto
.
setTableName
(
"fan_health_index_day"
);
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按小时"
)
&&
endDate
.
length
()
==
13
)
{
}
else
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按小时"
)
&&
endDate
.
length
()
==
13
)
{
Date
endDateDate
=
DateUtils
.
dateParse
(
endDate
+
":59:59"
,
DATE_TIME_PATTERN
);
long
endTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"fan_health_index_hour"
,
endDate
+
":00:00"
,
"desc "
);
dto
.
setEndDate
(
DateUtils
.
dateFormat
(
DateUtils
.
dateAddHours
(
endDateDate
,
-
9
),
DATE_TIME_PATTERN
)
);
dto
.
setEndDate
Ts
(
endTs
);
}
else
dto
.
setTableName
(
"fan_health_index_hour"
);
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按10分钟"
)
&&
endDate
.
length
()
==
16
)
{
}
else
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按10分钟"
)
&&
endDate
.
length
()
==
16
)
{
String
Builder
newEndDate
=
new
StringBuilder
(
endDate
);
String
nextWholeMinute
=
DateUtils
.
getBeforeWholeMinute
(
endDate
+
":00"
);
newEndDate
.
replace
(
15
,
16
,
"9
"
);
long
endTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"fan_health_index_moment"
,
nextWholeMinute
,
"desc
"
);
Date
endDateDate
=
DateUtils
.
dateParse
(
newEndDate
+
":59"
,
DATE_TIME_PATTERN
);
dto
.
setEndDateTs
(
endTs
);
dto
.
set
EndDate
(
DateUtils
.
dateFormat
(
DateUtils
.
dateAddHours
(
endDateDate
,
-
8
),
DATE_TIME_PATTERN
)
);
dto
.
set
TableName
(
"fan_health_index_moment"
);
}
else
{
}
else
{
Date
endDateDate
=
DateUtils
.
dateParse
(
endDate
,
"yyyy-MM-dd HH:mm:ss"
);
long
endTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"fan_health_index_data"
,
endDate
+
" 00:00:00"
,
"desc "
);
dto
.
setEndDate
(
DateUtils
.
dateFormat
(
DateUtils
.
dateAddHours
(
endDateDate
,
-
8
),
DATE_TIME_PATTERN
));
dto
.
setEndDateTs
(
endTs
);
dto
.
setTableName
(
"fan_health_index_data"
);
}
}
}
}
Page
<
FanHealthIndex
>
resultPage
=
new
Page
<>(
dto
.
getCurrent
(),
dto
.
getSize
());
Page
<
FanHealthIndex
>
resultPage
=
new
Page
<>(
dto
.
getCurrent
(),
dto
.
getSize
());
...
@@ -213,23 +211,18 @@ public class TdInfoQueryController extends BaseController {
...
@@ -213,23 +211,18 @@ public class TdInfoQueryController extends BaseController {
String
startDate
=
dto
.
getStartDate
();
String
startDate
=
dto
.
getStartDate
();
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按天"
)
&&
startDate
.
length
()
==
10
)
{
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按天"
)
&&
startDate
.
length
()
==
10
)
{
Date
date
=
DateUtils
.
dateParse
(
startDate
+
" 00:00:00"
,
DATE_TIME_PATTERN
);
long
startTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"pv_health_index_day"
,
startDate
,
"Asc "
);
dto
.
setStartDate
(
DateUtils
.
dateFormat
(
DateUtils
.
dateAddHours
(
date
,
0
),
DATE_TIME_PATTERN
)
);
dto
.
setStartDate
Ts
(
startTs
);
}
else
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按小时"
)
&&
startDate
.
length
()
==
13
)
{
}
else
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按小时"
)
&&
startDate
.
length
()
==
13
)
{
Date
date
=
DateUtils
.
dateParse
(
startDate
+
":00:00"
,
DATE_TIME_PATTERN
);
long
startTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"pv_health_index_hour"
,
startDate
+
":00:00"
,
"Asc "
);
dto
.
setStartDate
(
DateUtils
.
dateFormat
(
DateUtils
.
dateAddHours
(
date
,
-
9
),
DATE_TIME_PATTERN
)
);
dto
.
setStartDate
Ts
(
startTs
);
}
else
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按10分钟"
)
&&
startDate
.
length
()
==
16
)
{
}
else
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按10分钟"
)
&&
startDate
.
length
()
==
16
)
{
StringBuilder
newStartDate
=
new
StringBuilder
(
startDate
);
String
nextWholeMinute
=
DateUtils
.
getNextWholeMinute
(
dto
.
getStartDate
()+
":00"
);
int
number
=
0
;
long
startTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"pv_health_index_moment"
,
nextWholeMinute
,
"Asc "
);
if
((
newStartDate
.
charAt
(
15
)
-
'0'
)
>
0
)
{
dto
.
setStartDateTs
(
startTs
);
number
=
9
;
}
newStartDate
.
replace
(
15
,
16
,
number
+
""
);
Date
startDateDate
=
DateUtils
.
dateParse
(
newStartDate
+
":00"
,
DATE_TIME_PATTERN
);
dto
.
setStartDate
(
DateUtils
.
dateFormat
(
DateUtils
.
dateAddHours
(
startDateDate
,
-
8
),
DATE_TIME_PATTERN
));
}
else
{
}
else
{
Date
date
=
DateUtils
.
dateParse
(
startDate
,
DATE_TIME_PATTERN
);
long
startTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"pv_health_index_data"
,
startDate
+
" 00:00:00"
,
"Asc "
);
dto
.
setStartDate
(
DateUtils
.
dateFormat
(
DateUtils
.
dateAddHours
(
date
,
-
8
),
DATE_TIME_PATTERN
)
);
dto
.
setStartDate
Ts
(
startTs
);
}
}
...
@@ -237,25 +230,24 @@ public class TdInfoQueryController extends BaseController {
...
@@ -237,25 +230,24 @@ public class TdInfoQueryController extends BaseController {
}
}
if
(
CharSequenceUtil
.
isNotEmpty
(
dto
.
getEndDate
()))
{
if
(
CharSequenceUtil
.
isNotEmpty
(
dto
.
getEndDate
()))
{
String
endDate
=
dto
.
getEndDate
();
String
endDate
=
dto
.
getEndDate
();
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按天"
)
&&
endDate
.
length
()
==
10
)
{
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按天"
)
&&
endDate
.
length
()
==
10
)
{
Date
endDateDate
=
DateUtils
.
dateParse
(
endDate
+
" 23:59:59"
,
DATE_TIME_PATTERN
);
long
endTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"pv_health_index_day"
,
endDate
,
"desc "
);
dto
.
setEndDate
(
DateUtils
.
dateFormat
(
DateUtils
.
dateAddHours
(
endDateDate
,
0
),
DATE_TIME_PATTERN
)
);
dto
.
setEndDate
Ts
(
endTs
);
}
else
dto
.
setTableName
(
"pv_health_index_day"
);
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按小时"
)
&&
endDate
.
length
()
==
13
)
{
}
else
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按小时"
)
&&
endDate
.
length
()
==
13
)
{
Date
endDateDate
=
DateUtils
.
dateParse
(
endDate
+
":59:59"
,
DATE_TIME_PATTERN
);
long
endTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"pv_health_index_hour"
,
endDate
+
":00:00"
,
"desc "
);
dto
.
setEndDate
(
DateUtils
.
dateFormat
(
DateUtils
.
dateAddHours
(
endDateDate
,
-
9
),
DATE_TIME_PATTERN
)
);
dto
.
setEndDate
Ts
(
endTs
);
}
else
dto
.
setTableName
(
"pv_health_index_hour"
);
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按10分钟"
)
&&
endDate
.
length
()
==
16
)
{
}
else
if
(
dto
.
getAnalysisType
()
!=
null
&&
dto
.
getAnalysisType
().
equals
(
"按10分钟"
)
&&
endDate
.
length
()
==
16
)
{
String
Builder
newEndDate
=
new
StringBuilder
(
endDate
);
String
nextWholeMinute
=
DateUtils
.
getBeforeWholeMinute
(
endDate
);
newEndDate
.
replace
(
15
,
16
,
"9
"
);
long
endTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"pv_health_index_moment"
,
nextWholeMinute
,
"desc
"
);
Date
endDateDate
=
DateUtils
.
dateParse
(
newEndDate
+
":59"
,
DATE_TIME_PATTERN
);
dto
.
setEndDateTs
(
endTs
);
dto
.
set
EndDate
(
DateUtils
.
dateFormat
(
DateUtils
.
dateAddHours
(
endDateDate
,
-
8
),
DATE_TIME_PATTERN
)
);
dto
.
set
TableName
(
"pv_health_index_moment"
);
}
else
{
}
else
{
Date
endDateDate
=
DateUtils
.
dateParse
(
endDate
,
"yyyy-MM-dd HH:mm:ss"
);
long
endTs
=
pvHealthIndexMapper
.
getTsByRecDate
(
"pv_health_index_data"
,
endDate
+
" 00:00:00"
,
"desc "
);
dto
.
setEndDate
(
DateUtils
.
dateFormat
(
DateUtils
.
dateAddHours
(
endDateDate
,
-
8
),
DATE_TIME_PATTERN
));
dto
.
setEndDateTs
(
endTs
);
dto
.
setTableName
(
"pv_health_index_data"
);
}
}
}
}
if
(
CharSequenceUtil
.
isNotEmpty
(
dto
.
getSortsString
()))
{
if
(
CharSequenceUtil
.
isNotEmpty
(
dto
.
getSortsString
()))
{
ObjectMapper
objectMapper
=
new
ObjectMapper
();
ObjectMapper
objectMapper
=
new
ObjectMapper
();
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/dto/FanHealthIndexDto.java
View file @
9736b415
...
@@ -47,4 +47,7 @@ public class FanHealthIndexDto implements Serializable {
...
@@ -47,4 +47,7 @@ public class FanHealthIndexDto implements Serializable {
private
String
orgCode
;
private
String
orgCode
;
private
List
<
String
>
gatewayIds
;
private
List
<
String
>
gatewayIds
;
private
String
warningPeriod
;
private
String
warningPeriod
;
private
String
tableName
;
private
Long
startDateTs
;
private
Long
endDateTs
;
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/dto/PvHealthIndexDto.java
View file @
9736b415
...
@@ -46,5 +46,8 @@ public class PvHealthIndexDto {
...
@@ -46,5 +46,8 @@ public class PvHealthIndexDto {
private
String
sortOne
;
private
String
sortOne
;
private
String
sortsString
;
private
String
sortsString
;
private
String
orgCode
;
private
String
orgCode
;
private
String
tableName
;
private
Long
startDateTs
;
private
Long
endDateTs
;
private
List
<
String
>
gatewayIds
;
private
List
<
String
>
gatewayIds
;
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/mapper/tdengine2/PvHealthIndex.xml
View file @
9736b415
...
@@ -199,12 +199,12 @@
...
@@ -199,12 +199,12 @@
</select>
</select>
<select
id=
"getInfoByPage"
resultType=
"com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvHealthIndex"
>
<select
id=
"getInfoByPage"
resultType=
"com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvHealthIndex"
>
SELECT * FROM
pv_health_index_data
SELECT * FROM
${dto.tableName}
<where>
<where>
<if
test=
"dto.analysisObjType!= null and dto.analysisObjType!= ''"
>
analysis_obj_type = #{dto.analysisObjType}
</if>
<if
test=
"dto.analysisObjType!= null and dto.analysisObjType!= ''"
>
analysis_obj_type = #{dto.analysisObjType}
</if>
<if
test=
"dto.analysisType!= null and dto.analysisType!= ''"
>
and analysis_type = #{dto.analysisType}
</if>
<if
test=
"dto.analysisType!= null and dto.analysisType!= ''"
>
and analysis_type = #{dto.analysisType}
</if>
<if
test=
"dto.endDate
!= null and dto.endDate!= ''"
>
and ts
<
= #{dto.endDate
}
</if>
<if
test=
"dto.endDate
Ts!= null and dto.endDateTs!= ''"
>
and ts
<
= #{dto.endDateTs
}
</if>
<if
test=
"dto.startDate
!= null and dto.startDate!= ''"
>
and ts
>
= #{dto.startDate
}
</if>
<if
test=
"dto.startDate
Ts!= null and dto.startDateTs!= ''"
>
and ts
>
= #{dto.startDateTs
}
</if>
<if
test=
"dto.area!= null and dto.area!= ''"
>
AND area = #{dto.area}
</if>
<if
test=
"dto.area!= null and dto.area!= ''"
>
AND area = #{dto.area}
</if>
<if
test=
"dto.subarray!= null and dto.subarray!= ''"
>
AND subarray = #{dto.subarray}
</if>
<if
test=
"dto.subarray!= null and dto.subarray!= ''"
>
AND subarray = #{dto.subarray}
</if>
<if
test=
"dto.pointName!= null and dto.pointName!= ''"
>
AND point_name = #{dto.pointName}
</if>
<if
test=
"dto.pointName!= null and dto.pointName!= ''"
>
AND point_name = #{dto.pointName}
</if>
...
@@ -226,13 +226,18 @@
...
@@ -226,13 +226,18 @@
limit #{dto.current}, #{dto.size}
limit #{dto.current}, #{dto.size}
</select>
</select>
<select
id=
"getTsByRecDate"
resultType=
"long"
>
SELECT ts FROM analysis_data.${tableName}
where rec_date = #{recDate} order by ts ${sort} limit 1 ;
</select>
<select
id=
"getInfoByPageTotal"
resultType=
"java.lang.Integer"
>
<select
id=
"getInfoByPageTotal"
resultType=
"java.lang.Integer"
>
SELECT count(1) FROM pv_health_index_data
SELECT count(1) FROM pv_health_index_data
<where>
<where>
<if
test=
"dto.analysisObjType!= null and dto.analysisObjType!= ''"
>
analysis_obj_type = #{dto.analysisObjType}
</if>
<if
test=
"dto.analysisObjType!= null and dto.analysisObjType!= ''"
>
analysis_obj_type = #{dto.analysisObjType}
</if>
<if
test=
"dto.analysisType!= null and dto.analysisType!= ''"
>
and analysis_type = #{dto.analysisType}
</if>
<if
test=
"dto.analysisType!= null and dto.analysisType!= ''"
>
and analysis_type = #{dto.analysisType}
</if>
<if
test=
"dto.endDate
!= null and dto.endDate!= ''"
>
and ts
<
= #{dto.endDate
}
</if>
<if
test=
"dto.endDate
Ts!= null and dto.endDateTs!= ''"
>
and ts
<
= #{dto.endDateTs
}
</if>
<if
test=
"dto.startDate
!= null and dto.startDate!= ''"
>
and ts
>
= #{dto.startDate
}
</if>
<if
test=
"dto.startDate
Ts!= null and dto.startDateTs!= ''"
>
and ts
>
= #{dto.startDateTs
}
</if>
<if
test=
"dto.area!= null and dto.area!= ''"
>
AND area = #{dto.area}
</if>
<if
test=
"dto.area!= null and dto.area!= ''"
>
AND area = #{dto.area}
</if>
<if
test=
"dto.subarray!= null and dto.subarray!= ''"
>
AND subarray = #{dto.subarray}
</if>
<if
test=
"dto.subarray!= null and dto.subarray!= ''"
>
AND subarray = #{dto.subarray}
</if>
<if
test=
"dto.pointName!= null and dto.pointName!= ''"
>
AND point_name = #{dto.pointName}
</if>
<if
test=
"dto.pointName!= null and dto.pointName!= ''"
>
AND point_name = #{dto.pointName}
</if>
...
@@ -320,13 +325,12 @@
...
@@ -320,13 +325,12 @@
</select>
</select>
<insert
id=
"saveBatchHealthIndexListNew"
>
<insert
id=
"saveBatchHealthIndexListNew"
>
insert into ${tableName}
insert into
analysis_data.
${tableName}
using
pv_health_index_data_new TAGS (#{analysisTyp
e})
using
analysis_data.pv_health_index_data_new TAGS (#{analysisType},#{recDat
e})
values
values
<foreach
collection=
"list"
separator=
","
item=
"item"
index=
"index"
>
<foreach
collection=
"list"
separator=
","
item=
"item"
index=
"index"
>
(
(
now,
now,
#{item.recDate, jdbcType=VARCHAR},
#{item.analysisObjType, jdbcType=VARCHAR},
#{item.analysisObjType, jdbcType=VARCHAR},
#{item.analysisObjSeq, jdbcType=VARCHAR},
#{item.analysisObjSeq, jdbcType=VARCHAR},
#{item.weight, jdbcType=FLOAT},
#{item.weight, jdbcType=FLOAT},
...
@@ -344,9 +348,9 @@
...
@@ -344,9 +348,9 @@
#{item.indexAddress, jdbcType=VARCHAR},
#{item.indexAddress, jdbcType=VARCHAR},
#{item.anomaly, jdbcType=FLOAT},
#{item.anomaly, jdbcType=FLOAT},
#{item.pointName, jdbcType=VARCHAR},
#{item.pointName, jdbcType=VARCHAR},
#{item.orgCode, jdbcType=VARCHAR},
#{item.analysisTime, jdbcType=VARCHAR},
#{item.analysisTime, jdbcType=VARCHAR},
#{item.kks, jdbcType=VARCHAR},
#{item.kks, jdbcType=VARCHAR}
#{item.orgCode, jdbcType=VARCHAR}
)
)
</foreach>
</foreach>
</insert>
</insert>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment