Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzdst
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzdst
提交
e4de5626
提交
e4de5626
编写于
3月 28, 2023
作者:
sq3536
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加domains数据集合过滤报表查询,仅支持sql模式
上级
2c5484a2
变更
5
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
30 行增加
和
12 行删除
+30
-12
FetchParam.java
.../main/java/cn/ibizlab/core/extensions/dto/FetchParam.java
+3
-0
ExecResultExMapper.java
...cn/ibizlab/core/extensions/mapper/ExecResultExMapper.java
+3
-3
BuildResultService.java
...n/ibizlab/core/extensions/service/BuildResultService.java
+3
-3
ExecResultExService.java
.../ibizlab/core/extensions/service/ExecResultExService.java
+6
-6
ExecResultExMapper.xml
...n/resources/mapper/rule/execresult/ExecResultExMapper.xml
+15
-0
未找到文件。
ibzdst-core/src/main/java/cn/ibizlab/core/extensions/dto/FetchParam.java
浏览文件 @
e4de5626
...
...
@@ -80,6 +80,9 @@ public class FetchParam {
private
List
<
String
>
metricIds
;
private
String
metricId
;
private
List
<
String
>
domains
;
private
String
domain
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
locale
=
"zh"
,
timezone
=
"GMT+8"
)
@JSONField
(
name
=
"startTime"
,
format
=
"yyyy-MM-dd"
)
...
...
ibzdst-core/src/main/java/cn/ibizlab/core/extensions/mapper/ExecResultExMapper.java
浏览文件 @
e4de5626
...
...
@@ -18,9 +18,9 @@ public interface ExecResultExMapper extends BaseMapper<EntityObj>{
int
replaceBatchByPG
(
@Param
(
"list"
)
List
<
ExecResult
>
var1
,
@Param
(
"resultTableName"
)
String
tableName
);
int
clearBatch
(
@Param
(
"list"
)
List
<
ExecResult
>
var1
,
@Param
(
"resultTableName"
)
String
tableName
);
List
<
ExecResult
>
sumResult
(
@Param
(
"resultTableName"
)
String
tableName
,
@Param
(
"ruleids"
)
List
<
String
>
ruleids
,
@Param
(
"dimfields"
)
List
<
String
>
dimfields
,
@Param
(
"from"
)
Timestamp
from
,
@Param
(
"to"
)
Timestamp
to
);
List
<
ExecResult
>
avgResult
(
@Param
(
"resultTableName"
)
String
tableName
,
@Param
(
"ruleids"
)
List
<
String
>
ruleids
,
@Param
(
"dimfields"
)
List
<
String
>
dimfields
,
@Param
(
"from"
)
Timestamp
from
,
@Param
(
"to"
)
Timestamp
to
);
List
<
ExecResult
>
sumResult
(
@Param
(
"resultTableName"
)
String
tableName
,
@Param
(
"ruleids"
)
List
<
String
>
ruleids
,
@Param
(
"dimfields"
)
List
<
String
>
dimfields
,
@Param
(
"
domainsfields"
)
List
<
String
>
domainsfields
,
@Param
(
"
from"
)
Timestamp
from
,
@Param
(
"to"
)
Timestamp
to
);
List
<
ExecResult
>
avgResult
(
@Param
(
"resultTableName"
)
String
tableName
,
@Param
(
"ruleids"
)
List
<
String
>
ruleids
,
@Param
(
"dimfields"
)
List
<
String
>
dimfields
,
@Param
(
"
domainsfields"
)
List
<
String
>
domainsfields
,
@Param
(
"
from"
)
Timestamp
from
,
@Param
(
"to"
)
Timestamp
to
);
Page
<
ExecResult
>
lookupResult
(
IPage
page
,
@Param
(
"resultTableName"
)
String
tableName
,
@Param
(
"columns"
)
String
columns
,
@Param
(
"ruleid"
)
String
ruleid
,
@Param
(
"dimfield"
)
String
dimfield
,
@Param
(
"from"
)
Timestamp
from
,
@Param
(
"to"
)
Timestamp
to
);
Page
<
ExecResult
>
lookupResult
(
IPage
page
,
@Param
(
"resultTableName"
)
String
tableName
,
@Param
(
"columns"
)
String
columns
,
@Param
(
"ruleid"
)
String
ruleid
,
@Param
(
"dimfield"
)
String
dimfield
,
@Param
(
"
domainsfield"
)
String
domainsfield
,
@Param
(
"
from"
)
Timestamp
from
,
@Param
(
"to"
)
Timestamp
to
);
}
\ No newline at end of file
ibzdst-core/src/main/java/cn/ibizlab/core/extensions/service/BuildResultService.java
浏览文件 @
e4de5626
...
...
@@ -315,7 +315,7 @@ public class BuildResultService {
}
if
(
tmpSet
.
size
()>
0
)
{
List
<
ExecResult
>
list
=
execResultExService
.
sumResult
(
dsName
,
tableName
,
new
ArrayList
<>(
tmpSet
),
fetchParam
.
getDimValues
(),
startTime
,
endTime
);
List
<
ExecResult
>
list
=
execResultExService
.
sumResult
(
dsName
,
tableName
,
new
ArrayList
<>(
tmpSet
),
fetchParam
.
getDimValues
(),
fetchParam
.
getDomains
(),
startTime
,
endTime
);
list
.
forEach
(
item
->{
ret
.
add
(
new
BuildResult
().
setSqlResult
(
item
));
});
...
...
@@ -372,7 +372,7 @@ public class BuildResultService {
}
if
(
tmpSet
.
size
()>
0
)
{
List
<
ExecResult
>
list
=
execResultExService
.
avgResult
(
dsName
,
tableName
,
new
ArrayList
<>(
tmpSet
),
fetchParam
.
getDimValues
(),
startTime
,
endTime
);
List
<
ExecResult
>
list
=
execResultExService
.
avgResult
(
dsName
,
tableName
,
new
ArrayList
<>(
tmpSet
),
fetchParam
.
getDimValues
(),
fetchParam
.
getDomains
(),
startTime
,
endTime
);
list
.
forEach
(
item
->{
ret
.
add
(
new
BuildResult
().
setSqlResult
(
item
));
});
...
...
@@ -428,7 +428,7 @@ public class BuildResultService {
String
dsName
=
args
[
0
];
String
tableName
=
args
[
1
];
Page
<
ExecResult
>
page
=
execResultExService
.
lookupResult
(
fetchParam
.
getPage
(),
fetchParam
.
getSize
(),
dsName
,
tableName
,
"keyvaluefield"
,
fetchParam
.
getMetricId
(),
fetchParam
.
getDimValue
(),
fetchParam
.
getStartTime
(),
fetchParam
.
getEndTime
());
Page
<
ExecResult
>
page
=
execResultExService
.
lookupResult
(
fetchParam
.
getPage
(),
fetchParam
.
getSize
(),
dsName
,
tableName
,
"keyvaluefield"
,
fetchParam
.
getMetricId
(),
fetchParam
.
getDimValue
(),
fetchParam
.
get
Domain
(),
fetchParam
.
get
StartTime
(),
fetchParam
.
getEndTime
());
if
(
lookupResult
.
getTotal
()==
0
||
lookupResult
.
getTotal
()==
null
)
lookupResult
.
setTotal
((
int
)
page
.
getTotalElements
());
page
.
getContent
().
forEach
(
item
->{
...
...
ibzdst-core/src/main/java/cn/ibizlab/core/extensions/service/ExecResultExService.java
浏览文件 @
e4de5626
...
...
@@ -284,7 +284,7 @@ public class ExecResultExService extends ExecResultServiceImpl {
}
public
List
<
ExecResult
>
sumResult
(
String
dsName
,
String
tableName
,
List
<
String
>
ruleids
,
List
<
String
>
dimfields
,
Timestamp
from
,
Timestamp
to
)
public
List
<
ExecResult
>
sumResult
(
String
dsName
,
String
tableName
,
List
<
String
>
ruleids
,
List
<
String
>
dimfields
,
List
<
String
>
domainsfields
,
Timestamp
from
,
Timestamp
to
)
{
List
<
ExecResult
>
result
=
null
;
try
{
...
...
@@ -292,7 +292,7 @@ public class ExecResultExService extends ExecResultServiceImpl {
dstDataSourceService
.
initDataSource
(
dsName
);
DynamicDataSourceContextHolder
.
push
(
dsName
);
}
result
=
execResultExMapper
.
sumResult
(
tableName
,
ruleids
,
dimfields
,
from
,
to
);
result
=
execResultExMapper
.
sumResult
(
tableName
,
ruleids
,
dimfields
,
domainsfields
,
from
,
to
);
}
catch
(
Exception
ex
)
{
result
=
new
ArrayList
<>();
log
.
error
(
"存储规则结果发生异常,详细错误信息:"
+
ex
.
getMessage
());
...
...
@@ -305,7 +305,7 @@ public class ExecResultExService extends ExecResultServiceImpl {
return
result
;
}
public
List
<
ExecResult
>
avgResult
(
String
dsName
,
String
tableName
,
List
<
String
>
ruleids
,
List
<
String
>
dimfields
,
Timestamp
from
,
Timestamp
to
)
public
List
<
ExecResult
>
avgResult
(
String
dsName
,
String
tableName
,
List
<
String
>
ruleids
,
List
<
String
>
dimfields
,
List
<
String
>
domainsfields
,
Timestamp
from
,
Timestamp
to
)
{
List
<
ExecResult
>
result
=
null
;
try
{
...
...
@@ -313,7 +313,7 @@ public class ExecResultExService extends ExecResultServiceImpl {
dstDataSourceService
.
initDataSource
(
dsName
);
DynamicDataSourceContextHolder
.
push
(
dsName
);
}
result
=
execResultExMapper
.
avgResult
(
tableName
,
ruleids
,
dimfields
,
from
,
to
);
result
=
execResultExMapper
.
avgResult
(
tableName
,
ruleids
,
dimfields
,
domainsfields
,
from
,
to
);
}
catch
(
Exception
ex
)
{
result
=
new
ArrayList
<>();
log
.
error
(
"存储规则结果发生异常,详细错误信息:"
+
ex
.
getMessage
());
...
...
@@ -326,7 +326,7 @@ public class ExecResultExService extends ExecResultServiceImpl {
return
result
;
}
public
Page
<
ExecResult
>
lookupResult
(
int
current
,
int
size
,
String
dsName
,
String
tableName
,
String
columns
,
String
ruleid
,
String
dimfield
,
Timestamp
from
,
Timestamp
to
)
{
public
Page
<
ExecResult
>
lookupResult
(
int
current
,
int
size
,
String
dsName
,
String
tableName
,
String
columns
,
String
ruleid
,
String
dimfield
,
String
domainsfield
,
Timestamp
from
,
Timestamp
to
)
{
if
(
StringUtils
.
isEmpty
(
columns
))
columns
=
"*"
;
...
...
@@ -337,7 +337,7 @@ public class ExecResultExService extends ExecResultServiceImpl {
dstDataSourceService
.
initDataSource
(
dsName
);
DynamicDataSourceContextHolder
.
push
(
dsName
);
}
com
.
baomidou
.
mybatisplus
.
extension
.
plugins
.
pagination
.
Page
<
ExecResult
>
pages
=
execResultExMapper
.
lookupResult
(
new
com
.
baomidou
.
mybatisplus
.
extension
.
plugins
.
pagination
.
Page
(
current
+
1
,
size
),
tableName
,
columns
,
ruleid
,
dimfield
,
from
,
to
);
com
.
baomidou
.
mybatisplus
.
extension
.
plugins
.
pagination
.
Page
<
ExecResult
>
pages
=
execResultExMapper
.
lookupResult
(
new
com
.
baomidou
.
mybatisplus
.
extension
.
plugins
.
pagination
.
Page
(
current
+
1
,
size
),
tableName
,
columns
,
ruleid
,
dimfield
,
domainsfield
,
from
,
to
);
result
=
pages
.
getRecords
();
total
=
pages
.
getTotal
();
}
catch
(
Exception
ex
)
{
...
...
ibzdst-core/src/main/resources/mapper/rule/execresult/ExecResultExMapper.xml
浏览文件 @
e4de5626
...
...
@@ -111,6 +111,12 @@
<foreach
item=
"id"
index=
"index"
collection=
"dimfields"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
<choose><when
test=
"domainsfields != null"
>
and DOMAINSFIELD in
<foreach
item=
"id"
index=
"index"
collection=
"domainsfields"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</when></choose>
and TIMEFIELD
<![CDATA[ >= ]]>
#{from} and TIMEFIELD
<![CDATA[ <= ]]>
#{to}
group by ruleid,dimfield
...
...
@@ -126,6 +132,12 @@
<foreach
item=
"id"
index=
"index"
collection=
"dimfields"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
<choose><when
test=
"domainsfields != null"
>
and DOMAINSFIELD in
<foreach
item=
"id"
index=
"index"
collection=
"domainsfields"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</when></choose>
and TIMEFIELD
<![CDATA[ >= ]]>
#{from} and TIMEFIELD
<![CDATA[ <= ]]>
#{to}
group by ruleid,dimfield
...
...
@@ -135,6 +147,9 @@
select ${columns} from ${resultTableName} where ruleid = #{ruleid}
and RETVALUE=1 and DIMFIELD = #{dimfield}
<choose><when
test=
"domainsfield != null and domainsfield != ''"
>
and DOMAINSFIELD = #{domainsfield}
</when></choose>
and TIMEFIELD
<![CDATA[ >= ]]>
#{from} and TIMEFIELD
<![CDATA[ <= ]]>
#{to}
</select>
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录