Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzdst
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzdst
提交
4d53a03f
提交
4d53a03f
编写于
3月 28, 2023
作者:
sq3536
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加domains数据集合过滤报表查询,仅支持sql模式,兼容缓存
上级
c8564bb0
变更
5
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
27 行增加
和
7 行删除
+27
-7
FetchParam.java
.../main/java/cn/ibizlab/core/extensions/dto/FetchParam.java
+18
-1
ExecResultExMapper.java
...cn/ibizlab/core/extensions/mapper/ExecResultExMapper.java
+1
-1
BuildResultService.java
...n/ibizlab/core/extensions/service/BuildResultService.java
+1
-1
ExecResultExService.java
.../ibizlab/core/extensions/service/ExecResultExService.java
+2
-2
ExecResultExMapper.xml
...n/resources/mapper/rule/execresult/ExecResultExMapper.xml
+5
-2
未找到文件。
ibzdst-core/src/main/java/cn/ibizlab/core/extensions/dto/FetchParam.java
浏览文件 @
4d53a03f
...
@@ -16,6 +16,7 @@ import lombok.NoArgsConstructor;
...
@@ -16,6 +16,7 @@ import lombok.NoArgsConstructor;
import
lombok.Setter
;
import
lombok.Setter
;
import
lombok.experimental.Accessors
;
import
lombok.experimental.Accessors
;
import
org.springframework.util.DigestUtils
;
import
org.springframework.util.DigestUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
import
java.sql.Timestamp
;
import
java.sql.Timestamp
;
...
@@ -47,7 +48,8 @@ public class FetchParam {
...
@@ -47,7 +48,8 @@ public class FetchParam {
", displayType='"
+
displayType
+
'\''
+
", displayType='"
+
displayType
+
'\''
+
", dimDict='"
+
dimDict
+
'\''
+
", dimDict='"
+
dimDict
+
'\''
+
", dimValues="
+
dimValues
+
", dimValues="
+
dimValues
+
", dimItems="
+
JSONObject
.
toJSONString
(
dimItems
)+
", dimItems="
+
JSONObject
.
toJSONString
(
dimItems
)+
", domains="
+
JSONObject
.
toJSONString
(
getDomains
())+
", dimValue='"
+
dimValue
+
'\''
+
", dimValue='"
+
dimValue
+
'\''
+
", includeChild="
+
includeChild
+
", includeChild="
+
includeChild
+
", metricIds="
+
metricIds
+
", metricIds="
+
metricIds
+
...
@@ -86,6 +88,21 @@ public class FetchParam {
...
@@ -86,6 +88,21 @@ public class FetchParam {
private
String
domain
;
private
String
domain
;
public
List
<
String
>
getDomains
()
{
if
(
ObjectUtils
.
isEmpty
(
domains
)
&&
domain
!=
null
)
{
domains
=
new
ArrayList
<>();
domains
.
add
(
domain
);
}
return
domains
;
}
public
String
getDomain
()
{
if
(
domain
==
null
&&
!
ObjectUtils
.
isEmpty
(
domains
))
{
domain
=
domains
.
get
(
0
);
}
return
domain
;
}
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
locale
=
"zh"
,
timezone
=
"GMT+8"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
locale
=
"zh"
,
timezone
=
"GMT+8"
)
@JSONField
(
name
=
"startTime"
,
format
=
"yyyy-MM-dd"
)
@JSONField
(
name
=
"startTime"
,
format
=
"yyyy-MM-dd"
)
private
Timestamp
startTime
;
private
Timestamp
startTime
;
...
...
ibzdst-core/src/main/java/cn/ibizlab/core/extensions/mapper/ExecResultExMapper.java
浏览文件 @
4d53a03f
...
@@ -21,6 +21,6 @@ public interface ExecResultExMapper extends BaseMapper<EntityObj>{
...
@@ -21,6 +21,6 @@ public interface ExecResultExMapper extends BaseMapper<EntityObj>{
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
>
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
);
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
(
"domainsfield
"
)
String
domainsfield
,
@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
s"
)
List
<
String
>
domainsfields
,
@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
浏览文件 @
4d53a03f
...
@@ -428,7 +428,7 @@ public class BuildResultService {
...
@@ -428,7 +428,7 @@ public class BuildResultService {
String
dsName
=
args
[
0
];
String
dsName
=
args
[
0
];
String
tableName
=
args
[
1
];
String
tableName
=
args
[
1
];
Page
<
ExecResult
>
page
=
execResultExService
.
lookupResult
(
fetchParam
.
getPage
(),
fetchParam
.
getSize
(),
dsName
,
tableName
,
"keyvaluefield"
,
fetchParam
.
getMetricId
(),
fetchParam
.
getDimValue
(),
fetchParam
.
getDomain
(),
fetchParam
.
getStartTime
(),
fetchParam
.
getEndTime
());
Page
<
ExecResult
>
page
=
execResultExService
.
lookupResult
(
fetchParam
.
getPage
(),
fetchParam
.
getSize
(),
dsName
,
tableName
,
"keyvaluefield"
,
fetchParam
.
getMetricId
(),
fetchParam
.
getDimValue
(),
fetchParam
.
getDomain
s
(),
fetchParam
.
getStartTime
(),
fetchParam
.
getEndTime
());
if
(
lookupResult
.
getTotal
()==
0
||
lookupResult
.
getTotal
()==
null
)
if
(
lookupResult
.
getTotal
()==
0
||
lookupResult
.
getTotal
()==
null
)
lookupResult
.
setTotal
((
int
)
page
.
getTotalElements
());
lookupResult
.
setTotal
((
int
)
page
.
getTotalElements
());
page
.
getContent
().
forEach
(
item
->{
page
.
getContent
().
forEach
(
item
->{
...
...
ibzdst-core/src/main/java/cn/ibizlab/core/extensions/service/ExecResultExService.java
浏览文件 @
4d53a03f
...
@@ -326,7 +326,7 @@ public class ExecResultExService extends ExecResultServiceImpl {
...
@@ -326,7 +326,7 @@ public class ExecResultExService extends ExecResultServiceImpl {
return
result
;
return
result
;
}
}
public
Page
<
ExecResult
>
lookupResult
(
int
current
,
int
size
,
String
dsName
,
String
tableName
,
String
columns
,
String
ruleid
,
String
dimfield
,
String
domainsfield
,
Timestamp
from
,
Timestamp
to
)
{
public
Page
<
ExecResult
>
lookupResult
(
int
current
,
int
size
,
String
dsName
,
String
tableName
,
String
columns
,
String
ruleid
,
String
dimfield
,
List
<
String
>
domainsfields
,
Timestamp
from
,
Timestamp
to
)
{
if
(
StringUtils
.
isEmpty
(
columns
))
if
(
StringUtils
.
isEmpty
(
columns
))
columns
=
"*"
;
columns
=
"*"
;
...
@@ -337,7 +337,7 @@ public class ExecResultExService extends ExecResultServiceImpl {
...
@@ -337,7 +337,7 @@ public class ExecResultExService extends ExecResultServiceImpl {
dstDataSourceService
.
initDataSource
(
dsName
);
dstDataSourceService
.
initDataSource
(
dsName
);
DynamicDataSourceContextHolder
.
push
(
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
,
domainsfield
,
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
s
,
from
,
to
);
result
=
pages
.
getRecords
();
result
=
pages
.
getRecords
();
total
=
pages
.
getTotal
();
total
=
pages
.
getTotal
();
}
catch
(
Exception
ex
)
{
}
catch
(
Exception
ex
)
{
...
...
ibzdst-core/src/main/resources/mapper/rule/execresult/ExecResultExMapper.xml
浏览文件 @
4d53a03f
...
@@ -147,8 +147,11 @@
...
@@ -147,8 +147,11 @@
select ${columns} from ${resultTableName} where ruleid = #{ruleid}
select ${columns} from ${resultTableName} where ruleid = #{ruleid}
and RETVALUE=1 and DIMFIELD = #{dimfield}
and RETVALUE=1 and DIMFIELD = #{dimfield}
<choose><when
test=
"domainsfield != null and domainsfield != ''"
>
<choose><when
test=
"domainsfields != null"
>
and DOMAINSFIELD = #{domainsfield}
and DOMAINSFIELD in
<foreach
item=
"id"
index=
"index"
collection=
"domainsfields"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</when></choose>
</when></choose>
and TIMEFIELD
<![CDATA[ >= ]]>
#{from} and TIMEFIELD
<![CDATA[ <= ]]>
#{to}
and TIMEFIELD
<![CDATA[ >= ]]>
#{from} and TIMEFIELD
<![CDATA[ <= ]]>
#{to}
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录